editor.main-DpNMXfyH.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/tsMode-B866h-rO.js","assets/index-DT8qTvyx.js","assets/index-We5Babj5.css","assets/cssMode-eBylpmo-.js","assets/jsonMode-DTPlfJVi.js","assets/htmlMode-COQ-WmPk.js","assets/handlebars-tICy3fok.js","assets/html-CIhdV4Dm.js","assets/javascript-6-OYjSbv.js","assets/typescript-hltC-XIV.js","assets/liquid-C1TmegDG.js","assets/python-BH2HFM7y.js","assets/razor-DGcNB0iQ.js","assets/xml-CRrmAUmf.js"])))=>i.map(i=>d[i]);
  2. import{o as ce}from"./index-DT8qTvyx.js";function EB(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 EB(e,t)}var Pw;const m_="en";let tb=!1,ib=!1,__=!1,wR=!1,SR=!1,BD=!1,gm,Fw=m_,NB,Na;const Et=typeof self=="object"?self:typeof global=="object"?global:{};let qi;typeof Et.vscode<"u"&&typeof Et.vscode.process<"u"?qi=Et.vscode.process:typeof process<"u"&&(qi=process);const TB=typeof((Pw=qi==null?void 0:qi.versions)===null||Pw===void 0?void 0:Pw.electron)=="string"&&qi.type==="renderer";if(typeof navigator=="object"&&!TB)Na=navigator.userAgent,tb=Na.indexOf("Windows")>=0,ib=Na.indexOf("Macintosh")>=0,BD=(Na.indexOf("Macintosh")>=0||Na.indexOf("iPad")>=0||Na.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,__=Na.indexOf("Linux")>=0,SR=!0,gm=navigator.language,Fw=gm;else if(typeof qi=="object"){tb=qi.platform==="win32",ib=qi.platform==="darwin",__=qi.platform==="linux",__&&qi.env.SNAP&&qi.env.SNAP_REVISION,gm=m_,Fw=m_;const s=qi.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s),t=e.availableLanguages["*"];gm=e.locale,Fw=t||m_,NB=e._translationsConfigFile}catch{}wR=!0}else console.error("Unable to resolve platform.");const Ai=tb,Me=ib,Cn=__,uo=wR,Nu=SR,lr=BD,AB=Na,KS=function(){if(Et.setImmediate)return Et.setImmediate.bind(Et);if(typeof Et.postMessage=="function"&&!Et.importScripts){let t=[];Et.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}),Et.postMessage({vscodeSetImmediateId:o},"*")}}if(typeof(qi==null?void 0:qi.nextTick)=="function")return qi.nextTick.bind(qi);const e=Promise.resolve();return t=>e.then(t)}(),Ms=ib||BD?2:tb?1:3;let WI=!0,VI=!1;function yR(){if(!VI){VI=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,WI=new Uint16Array(s.buffer)[0]===513}return WI}const LR="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function RB(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of LR)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const DR=RB();function nb(s){let e=DR;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 MB={maxLen:1e3,windowSize:15,timeBudget:150};function sb(s,e,t,i,n=MB){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),sb(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 h=r-n.windowSize*d;e.lastIndex=Math.max(0,h);const c=OB(e,t,r,a);if(!c&&l||(l=c,h<=0))break;a=h}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 OB(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 Ta=8;class xR{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class PB{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class kR{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class pi{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class Tu{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 mh{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 pe(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class ze extends mh{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return pe(e,this.defaultValue)}}function qS(s,e,t,i){if(typeof s>"u")return e;let n=parseInt(s,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class St extends mh{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){return qS(e,t,i,n)}validate(e){return St.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class er extends mh{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(er.float(e,this.defaultValue))}}class kn extends mh{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 kn.string(e,this.defaultValue)}}function mn(s,e,t){return typeof s!="string"||t.indexOf(s)===-1?e:s}class ti extends mh{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 mn(e,this.defaultValue,this._allowedValues)}}class nf extends pi{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 FB(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class BB extends pi{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 WB extends pi{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"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:pe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:pe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function VB(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var wi;(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"})(wi||(wi={}));function HB(s){switch(s){case"line":return wi.Line;case"block":return wi.Block;case"underline":return wi.Underline;case"line-thin":return wi.LineThin;case"block-outline":return wi.BlockOutline;case"underline-thin":return wi.UnderlineThin}}class zB extends Tu{constructor(){super(126,[65,33])}compute(e,t,i){const n=["monaco-editor"];return t.get(33)&&n.push(t.get(33)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(65)==="default"?n.push("mouse-default"):t.get(65)==="copy"&&n.push("mouse-copy"),t.get(99)&&n.push("showUnused"),t.get(124)&&n.push("showDeprecated"),n.join(" ")}}class UB extends ze{constructor(){super(32,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class $B extends pi{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"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:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],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:Me},"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:pe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":mn(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":mn(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:pe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:pe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:pe(t.loop,this.defaultValue.loop)}}}class Hn extends pi{constructor(){super(44,"fontLigatures",Hn.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"?Hn.OFF:e==="true"?Hn.ON:e:e?Hn.ON:Hn.OFF}}Hn.OFF='"liga" off, "calt" off';Hn.ON='"liga" on, "calt" on';class jB extends Tu{constructor(){super(43)}compute(e,t,i){return e.fontInfo}}class KB extends mh{constructor(){super(45,"fontSize",Hi.fontSize,{type:"number",minimum:6,maximum:100,default:Hi.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){let t=er.float(e,this.defaultValue);return t===0?Hi.fontSize:er.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Zo extends pi{constructor(){super(46,"fontWeight",Hi.fontWeight,{anyOf:[{type:"number",minimum:Zo.MINIMUM_VALUE,maximum:Zo.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:Zo.SUGGESTION_VALUES}],default:Hi.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(St.clampedInt(e,Hi.fontWeight,Zo.MINIMUM_VALUE,Zo.MAXIMUM_VALUE))}}Zo.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Zo.MINIMUM_VALUE=1;Zo.MAXIMUM_VALUE=1e3;class qB extends pi{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(50,"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:mn(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:mn(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:mn(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:mn(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:mn(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:mn(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:kn.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:kn.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:kn.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:kn.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:kn.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class GB extends pi{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(52,"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.")},"editor.hover.above":{type:"boolean",default:e.above,description:p("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:pe(t.enabled,this.defaultValue.enabled),delay:St.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:pe(t.sticky,this.defaultValue.sticky),above:pe(t.above,this.defaultValue.above)}}}class Ec extends Tu{constructor(){super(129,[49,57,37,64,91,59,60,93,116,119,120,121,2])}compute(e,t,i){return Ec.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,h=e.scrollBeyondLastLine,c=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,_=e.verticalScrollbarWidth,C=e.viewLineCount,b=e.remainingWidth,v=e.isViewportWrapping,w=c?2:3;let y=Math.floor(o*n);const k=y/o;let L=!1,D=!1,N=w*u,B=u/o,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:we,extraLinesBeyondLastLine:Se,desiredRatio:Tt,minimapLineCount:bt}=Ec.computeContainedMinimapLineCount({viewLineCount:C,scrollBeyondLastLine:h,height:n,lineHeight:l,pixelRatio:o});if(C/bt>1)L=!0,D=!0,u=1,N=1,B=u/o;else{let Pt=!1,dt=u+1;if(g==="fit"){const Sn=Math.ceil((C+Se)*N);v&&a&&b<=t.stableFitRemainingWidth?(Pt=!0,dt=t.stableFitMaxMinimapScale):Pt=Sn>y}if(g==="fill"||Pt){L=!0;const Sn=u;N=Math.min(l*o,Math.max(1,Math.floor(1/Tt))),v&&a&&b<=t.stableFitRemainingWidth&&(dt=t.stableFitMaxMinimapScale),u=Math.min(dt,Math.max(1,Math.floor(N/w))),u>Sn&&(O=Math.min(2,u/Sn)),B=u/o/O,y=Math.ceil(Math.max(we,C+Se)*N),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const $=Math.floor(f*B),K=Math.min($,Math.max(0,Math.floor((b-_-2)*B/(d+B)))+Ta);let le=Math.floor(o*K);const de=le/o;le=Math.floor(le*O);const _e=c?1:2,De=m==="left"?0:i-K-_;return{renderMinimap:_e,minimapLeft:De,minimapWidth:K,minimapHeightIsEditorHeight:L,minimapIsSampling:D,minimapScale:u,minimapLineHeight:N,minimapCanvasInnerWidth:le,minimapCanvasInnerHeight:y,minimapCanvasOuterWidth:de,minimapCanvasOuterHeight:k}}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,h=t.viewLineCount,c=e.get(121),u=c==="inherit"?e.get(120):c,f=u==="inherit"?e.get(116):u,g=e.get(119),m=e.get(2),_=t.isDominatedByLongLines,C=e.get(49),b=e.get(59).renderType!==0,v=e.get(60),w=e.get(93),y=e.get(64),k=e.get(91),L=k.verticalScrollbarSize,D=k.verticalHasArrows,N=k.arrowSize,B=k.horizontalScrollbarSize,O=e.get(57),$=e.get(37);let K;if(typeof O=="string"&&/^\d+(\.\d+)?ch$/.test(O)){const Xs=parseFloat(O.substr(0,O.length-2));K=St.clampedInt(Xs*a,0,0,1e3)}else K=St.clampedInt(O,0,0,1e3);$&&(K+=16);let le=0;if(b){const Xs=Math.max(r,v);le=Math.round(Xs*l)}let de=0;C&&(de=o);let _e=0,De=_e+de,we=De+le,Se=we+K;const Tt=i-de-le-K;let bt=!1,xt=!1,Pt=-1;m!==2&&(u==="inherit"&&_?(bt=!0,xt=!0):f==="on"||f==="bounded"?xt=!0:f==="wordWrapColumn"&&(Pt=g));const dt=Ec._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:w,minimap:y,verticalScrollbarWidth:L,viewLineCount:h,remainingWidth:Tt,isViewportWrapping:xt},t.memory||new kR);dt.renderMinimap!==0&&dt.minimapLeft===0&&(_e+=dt.minimapWidth,De+=dt.minimapWidth,we+=dt.minimapWidth,Se+=dt.minimapWidth);const Sn=Tt-dt.minimapWidth,No=Math.max(1,Math.floor((Sn-L-2)/a)),xr=D?N:0;return xt&&(Pt=Math.max(1,No),f==="bounded"&&(Pt=Math.min(Pt,g))),{width:i,height:n,glyphMarginLeft:_e,glyphMarginWidth:de,lineNumbersLeft:De,lineNumbersWidth:le,decorationsLeft:we,decorationsWidth:K,contentLeft:Se,contentWidth:Sn,minimap:dt,viewportColumn:No,isWordWrapMinified:bt,isViewportWrapping:xt,wrappingColumn:Pt,verticalScrollbarWidth:L,horizontalScrollbarHeight:B,overviewRuler:{top:xr,width:L,height:n-2*xr,right:0}}}}class ZB extends pi{constructor(){const e={enabled:!0};super(56,"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:pe(e.enabled,this.defaultValue.enabled)}}}class YB extends pi{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(125,"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. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:pe(t.enabled,this.defaultValue.enabled),fontSize:St.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:kn.string(t.fontFamily,this.defaultValue.fontFamily)}}}class XB extends er{constructor(){super(58,"lineHeight",Hi.lineHeight,e=>er.clamp(e,0,150),{markdownDescription:p("lineHeight",`Controls the line height.
  3. - Use 0 to automatically compute the line height from the font size.
  4. - Values between 0 and 8 will be used as a multiplier with the font size.
  5. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class QB extends pi{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(64,"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:pe(t.enabled,this.defaultValue.enabled),size:mn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:mn(t.side,this.defaultValue.side,["right","left"]),showSlider:mn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:pe(t.renderCharacters,this.defaultValue.renderCharacters),scale:St.clampedInt(t.scale,1,1,3),maxColumn:St.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function JB(s){return s==="ctrlCmd"?Me?"metaKey":"ctrlKey":"altKey"}class e5 extends pi{constructor(){super(74,"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:St.clampedInt(t.top,0,0,1e3),bottom:St.clampedInt(t.bottom,0,0,1e3)}}}class t5 extends pi{constructor(){const e={enabled:!0,cycle:!1};super(75,"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:pe(t.enabled,this.defaultValue.enabled),cycle:pe(t.cycle,this.defaultValue.cycle)}}}class i5 extends Tu{constructor(){super(127)}compute(e,t,i){return e.pixelRatio}}class n5 extends pi{constructor(){const e={other:!0,comments:!1,strings:!1};super(78,"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:pe(t.other,this.defaultValue.other),comments:pe(t.comments,this.defaultValue.comments),strings:pe(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 s5 extends pi{constructor(){super(59,"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 WD(s){const e=s.get(86);return e==="editable"?s.get(80):e!=="on"}class o5 extends pi{constructor(){const e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(90,"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:St.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:St.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}function HI(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let r5=class extends pi{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(91,"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=St.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=St.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:St.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:HI(t.vertical,this.defaultValue.vertical),horizontal:HI(t.horizontal,this.defaultValue.horizontal),useShadows:pe(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:pe(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:pe(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:pe(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:pe(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:St.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:St.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:pe(t.scrollByPage,this.defaultValue.scrollByPage)}}};class a5 extends pi{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(54,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:pe(t.enabled,this.defaultValue.enabled),mode:mn(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}class l5 extends pi{constructor(){const e={enabled:Gi.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:p("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:pe(e.enabled,this.defaultValue.enabled)}}}class d5 extends pi{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairs.true","Enables bracket pair guides."),p("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),p("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:p("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),p("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),p("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:p("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p("editor.guides.highlightActiveBracketPair","Controls whether bracket pair guides are enabled or not.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:p("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:zI(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:zI(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:pe(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:pe(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:pe(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}function zI(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class h5 extends pi{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",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(105,"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.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:mn(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:pe(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:pe(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:pe(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:pe(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:pe(t.showIcons,this.defaultValue.showIcons),showStatusBar:pe(t.showStatusBar,this.defaultValue.showStatusBar),preview:pe(t.preview,this.defaultValue.preview),previewMode:mn(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:pe(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:pe(t.showMethods,this.defaultValue.showMethods),showFunctions:pe(t.showFunctions,this.defaultValue.showFunctions),showConstructors:pe(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:pe(t.showDeprecated,this.defaultValue.showDeprecated),showFields:pe(t.showFields,this.defaultValue.showFields),showVariables:pe(t.showVariables,this.defaultValue.showVariables),showClasses:pe(t.showClasses,this.defaultValue.showClasses),showStructs:pe(t.showStructs,this.defaultValue.showStructs),showInterfaces:pe(t.showInterfaces,this.defaultValue.showInterfaces),showModules:pe(t.showModules,this.defaultValue.showModules),showProperties:pe(t.showProperties,this.defaultValue.showProperties),showEvents:pe(t.showEvents,this.defaultValue.showEvents),showOperators:pe(t.showOperators,this.defaultValue.showOperators),showUnits:pe(t.showUnits,this.defaultValue.showUnits),showValues:pe(t.showValues,this.defaultValue.showValues),showConstants:pe(t.showConstants,this.defaultValue.showConstants),showEnums:pe(t.showEnums,this.defaultValue.showEnums),showEnumMembers:pe(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:pe(t.showKeywords,this.defaultValue.showKeywords),showWords:pe(t.showWords,this.defaultValue.showWords),showColors:pe(t.showColors,this.defaultValue.showColors),showFiles:pe(t.showFiles,this.defaultValue.showFiles),showReferences:pe(t.showReferences,this.defaultValue.showReferences),showFolders:pe(t.showFolders,this.defaultValue.showFolders),showTypeParameters:pe(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:pe(t.showSnippets,this.defaultValue.showSnippets),showUsers:pe(t.showUsers,this.defaultValue.showUsers),showIssues:pe(t.showIssues,this.defaultValue.showIssues)}}}class c5 extends pi{constructor(){super(101,"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:pe(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}}}class u5 extends Tu{constructor(){super(128,[80])}compute(e,t,i){return t.get(80)?!0:e.tabFocusMode}}function f5(s){switch(s){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class g5 extends Tu{constructor(){super(130,[129])}compute(e,t,i){const n=t.get(129);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}const p5="Consolas, 'Courier New', monospace",m5="Menlo, Monaco, 'Courier New', monospace",_5="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",Hi={fontFamily:Me?m5:Cn?_5:p5,fontWeight:"normal",fontSize:Me?12:14,lineHeight:0,letterSpacing:0},Gi={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},pc=[];function Q(s){return pc[s.id]=s,s}const Do={acceptSuggestionOnCommitCharacter:Q(new ze(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:Q(new ti(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:Q(new BB),accessibilityPageSize:Q(new St(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:Q(new kn(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:Q(new ti(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:Q(new ti(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:Q(new ti(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:Q(new ti(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:Q(new nf(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],FB,{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:Q(new ze(10,"automaticLayout",!1)),autoSurround:Q(new ti(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.")})),bracketPairColorization:Q(new l5),bracketPairGuides:Q(new d5),stickyTabStops:Q(new ze(103,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Q(new ze(14,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Q(new kn(15,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Q(new St(16,"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:Q(new ze(17,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:Q(new ze(18,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Q(new WB),contextmenu:Q(new ze(20,"contextmenu",!0)),copyWithSyntaxHighlighting:Q(new ze(21,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Q(new nf(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],VB,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Q(new ze(23,"cursorSmoothCaretAnimation",!1,{description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Q(new nf(24,"cursorStyle",wi.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],HB,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Q(new St(25,"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:Q(new ti(26,"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:Q(new St(27,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Q(new ze(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:Q(new ze(29,"disableMonospaceOptimizations",!1)),domReadOnly:Q(new ze(30,"domReadOnly",!1)),dragAndDrop:Q(new ze(31,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Q(new UB),extraEditorClassName:Q(new kn(33,"extraEditorClassName","")),fastScrollSensitivity:Q(new er(34,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Q(new $B),fixedOverflowWidgets:Q(new ze(36,"fixedOverflowWidgets",!1)),folding:Q(new ze(37,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Q(new ti(38,"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:Q(new ze(39,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Q(new ze(40,"foldingImportsByDefault",!1,{description:p("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),unfoldOnClickAfterEndOfLine:Q(new ze(41,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Q(new kn(42,"fontFamily",Hi.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:Q(new jB),fontLigatures2:Q(new Hn),fontSize:Q(new KB),fontWeight:Q(new Zo),formatOnPaste:Q(new ze(47,"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:Q(new ze(48,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Q(new ze(49,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Q(new qB),hideCursorInOverviewRuler:Q(new ze(51,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Q(new GB),inDiffEditor:Q(new ze(53,"inDiffEditor",!1)),letterSpacing:Q(new er(55,"letterSpacing",Hi.letterSpacing,s=>er.clamp(s,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Q(new ZB),lineDecorationsWidth:Q(new mh(57,"lineDecorationsWidth",10)),lineHeight:Q(new XB),lineNumbers:Q(new s5),lineNumbersMinChars:Q(new St(60,"lineNumbersMinChars",5,1,300)),linkedEditing:Q(new ze(61,"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:Q(new ze(62,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Q(new ti(63,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:Q(new QB),mouseStyle:Q(new ti(65,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Q(new er(66,"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:Q(new ze(67,"mouseWheelZoom",!1,{markdownDescription:p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Q(new ze(68,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Q(new nf(69,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],JB,{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({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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:Q(new ti(70,"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:Q(new ze(71,"occurrencesHighlight",!0,{description:p("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Q(new ze(72,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Q(new St(73,"overviewRulerLanes",3,0,3)),padding:Q(new e5),parameterHints:Q(new t5),peekWidgetDefaultFocus:Q(new ti(76,"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:Q(new ze(77,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Q(new n5),quickSuggestionsDelay:Q(new St(79,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Q(new ze(80,"readOnly",!1)),renameOnType:Q(new ze(81,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Q(new ze(82,"renderControlCharacters",!0,{description:p("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Q(new ze(83,"renderFinalNewline",!0,{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Q(new ti(84,"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:Q(new ze(85,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Q(new ti(86,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Q(new ti(87,"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:Q(new St(88,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:Q(new ze(89,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Q(new o5),scrollbar:Q(new r5),scrollBeyondLastColumn:Q(new St(92,"scrollBeyondLastColumn",5,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Q(new ze(93,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Q(new ze(94,"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:Q(new ze(95,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Cn})),selectionHighlight:Q(new ze(96,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Q(new ze(97,"selectOnLineNumbers",!0)),showFoldingControls:Q(new ti(98,"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:Q(new ze(99,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:Q(new ze(124,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Q(new YB),snippetSuggestions:Q(new ti(100,"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:Q(new c5),smoothScrolling:Q(new ze(102,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Q(new St(104,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Q(new h5),inlineSuggest:Q(new a5),suggestFontSize:Q(new St(106,"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:Q(new St(107,"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:Q(new ze(108,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Q(new ti(109,"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:Q(new ti(110,"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:Q(new St(111,"tabIndex",0,-1,1073741824)),unusualLineTerminators:Q(new ti(112,"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:Q(new ze(113,"useShadowDOM",!0)),useTabStops:Q(new ze(114,"useTabStops",!0,{description:p("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:Q(new kn(115,"wordSeparators",LR,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Q(new ti(116,"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({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),p({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:p({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Q(new kn(117,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Q(new kn(118,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Q(new St(119,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Q(new ti(120,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Q(new ti(121,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:Q(new nf(122,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],f5,{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:Q(new ti(123,"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:Q(new zB),pixelRatio:Q(new i5),tabFocusMode:Q(new u5),layoutInfo:Q(new Ec),wrappingInfo:Q(new g5)};class b5{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?new Error(e.message+`
  6. `+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 IR=new b5;function Le(s){br(s)||IR.onUnexpectedError(s)}function Di(s){br(s)||IR.onUnexpectedExternalError(s)}function UI(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 GS="Canceled";function br(s){return s instanceof Error&&s.name===GS&&s.message===GS}function Au(){const s=new Error(GS);return s.name=s.message,s}function fo(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function C5(s){return new Error(`Illegal state: ${s}`)}class v5 extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}function ha(s){const e=this;let t=!1,i;return function(){return t||(t=!0,i=s.apply(e,arguments)),i}}var Ue;(function(s){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(b){yield b}s.single=n;function o(b){return b||t}s.from=o;function r(b){return!b||b[Symbol.iterator]().next().done===!0}s.isEmpty=r;function a(b){return b[Symbol.iterator]().next().value}s.first=a;function l(b,v){for(const w of b)if(v(w))return!0;return!1}s.some=l;function d(b,v){for(const w of b)if(v(w))return w}s.find=d;function*h(b,v){for(const w of b)v(w)&&(yield w)}s.filter=h;function*c(b,v){let w=0;for(const y of b)yield v(y,w++)}s.map=c;function*u(...b){for(const v of b)for(const w of v)yield w}s.concat=u;function*f(b){for(const v of b)for(const w of v)yield w}s.concatNested=f;function g(b,v,w){let y=w;for(const k of b)y=v(y,k);return y}s.reduce=g;function*m(b,v,w=b.length){for(v<0&&(v+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);v<w;v++)yield b[v]}s.slice=m;function _(b,v=Number.POSITIVE_INFINITY){const w=[];if(v===0)return[w,b];const y=b[Symbol.iterator]();for(let k=0;k<v;k++){const L=y.next();if(L.done)return[w,s.empty()];w.push(L.value)}return[w,{[Symbol.iterator](){return y}}]}s.consume=_;function C(b,v,w=(y,k)=>y===k){const y=b[Symbol.iterator](),k=v[Symbol.iterator]();for(;;){const L=y.next(),D=k.next();if(L.done!==D.done)return!1;if(L.done)return!0;if(!w(L.value,D.value))return!1}}s.equals=C})(Ue||(Ue={}));class w5 extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function VD(s){return typeof s.dispose=="function"&&s.dispose.length===0}function qe(s){if(Ue.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 w5(e);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function Za(...s){return Ve(()=>qe(s))}function Ve(s){return{dispose:ha(()=>{s()})}}class X{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){try{qe(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 H{constructor(){this._store=new X,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}H.None=Object.freeze({dispose(){}});class dn{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}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class S5{constructor(e){this.object=e}dispose(){}}let Qt=class ZS{constructor(e){this.element=e,this.next=ZS.Undefined,this.prev=ZS.Undefined}};Qt.Undefined=new Qt(void 0);class jn{constructor(){this._first=Qt.Undefined,this._last=Qt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Qt.Undefined}clear(){let e=this._first;for(;e!==Qt.Undefined;){const t=e.next;e.prev=Qt.Undefined,e.next=Qt.Undefined,e=t}this._first=Qt.Undefined,this._last=Qt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Qt(e);if(this._first===Qt.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!==Qt.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Qt.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Qt.Undefined&&e.next!==Qt.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Qt.Undefined&&e.next===Qt.Undefined?(this._first=Qt.Undefined,this._last=Qt.Undefined):e.next===Qt.Undefined?(this._last=this._last.prev,this._last.next=Qt.Undefined):e.prev===Qt.Undefined&&(this._first=this._first.next,this._first.prev=Qt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Qt.Undefined;)yield e.element,e=e.next}}const y5=Et.performance&&typeof Et.performance.now=="function";class dr{constructor(e){this._highResolution=y5&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new dr(e)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Et.performance.now():Date.now()}}var he;(function(s){s.None=()=>H.None;function e(b){return(v,w=null,y)=>{let k=!1,L;return L=b(D=>{if(!k)return L?L.dispose():k=!0,v.call(w,D)},null,y),k&&L.dispose(),L}}s.once=e;function t(b,v){return l((w,y=null,k)=>b(L=>w.call(y,v(L)),null,k))}s.map=t;function i(b,v){return l((w,y=null,k)=>b(L=>{v(L),w.call(y,L)},null,k))}s.forEach=i;function n(b,v){return l((w,y=null,k)=>b(L=>v(L)&&w.call(y,L),null,k))}s.filter=n;function o(b){return b}s.signal=o;function r(...b){return(v,w=null,y)=>Za(...b.map(k=>k(L=>v.call(w,L),null,y)))}s.any=r;function a(b,v,w){let y=w;return t(b,k=>(y=v(y,k),y))}s.reduce=a;function l(b){let v;const w=new M({onFirstListenerAdd(){v=b(w.fire,w)},onLastListenerRemove(){v.dispose()}});return w.event}function d(b,v,w=100,y=!1,k){let L,D,N,B=0;const O=new M({leakWarningThreshold:k,onFirstListenerAdd(){L=b($=>{B++,D=v(D,$),y&&!N&&(O.fire(D),D=void 0),clearTimeout(N),N=setTimeout(()=>{const K=D;D=void 0,N=void 0,(!y||B>1)&&O.fire(K),B=0},w)})},onLastListenerRemove(){L.dispose()}});return O.event}s.debounce=d;function h(b,v=(w,y)=>w===y){let w=!0,y;return n(b,k=>{const L=w||!v(k,y);return w=!1,y=k,L})}s.latch=h;function c(b,v){return[s.filter(b,v),s.filter(b,w=>!v(w))]}s.split=c;function u(b,v=!1,w=[]){let y=w.slice(),k=b(N=>{y?y.push(N):D.fire(N)});const L=()=>{y&&y.forEach(N=>D.fire(N)),y=null},D=new M({onFirstListenerAdd(){k||(k=b(N=>D.fire(N)))},onFirstListenerDidAdd(){y&&(v?setTimeout(L):L())},onLastListenerRemove(){k&&k.dispose(),k=null}});return D.event}s.buffer=u;class f{constructor(v){this.event=v}map(v){return new f(t(this.event,v))}forEach(v){return new f(i(this.event,v))}filter(v){return new f(n(this.event,v))}reduce(v,w){return new f(a(this.event,v,w))}latch(){return new f(h(this.event))}debounce(v,w=100,y=!1,k){return new f(d(this.event,v,w,y,k))}on(v,w,y){return this.event(v,w,y)}once(v,w,y){return e(this.event)(v,w,y)}}function g(b){return new f(b)}s.chain=g;function m(b,v,w=y=>y){const y=(...N)=>D.fire(w(...N)),k=()=>b.on(v,y),L=()=>b.removeListener(v,y),D=new M({onFirstListenerAdd:k,onLastListenerRemove:L});return D.event}s.fromNodeEventEmitter=m;function _(b,v,w=y=>y){const y=(...N)=>D.fire(w(...N)),k=()=>b.addEventListener(v,y),L=()=>b.removeEventListener(v,y),D=new M({onFirstListenerAdd:k,onLastListenerRemove:L});return D.event}s.fromDOMEventEmitter=_;function C(b){return new Promise(v=>e(b)(v))}s.toPromise=C})(he||(he={}));class UC{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${UC._idPool++}`}start(e){this._stopWatch=new dr(!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}}}UC._idPool=0;let M=class{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 UC(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new jn);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),l=Ve(()=>{a&&a(),this._disposed||(r(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return 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 jn);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){Le(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())}};class ob extends M{constructor(e){super(e),this._isPaused=0,this._eventQueue=new jn,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 L5 extends ob{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 HD{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 $I{constructor(){this.listening=!1,this.inputEvent=he.None,this.inputEventListener=H.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 ER=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var Oe;(function(s){function e(t){return t===s.None||t===s.Cancelled||t instanceof b_?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s.isCancellationToken=e,s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:he.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ER})})(Oe||(Oe={}));class b_{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?ER:(this._emitter||(this._emitter=new M),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let ln=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new b_),this._token}cancel(){this._token?this._token instanceof b_&&this._token.cancel():this._token=Oe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof b_&&this._token.dispose():this._token=Oe.None}};class zD{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 C_=new zD,YS=new zD,XS=new zD,NR=new Array(230),D5=Object.create(null),x5=Object.create(null),UD=[];for(let s=0;s<=193;s++)UD[s]=-1;(function(){const s="",e=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",s,s],[0,1,1,"Hyper",0,s,0,s,s,s],[0,1,2,"Super",0,s,0,s,s,s],[0,1,3,"Fn",0,s,0,s,s,s],[0,1,4,"FnLock",0,s,0,s,s,s],[0,1,5,"Suspend",0,s,0,s,s,s],[0,1,6,"Resume",0,s,0,s,s,s],[0,1,7,"Turbo",0,s,0,s,s,s],[0,1,8,"Sleep",0,s,0,"VK_SLEEP",s,s],[0,1,9,"WakeUp",0,s,0,s,s,s],[31,0,10,"KeyA",31,"A",65,"VK_A",s,s],[32,0,11,"KeyB",32,"B",66,"VK_B",s,s],[33,0,12,"KeyC",33,"C",67,"VK_C",s,s],[34,0,13,"KeyD",34,"D",68,"VK_D",s,s],[35,0,14,"KeyE",35,"E",69,"VK_E",s,s],[36,0,15,"KeyF",36,"F",70,"VK_F",s,s],[37,0,16,"KeyG",37,"G",71,"VK_G",s,s],[38,0,17,"KeyH",38,"H",72,"VK_H",s,s],[39,0,18,"KeyI",39,"I",73,"VK_I",s,s],[40,0,19,"KeyJ",40,"J",74,"VK_J",s,s],[41,0,20,"KeyK",41,"K",75,"VK_K",s,s],[42,0,21,"KeyL",42,"L",76,"VK_L",s,s],[43,0,22,"KeyM",43,"M",77,"VK_M",s,s],[44,0,23,"KeyN",44,"N",78,"VK_N",s,s],[45,0,24,"KeyO",45,"O",79,"VK_O",s,s],[46,0,25,"KeyP",46,"P",80,"VK_P",s,s],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",s,s],[48,0,27,"KeyR",48,"R",82,"VK_R",s,s],[49,0,28,"KeyS",49,"S",83,"VK_S",s,s],[50,0,29,"KeyT",50,"T",84,"VK_T",s,s],[51,0,30,"KeyU",51,"U",85,"VK_U",s,s],[52,0,31,"KeyV",52,"V",86,"VK_V",s,s],[53,0,32,"KeyW",53,"W",87,"VK_W",s,s],[54,0,33,"KeyX",54,"X",88,"VK_X",s,s],[55,0,34,"KeyY",55,"Y",89,"VK_Y",s,s],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",s,s],[22,0,36,"Digit1",22,"1",49,"VK_1",s,s],[23,0,37,"Digit2",23,"2",50,"VK_2",s,s],[24,0,38,"Digit3",24,"3",51,"VK_3",s,s],[25,0,39,"Digit4",25,"4",52,"VK_4",s,s],[26,0,40,"Digit5",26,"5",53,"VK_5",s,s],[27,0,41,"Digit6",27,"6",54,"VK_6",s,s],[28,0,42,"Digit7",28,"7",55,"VK_7",s,s],[29,0,43,"Digit8",29,"8",56,"VK_8",s,s],[30,0,44,"Digit9",30,"9",57,"VK_9",s,s],[21,0,45,"Digit0",21,"0",48,"VK_0",s,s],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",s,s],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",s,s],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",s,s],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",s,s],[10,1,50,"Space",10,"Space",32,"VK_SPACE",s,s],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,s,0,s,s,s],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",s,s],[59,1,64,"F1",59,"F1",112,"VK_F1",s,s],[60,1,65,"F2",60,"F2",113,"VK_F2",s,s],[61,1,66,"F3",61,"F3",114,"VK_F3",s,s],[62,1,67,"F4",62,"F4",115,"VK_F4",s,s],[63,1,68,"F5",63,"F5",116,"VK_F5",s,s],[64,1,69,"F6",64,"F6",117,"VK_F6",s,s],[65,1,70,"F7",65,"F7",118,"VK_F7",s,s],[66,1,71,"F8",66,"F8",119,"VK_F8",s,s],[67,1,72,"F9",67,"F9",120,"VK_F9",s,s],[68,1,73,"F10",68,"F10",121,"VK_F10",s,s],[69,1,74,"F11",69,"F11",122,"VK_F11",s,s],[70,1,75,"F12",70,"F12",123,"VK_F12",s,s],[0,1,76,"PrintScreen",0,s,0,s,s,s],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",s,s],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",s,s],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",s,s],[14,1,80,"Home",14,"Home",36,"VK_HOME",s,s],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",s,s],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",s,s],[13,1,83,"End",13,"End",35,"VK_END",s,s],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",s,s],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",s],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",s],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",s],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",s],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",s,s],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",s,s],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",s,s],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",s,s],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",s,s],[3,1,94,"NumpadEnter",3,s,0,s,s,s],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",s,s],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",s,s],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",s,s],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",s,s],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",s,s],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",s,s],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",s,s],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",s,s],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",s,s],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",s,s],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",s,s],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",s,s],[58,1,107,"ContextMenu",58,"ContextMenu",93,s,s,s],[0,1,108,"Power",0,s,0,s,s,s],[0,1,109,"NumpadEqual",0,s,0,s,s,s],[71,1,110,"F13",71,"F13",124,"VK_F13",s,s],[72,1,111,"F14",72,"F14",125,"VK_F14",s,s],[73,1,112,"F15",73,"F15",126,"VK_F15",s,s],[74,1,113,"F16",74,"F16",127,"VK_F16",s,s],[75,1,114,"F17",75,"F17",128,"VK_F17",s,s],[76,1,115,"F18",76,"F18",129,"VK_F18",s,s],[77,1,116,"F19",77,"F19",130,"VK_F19",s,s],[0,1,117,"F20",0,s,0,"VK_F20",s,s],[0,1,118,"F21",0,s,0,"VK_F21",s,s],[0,1,119,"F22",0,s,0,"VK_F22",s,s],[0,1,120,"F23",0,s,0,"VK_F23",s,s],[0,1,121,"F24",0,s,0,"VK_F24",s,s],[0,1,122,"Open",0,s,0,s,s,s],[0,1,123,"Help",0,s,0,s,s,s],[0,1,124,"Select",0,s,0,s,s,s],[0,1,125,"Again",0,s,0,s,s,s],[0,1,126,"Undo",0,s,0,s,s,s],[0,1,127,"Cut",0,s,0,s,s,s],[0,1,128,"Copy",0,s,0,s,s,s],[0,1,129,"Paste",0,s,0,s,s,s],[0,1,130,"Find",0,s,0,s,s,s],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",s,s],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",s,s],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",s,s],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",s,s],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",s,s],[0,1,136,"KanaMode",0,s,0,s,s,s],[0,0,137,"IntlYen",0,s,0,s,s,s],[0,1,138,"Convert",0,s,0,s,s,s],[0,1,139,"NonConvert",0,s,0,s,s,s],[0,1,140,"Lang1",0,s,0,s,s,s],[0,1,141,"Lang2",0,s,0,s,s,s],[0,1,142,"Lang3",0,s,0,s,s,s],[0,1,143,"Lang4",0,s,0,s,s,s],[0,1,144,"Lang5",0,s,0,s,s,s],[0,1,145,"Abort",0,s,0,s,s,s],[0,1,146,"Props",0,s,0,s,s,s],[0,1,147,"NumpadParenLeft",0,s,0,s,s,s],[0,1,148,"NumpadParenRight",0,s,0,s,s,s],[0,1,149,"NumpadBackspace",0,s,0,s,s,s],[0,1,150,"NumpadMemoryStore",0,s,0,s,s,s],[0,1,151,"NumpadMemoryRecall",0,s,0,s,s,s],[0,1,152,"NumpadMemoryClear",0,s,0,s,s,s],[0,1,153,"NumpadMemoryAdd",0,s,0,s,s,s],[0,1,154,"NumpadMemorySubtract",0,s,0,s,s,s],[0,1,155,"NumpadClear",0,s,0,s,s,s],[0,1,156,"NumpadClearEntry",0,s,0,s,s,s],[5,1,0,s,5,"Ctrl",17,"VK_CONTROL",s,s],[4,1,0,s,4,"Shift",16,"VK_SHIFT",s,s],[6,1,0,s,6,"Alt",18,"VK_MENU",s,s],[57,1,0,s,57,"Meta",0,"VK_COMMAND",s,s],[5,1,157,"ControlLeft",5,s,0,"VK_LCONTROL",s,s],[4,1,158,"ShiftLeft",4,s,0,"VK_LSHIFT",s,s],[6,1,159,"AltLeft",6,s,0,"VK_LMENU",s,s],[57,1,160,"MetaLeft",57,s,0,"VK_LWIN",s,s],[5,1,161,"ControlRight",5,s,0,"VK_RCONTROL",s,s],[4,1,162,"ShiftRight",4,s,0,"VK_RSHIFT",s,s],[6,1,163,"AltRight",6,s,0,"VK_RMENU",s,s],[57,1,164,"MetaRight",57,s,0,"VK_RWIN",s,s],[0,1,165,"BrightnessUp",0,s,0,s,s,s],[0,1,166,"BrightnessDown",0,s,0,s,s,s],[0,1,167,"MediaPlay",0,s,0,s,s,s],[0,1,168,"MediaRecord",0,s,0,s,s,s],[0,1,169,"MediaFastForward",0,s,0,s,s,s],[0,1,170,"MediaRewind",0,s,0,s,s,s],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",s,s],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",s,s],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",s,s],[0,1,174,"Eject",0,s,0,s,s,s],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",s,s],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",s,s],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",s,s],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",s,s],[0,1,179,"LaunchApp1",0,s,0,"VK_MEDIA_LAUNCH_APP1",s,s],[0,1,180,"SelectTask",0,s,0,s,s,s],[0,1,181,"LaunchScreenSaver",0,s,0,s,s,s],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",s,s],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",s,s],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",s,s],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",s,s],[0,1,186,"BrowserStop",0,s,0,"VK_BROWSER_STOP",s,s],[0,1,187,"BrowserRefresh",0,s,0,"VK_BROWSER_REFRESH",s,s],[0,1,188,"BrowserFavorites",0,s,0,"VK_BROWSER_FAVORITES",s,s],[0,1,189,"ZoomToggle",0,s,0,s,s,s],[0,1,190,"MailReply",0,s,0,s,s,s],[0,1,191,"MailForward",0,s,0,s,s,s],[0,1,192,"MailSend",0,s,0,s,s,s],[109,1,0,s,109,"KeyInComposition",229,s,s,s],[111,1,0,s,111,"ABNT_C2",194,"VK_ABNT_C2",s,s],[91,1,0,s,91,"OEM_8",223,"VK_OEM_8",s,s],[0,1,0,s,0,s,0,"VK_CLEAR",s,s],[0,1,0,s,0,s,0,"VK_KANA",s,s],[0,1,0,s,0,s,0,"VK_HANGUL",s,s],[0,1,0,s,0,s,0,"VK_JUNJA",s,s],[0,1,0,s,0,s,0,"VK_FINAL",s,s],[0,1,0,s,0,s,0,"VK_HANJA",s,s],[0,1,0,s,0,s,0,"VK_KANJI",s,s],[0,1,0,s,0,s,0,"VK_CONVERT",s,s],[0,1,0,s,0,s,0,"VK_NONCONVERT",s,s],[0,1,0,s,0,s,0,"VK_ACCEPT",s,s],[0,1,0,s,0,s,0,"VK_MODECHANGE",s,s],[0,1,0,s,0,s,0,"VK_SELECT",s,s],[0,1,0,s,0,s,0,"VK_PRINT",s,s],[0,1,0,s,0,s,0,"VK_EXECUTE",s,s],[0,1,0,s,0,s,0,"VK_SNAPSHOT",s,s],[0,1,0,s,0,s,0,"VK_HELP",s,s],[0,1,0,s,0,s,0,"VK_APPS",s,s],[0,1,0,s,0,s,0,"VK_PROCESSKEY",s,s],[0,1,0,s,0,s,0,"VK_PACKET",s,s],[0,1,0,s,0,s,0,"VK_DBE_SBCSCHAR",s,s],[0,1,0,s,0,s,0,"VK_DBE_DBCSCHAR",s,s],[0,1,0,s,0,s,0,"VK_ATTN",s,s],[0,1,0,s,0,s,0,"VK_CRSEL",s,s],[0,1,0,s,0,s,0,"VK_EXSEL",s,s],[0,1,0,s,0,s,0,"VK_EREOF",s,s],[0,1,0,s,0,s,0,"VK_PLAY",s,s],[0,1,0,s,0,s,0,"VK_ZOOM",s,s],[0,1,0,s,0,s,0,"VK_NONAME",s,s],[0,1,0,s,0,s,0,"VK_PA1",s,s],[0,1,0,s,0,s,0,"VK_OEM_CLEAR",s,s]];let t=[],i=[];for(const n of e){const[o,r,a,l,d,h,c,u,f,g]=n;if(i[a]||(i[a]=!0,D5[l]=a,x5[l.toLowerCase()]=a,r&&(UD[a]=d)),!t[d]){if(t[d]=!0,!h)throw new Error(`String representation missing for key code ${d} around scan code ${l}`);C_.define(d,h),YS.define(d,f||h),XS.define(d,g||f||h)}c&&(NR[c]=d)}})();var hd;(function(s){function e(a){return C_.keyCodeToStr(a)}s.toString=e;function t(a){return C_.strToKeyCode(a)}s.fromString=t;function i(a){return YS.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return XS.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return YS.strToKeyCode(a)||XS.strToKeyCode(a)}s.fromUserSettings=o;function r(a){if(a>=93&&a<=108)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return C_.keyCodeToStr(a)}s.toElectronAccelerator=r})(hd||(hd={}));function mi(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var jI={};let Nc;if(typeof Et.vscode<"u"&&typeof Et.vscode.process<"u"){const s=Et.vscode.process;Nc={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()},nextTick(e){return KS(e)}}}else typeof process<"u"?Nc={get platform(){return process.platform},get arch(){return process.arch},get env(){return jI},cwd(){return jI.VSCODE_CWD||process.cwd()},nextTick(s){return process.nextTick(s)}}:Nc={get platform(){return Ai?"win32":Me?"darwin":"linux"},get arch(){},nextTick(s){return KS(s)},get env(){return{}},cwd(){return"/"}};const QS=Nc.cwd,k5=Nc.env,_h=Nc.platform,I5=65,E5=97,N5=90,T5=122,Ya=46,ji=47,Wn=92,La=58,A5=63;class TR 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 hi(s,e){if(typeof s!="string")throw new TR(e,"string",s)}function et(s){return s===ji||s===Wn}function JS(s){return s===ji}function Da(s){return s>=I5&&s<=N5||s>=E5&&s<=T5}function rb(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=ji}if(i(l)){if(!(r===d-1||a===1))if(a===2){if(n.length<2||o!==2||n.charCodeAt(n.length-1)!==Ya||n.charCodeAt(n.length-2)!==Ya){if(n.length>2){const h=n.lastIndexOf(t);h===-1?(n="",o=0):(n=n.slice(0,h),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===Ya&&a!==-1?++a:a=-1}return n}function AR(s,e){if(e===null||typeof e!="object")throw new TR("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 Nn={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],hi(o,"path"),o.length===0)continue}else e.length===0?o=QS():(o=k5[`=${e}`]||QS(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Wn)&&(o=`${e}\\`));const r=o.length;let a=0,l="",d=!1;const h=o.charCodeAt(0);if(r===1)et(h)&&(a=1,d=!0);else if(et(h))if(d=!0,et(o.charCodeAt(1))){let c=2,u=c;for(;c<r&&!et(o.charCodeAt(c));)c++;if(c<r&&c!==u){const f=o.slice(u,c);for(u=c;c<r&&et(o.charCodeAt(c));)c++;if(c<r&&c!==u){for(u=c;c<r&&!et(o.charCodeAt(c));)c++;(c===r||c!==u)&&(l=`\\\\${f}\\${o.slice(u,c)}`,a=c)}}}else a=1;else Da(h)&&o.charCodeAt(1)===La&&(l=o.slice(0,2),a=2,r>2&&et(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=rb(t,!i,"\\",et),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){hi(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 JS(o)?"\\":s;if(et(o))if(n=!0,et(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!et(s.charCodeAt(a));)a++;if(a<e&&a!==l){const d=s.slice(l,a);for(l=a;a<e&&et(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!et(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 Da(o)&&s.charCodeAt(1)===La&&(i=s.slice(0,2),t=2,e>2&&et(s.charCodeAt(2))&&(n=!0,t=3));let r=t<e?rb(s.slice(t),!n,"\\",et):"";return r.length===0&&!n&&(r="."),r.length>0&&et(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){hi(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return et(t)||e>2&&Da(t)&&s.charCodeAt(1)===La&&et(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];hi(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"&&et(t.charCodeAt(0))){++n;const o=t.length;o>1&&et(t.charCodeAt(1))&&(++n,o>2&&(et(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n<e.length&&et(e.charCodeAt(n));)n++;n>=2&&(e=`\\${e.slice(n)}`)}return Nn.normalize(e)},relative(s,e){if(hi(s,"from"),hi(e,"to"),s===e)return"";const t=Nn.resolve(s),i=Nn.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;n<s.length&&s.charCodeAt(n)===Wn;)n++;let o=s.length;for(;o-1>n&&s.charCodeAt(o-1)===Wn;)o--;const r=o-n;let a=0;for(;a<e.length&&e.charCodeAt(a)===Wn;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===Wn;)l--;const d=l-a,h=r<d?r:d;let c=-1,u=0;for(;u<h;u++){const g=s.charCodeAt(n+u);if(g!==e.charCodeAt(a+u))break;g===Wn&&(c=u)}if(u!==h){if(c===-1)return i}else{if(d>h){if(e.charCodeAt(a+u)===Wn)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>h&&(s.charCodeAt(n+u)===Wn?c=u:u===2&&(c=3)),c===-1&&(c=0)}let f="";for(u=n+c+1;u<=o;++u)(u===o||s.charCodeAt(u)===Wn)&&(f+=f.length===0?"..":"\\..");return a+=c,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===Wn&&++a,i.slice(a,l))},toNamespacedPath(s){if(typeof s!="string")return s;if(s.length===0)return"";const e=Nn.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===Wn){if(e.charCodeAt(1)===Wn){const t=e.charCodeAt(2);if(t!==A5&&t!==Ya)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Da(e.charCodeAt(0))&&e.charCodeAt(1)===La&&e.charCodeAt(2)===Wn)return`\\\\?\\${e}`;return s},dirname(s){hi(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return et(n)?s:".";if(et(n)){if(t=i=1,et(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!et(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&et(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!et(s.charCodeAt(a));)a++;if(a===e)return s;a!==l&&(t=i=a+1)}}}}else Da(n)&&s.charCodeAt(1)===La&&(t=e>2&&et(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(et(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&&hi(e,"ext"),hi(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&Da(s.charCodeAt(0))&&s.charCodeAt(1)===La&&(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(et(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(et(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){hi(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===La&&Da(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const l=s.charCodeAt(a);if(et(l)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),l===Ya?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:AR.bind(null,"\\"),parse(s){hi(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 et(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(et(n)){if(i=1,et(s.charCodeAt(1))){let c=2,u=c;for(;c<t&&!et(s.charCodeAt(c));)c++;if(c<t&&c!==u){for(u=c;c<t&&et(s.charCodeAt(c));)c++;if(c<t&&c!==u){for(u=c;c<t&&!et(s.charCodeAt(c));)c++;c===t?i=c:c!==u&&(i=c+1)}}}}else if(Da(n)&&s.charCodeAt(1)===La){if(t<=2)return e.root=e.dir=s,e;if(i=2,et(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,h=0;for(;d>=i;--d){if(n=s.charCodeAt(d),et(n)){if(!l){r=d+1;break}continue}a===-1&&(l=!1,a=d+1),n===Ya?o===-1?o=d:h!==1&&(h=1):o!==-1&&(h=-1)}return a!==-1&&(o===-1||h===0||h===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},oi={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:QS();hi(n,"path"),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===ji)}return e=rb(e,!t,"/",JS),t?`/${e}`:e.length>0?e:"."},normalize(s){if(hi(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===ji,t=s.charCodeAt(s.length-1)===ji;return s=rb(s,!e,"/",JS),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return hi(s,"path"),s.length>0&&s.charCodeAt(0)===ji},join(...s){if(s.length===0)return".";let e;for(let t=0;t<s.length;++t){const i=s[t];hi(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":oi.normalize(e)},relative(s,e){if(hi(s,"from"),hi(e,"to"),s===e||(s=oi.resolve(s),e=oi.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 c=s.charCodeAt(t+d);if(c!==e.charCodeAt(o+d))break;c===ji&&(l=d)}if(d===a)if(r>a){if(e.charCodeAt(o+d)===ji)return e.slice(o+d+1);if(d===0)return e.slice(o+d)}else n>a&&(s.charCodeAt(t+d)===ji?l=d:d===0&&(l=0));let h="";for(d=t+l+1;d<=i;++d)(d===i||s.charCodeAt(d)===ji)&&(h+=h.length===0?"..":"/..");return`${h}${e.slice(o+l)}`},toNamespacedPath(s){return s},dirname(s){if(hi(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===ji;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===ji){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&&hi(e,"ext"),hi(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===ji){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)===ji){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){hi(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===ji){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===Ya?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:AR.bind(null,"/"),parse(s){hi(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===ji;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 h=s.charCodeAt(l);if(h===ji){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),h===Ya?n===-1?n=l:d!==1&&(d=1):n!==-1&&(d=-1)}if(r!==-1){const h=o===0&&t?1:o;n===-1||d===0||d===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(h,r):(e.name=s.slice(h,n),e.base=s.slice(h,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};oi.win32=Nn.win32=Nn;oi.posix=Nn.posix=oi;const $D=_h==="win32"?Nn.normalize:oi.normalize,R5=_h==="win32"?Nn.resolve:oi.resolve,M5=_h==="win32"?Nn.relative:oi.relative,RR=_h==="win32"?Nn.dirname:oi.dirname,bd=_h==="win32"?Nn.basename:oi.basename,O5=_h==="win32"?Nn.extname:oi.extname,Cd=_h==="win32"?Nn.sep:oi.sep,P5=/^\w[\w\d+.-]*$/,F5=/^\//,B5=/^\/\//;function KI(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&&!P5.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!F5.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(B5.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 W5(s,e){return!s&&!e?"file":s}function V5(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==so&&(e=so+e):e=so;break}return e}const Ht="",so="/",H5=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class me{constructor(e,t,i,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||Ht,this.authority=e.authority||Ht,this.path=e.path||Ht,this.query=e.query||Ht,this.fragment=e.fragment||Ht):(this.scheme=W5(e,r),this.authority=t||Ht,this.path=V5(this.scheme,i||Ht),this.query=n||Ht,this.fragment=o||Ht,KI(this,r))}static isUri(e){return e instanceof me?!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 ab(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=Ht),i===void 0?i=this.authority:i===null&&(i=Ht),n===void 0?n=this.path:n===null&&(n=Ht),o===void 0?o=this.query:o===null&&(o=Ht),r===void 0?r=this.fragment:r===null&&(r=Ht),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new Uh(t,i,n,o,r)}static parse(e,t=!1){const i=H5.exec(e);return i?new Uh(i[2]||Ht,pm(i[4]||Ht),pm(i[5]||Ht),pm(i[7]||Ht),pm(i[9]||Ht),t):new Uh(Ht,Ht,Ht,Ht,Ht)}static file(e){let t=Ht;if(Ai&&(e=e.replace(/\\/g,so)),e[0]===so&&e[1]===so){const i=e.indexOf(so,2);i===-1?(t=e.substring(2),e=so):(t=e.substring(2,i),e=e.substring(i)||so)}return new Uh("file",t,e,Ht,Ht)}static from(e){const t=new Uh(e.scheme,e.authority,e.path,e.query,e.fragment);return KI(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Ai&&e.scheme==="file"?i=me.file(Nn.join(ab(e,!0),...t)).path:i=oi.join(e.path,...t),e.with({path:i})}toString(e=!1){return e1(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof me)return e;{const t=new Uh(e);return t._formatted=e.external,t._fsPath=e._sep===MR?e.fsPath:null,t}}else return e}}const MR=Ai?1:void 0;let Uh=class extends me{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ab(this,!1)),this._fsPath}toString(e=!1){return e?e1(this,!0):(this._formatted||(this._formatted=e1(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=MR),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 OR={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 qI(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=OR[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 z5(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+=OR[i]):e!==void 0&&(e+=s[t])}return e!==void 0?e:s}function ab(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,Ai&&(t=t.replace(/\//g,"\\")),t}function e1(s,e){const t=e?z5:qI;let i="",{scheme:n,authority:o,path:r,query:a,fragment:l}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=so,i+=so),o){let d=o.indexOf("@");if(d!==-1){const h=o.substr(0,d);o=o.substr(d+1),d=h.indexOf(":"),d===-1?i+=t(h,!1):(i+=t(h.substr(0,d),!1),i+=":",i+=t(h.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:qI(l,!1)),i}function PR(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+PR(s.substr(3)):s}}const GI=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pm(s){return s.match(GI)?s.replace(GI,e=>PR(e)):s}let F=class Zl{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 Zl(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Zl.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Zl.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 Zl.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 Zl(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new Zl(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}},S=class $i{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 $i.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return $i.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 $i.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 $i.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 $i.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 $i(i,n,o,r)}intersectRanges(e){return $i.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,h=t.endColumn;return i<a?(i=a,n=l):i===a&&(n=Math.max(n,l)),o>d?(o=d,r=h):o===d&&(r=Math.min(r,h)),i>o||i===o&&n>r?null:new $i(i,n,o,r)}equalsRange(e){return $i.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 $i.getEndPosition(this)}static getEndPosition(e){return new F(e.endLineNumber,e.endColumn)}getStartPosition(){return $i.getStartPosition(this)}static getStartPosition(e){return new F(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new $i(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new $i(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return $i.collapseToStart(this)}static collapseToStart(e){return new $i(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new $i(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new $i(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,h=t.endLineNumber|0;if(d===h){const c=e.endColumn|0,u=t.endColumn|0;return c-u}return d-h}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}},ne=class Bo extends S{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 Bo.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 Bo(this.startLineNumber,this.startColumn,e,t):new Bo(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new F(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return this.getDirection()===0?new Bo(e,t,this.endLineNumber,this.endColumn):new Bo(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Bo(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new Bo(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 Bo(e,t,i,n):new Bo(i,n,e,t)}},$C=class{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 jD{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class jC{constructor(e,t){this._tokenizationResult2Brand=void 0,this.tokens=e,this.endState=t}}var t1;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(t1||(t1={}));var i1;(function(s){s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(i1||(i1={}));var n1;(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"})(n1||(n1={}));var s1;(function(s){s[s.Deprecated=1]="Deprecated"})(s1||(s1={}));var o1;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(o1||(o1={}));var r1;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(r1||(r1={}));var a1;(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"})(a1||(a1={}));var l1;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(l1||(l1={}));var d1;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(d1||(d1={}));var h1;(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"})(h1||(h1={}));var c1;(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.bracketPairColorization=12]="bracketPairColorization",s[s.guides=13]="guides",s[s.codeLens=14]="codeLens",s[s.codeLensFontFamily=15]="codeLensFontFamily",s[s.codeLensFontSize=16]="codeLensFontSize",s[s.colorDecorators=17]="colorDecorators",s[s.columnSelection=18]="columnSelection",s[s.comments=19]="comments",s[s.contextmenu=20]="contextmenu",s[s.copyWithSyntaxHighlighting=21]="copyWithSyntaxHighlighting",s[s.cursorBlinking=22]="cursorBlinking",s[s.cursorSmoothCaretAnimation=23]="cursorSmoothCaretAnimation",s[s.cursorStyle=24]="cursorStyle",s[s.cursorSurroundingLines=25]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=26]="cursorSurroundingLinesStyle",s[s.cursorWidth=27]="cursorWidth",s[s.disableLayerHinting=28]="disableLayerHinting",s[s.disableMonospaceOptimizations=29]="disableMonospaceOptimizations",s[s.domReadOnly=30]="domReadOnly",s[s.dragAndDrop=31]="dragAndDrop",s[s.emptySelectionClipboard=32]="emptySelectionClipboard",s[s.extraEditorClassName=33]="extraEditorClassName",s[s.fastScrollSensitivity=34]="fastScrollSensitivity",s[s.find=35]="find",s[s.fixedOverflowWidgets=36]="fixedOverflowWidgets",s[s.folding=37]="folding",s[s.foldingStrategy=38]="foldingStrategy",s[s.foldingHighlight=39]="foldingHighlight",s[s.foldingImportsByDefault=40]="foldingImportsByDefault",s[s.unfoldOnClickAfterEndOfLine=41]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=42]="fontFamily",s[s.fontInfo=43]="fontInfo",s[s.fontLigatures=44]="fontLigatures",s[s.fontSize=45]="fontSize",s[s.fontWeight=46]="fontWeight",s[s.formatOnPaste=47]="formatOnPaste",s[s.formatOnType=48]="formatOnType",s[s.glyphMargin=49]="glyphMargin",s[s.gotoLocation=50]="gotoLocation",s[s.hideCursorInOverviewRuler=51]="hideCursorInOverviewRuler",s[s.hover=52]="hover",s[s.inDiffEditor=53]="inDiffEditor",s[s.inlineSuggest=54]="inlineSuggest",s[s.letterSpacing=55]="letterSpacing",s[s.lightbulb=56]="lightbulb",s[s.lineDecorationsWidth=57]="lineDecorationsWidth",s[s.lineHeight=58]="lineHeight",s[s.lineNumbers=59]="lineNumbers",s[s.lineNumbersMinChars=60]="lineNumbersMinChars",s[s.linkedEditing=61]="linkedEditing",s[s.links=62]="links",s[s.matchBrackets=63]="matchBrackets",s[s.minimap=64]="minimap",s[s.mouseStyle=65]="mouseStyle",s[s.mouseWheelScrollSensitivity=66]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=67]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=68]="multiCursorMergeOverlapping",s[s.multiCursorModifier=69]="multiCursorModifier",s[s.multiCursorPaste=70]="multiCursorPaste",s[s.occurrencesHighlight=71]="occurrencesHighlight",s[s.overviewRulerBorder=72]="overviewRulerBorder",s[s.overviewRulerLanes=73]="overviewRulerLanes",s[s.padding=74]="padding",s[s.parameterHints=75]="parameterHints",s[s.peekWidgetDefaultFocus=76]="peekWidgetDefaultFocus",s[s.definitionLinkOpensInPeek=77]="definitionLinkOpensInPeek",s[s.quickSuggestions=78]="quickSuggestions",s[s.quickSuggestionsDelay=79]="quickSuggestionsDelay",s[s.readOnly=80]="readOnly",s[s.renameOnType=81]="renameOnType",s[s.renderControlCharacters=82]="renderControlCharacters",s[s.renderFinalNewline=83]="renderFinalNewline",s[s.renderLineHighlight=84]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=85]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=86]="renderValidationDecorations",s[s.renderWhitespace=87]="renderWhitespace",s[s.revealHorizontalRightPadding=88]="revealHorizontalRightPadding",s[s.roundedSelection=89]="roundedSelection",s[s.rulers=90]="rulers",s[s.scrollbar=91]="scrollbar",s[s.scrollBeyondLastColumn=92]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=93]="scrollBeyondLastLine",s[s.scrollPredominantAxis=94]="scrollPredominantAxis",s[s.selectionClipboard=95]="selectionClipboard",s[s.selectionHighlight=96]="selectionHighlight",s[s.selectOnLineNumbers=97]="selectOnLineNumbers",s[s.showFoldingControls=98]="showFoldingControls",s[s.showUnused=99]="showUnused",s[s.snippetSuggestions=100]="snippetSuggestions",s[s.smartSelect=101]="smartSelect",s[s.smoothScrolling=102]="smoothScrolling",s[s.stickyTabStops=103]="stickyTabStops",s[s.stopRenderingLineAfter=104]="stopRenderingLineAfter",s[s.suggest=105]="suggest",s[s.suggestFontSize=106]="suggestFontSize",s[s.suggestLineHeight=107]="suggestLineHeight",s[s.suggestOnTriggerCharacters=108]="suggestOnTriggerCharacters",s[s.suggestSelection=109]="suggestSelection",s[s.tabCompletion=110]="tabCompletion",s[s.tabIndex=111]="tabIndex",s[s.unusualLineTerminators=112]="unusualLineTerminators",s[s.useShadowDOM=113]="useShadowDOM",s[s.useTabStops=114]="useTabStops",s[s.wordSeparators=115]="wordSeparators",s[s.wordWrap=116]="wordWrap",s[s.wordWrapBreakAfterCharacters=117]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=118]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=119]="wordWrapColumn",s[s.wordWrapOverride1=120]="wordWrapOverride1",s[s.wordWrapOverride2=121]="wordWrapOverride2",s[s.wrappingIndent=122]="wrappingIndent",s[s.wrappingStrategy=123]="wrappingStrategy",s[s.showDeprecated=124]="showDeprecated",s[s.inlayHints=125]="inlayHints",s[s.editorClassName=126]="editorClassName",s[s.pixelRatio=127]="pixelRatio",s[s.tabFocusMode=128]="tabFocusMode",s[s.layoutInfo=129]="layoutInfo",s[s.wrappingInfo=130]="wrappingInfo"})(c1||(c1={}));var u1;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(u1||(u1={}));var f1;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(f1||(f1={}));var g1;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(g1||(g1={}));var p1;(function(s){s[s.Other=0]="Other",s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(p1||(p1={}));var m1;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(m1||(m1={}));var _1;(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.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",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.Semicolon=80]="Semicolon",s[s.Equal=81]="Equal",s[s.Comma=82]="Comma",s[s.Minus=83]="Minus",s[s.Period=84]="Period",s[s.Slash=85]="Slash",s[s.Backquote=86]="Backquote",s[s.BracketLeft=87]="BracketLeft",s[s.Backslash=88]="Backslash",s[s.BracketRight=89]="BracketRight",s[s.Quote=90]="Quote",s[s.OEM_8=91]="OEM_8",s[s.IntlBackslash=92]="IntlBackslash",s[s.Numpad0=93]="Numpad0",s[s.Numpad1=94]="Numpad1",s[s.Numpad2=95]="Numpad2",s[s.Numpad3=96]="Numpad3",s[s.Numpad4=97]="Numpad4",s[s.Numpad5=98]="Numpad5",s[s.Numpad6=99]="Numpad6",s[s.Numpad7=100]="Numpad7",s[s.Numpad8=101]="Numpad8",s[s.Numpad9=102]="Numpad9",s[s.NumpadMultiply=103]="NumpadMultiply",s[s.NumpadAdd=104]="NumpadAdd",s[s.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=106]="NumpadSubtract",s[s.NumpadDecimal=107]="NumpadDecimal",s[s.NumpadDivide=108]="NumpadDivide",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.AudioVolumeMute=112]="AudioVolumeMute",s[s.AudioVolumeUp=113]="AudioVolumeUp",s[s.AudioVolumeDown=114]="AudioVolumeDown",s[s.BrowserSearch=115]="BrowserSearch",s[s.BrowserHome=116]="BrowserHome",s[s.BrowserBack=117]="BrowserBack",s[s.BrowserForward=118]="BrowserForward",s[s.MediaTrackNext=119]="MediaTrackNext",s[s.MediaTrackPrevious=120]="MediaTrackPrevious",s[s.MediaStop=121]="MediaStop",s[s.MediaPlayPause=122]="MediaPlayPause",s[s.LaunchMediaPlayer=123]="LaunchMediaPlayer",s[s.LaunchMail=124]="LaunchMail",s[s.LaunchApp2=125]="LaunchApp2",s[s.MAX_VALUE=126]="MAX_VALUE"})(_1||(_1={}));var b1;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(b1||(b1={}));var C1;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(C1||(C1={}));var v1;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(v1||(v1={}));var w1;(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"})(w1||(w1={}));var S1;(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"})(S1||(S1={}));var y1;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(y1||(y1={}));var L1;(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"})(L1||(L1={}));var D1;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(D1||(D1={}));var x1;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(x1||(x1={}));var k1;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(k1||(k1={}));var I1;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(I1||(I1={}));var E1;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(E1||(E1={}));var N1;(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"})(N1||(N1={}));var T1;(function(s){s[s.Deprecated=1]="Deprecated"})(T1||(T1={}));var A1;(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"})(A1||(A1={}));var R1;(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"})(R1||(R1={}));var M1;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(M1||(M1={}));var O1;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(O1||(O1={}));let Np=class{static chord(e,t){return mi(e,t)}};Np.CtrlCmd=2048;Np.Shift=1024;Np.Alt=512;Np.WinCtrl=256;function FR(){return{editor:void 0,languages:void 0,CancellationTokenSource:ln,Emitter:M,KeyCode:_1,KeyMod:Np,Position:F,Range:S,Selection:ne,SelectionDirection:I1,MarkerSeverity:b1,MarkerTag:C1,Uri:me,Token:$C}}var lo;(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})(lo||(lo={}));const Ge=Je("instantiationService");function BR(s,e,t,i){e[lo.DI_TARGET]===e?e[lo.DI_DEPENDENCIES].push({id:s,index:t,optional:i}):(e[lo.DI_DEPENDENCIES]=[{id:s,index:t,optional:i}],e[lo.DI_TARGET]=e)}function Je(s){if(lo.serviceIds.has(s))return lo.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");BR(e,t,n,!1)};return e.toString=()=>s,lo.serviceIds.set(s,e),e}function U5(s){return function(e,t,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");BR(s,e,i,!0)}}const tt=Je("codeEditorService");class Pd{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}}Pd.INSTANCE=new Pd;function P1(){return Pd.INSTANCE.getZoomLevel()}function $5(){return Pd.INSTANCE.getTimeSinceLastZoomLevelChanged()}function WR(s){return Pd.INSTANCE.onDidChangeZoomLevel(s)}function j5(){return Pd.INSTANCE.getZoomFactor()}function lb(){return Pd.INSTANCE.getPixelRatio()}const Tp=navigator.userAgent,rn=Tp.indexOf("Firefox")>=0,vd=Tp.indexOf("AppleWebKit")>=0,db=Tp.indexOf("Chrome")>=0,Ws=!db&&Tp.indexOf("Safari")>=0,K5=!db&&!Ws&&vd,yf=Tp.indexOf("Android")>=0,VR=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,KC={clipboard:{writeText:uo||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:uo||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:uo||VR?0:navigator.keyboard||Ws?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function F1(s,e){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new hb([Bw(t,e),Bw(i,e)]):new hb([Bw(t,e)])}function Bw(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 Fd(n,o,r,a,l)}class Fd{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 hb([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class hb{constructor(e){if(e.length===0)throw fo("parts");this.parts=e}}class q5{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 G5{}function Z5(s){if(s.charCode){let t=String.fromCharCode(s.charCode).toUpperCase();return hd.fromString(t)}const e=s.keyCode;if(e===3)return 7;if(rn){if(e===59)return 80;if(e===107)return 81;if(e===109)return 83;if(Me&&e===224)return 57}else if(vd){if(e===91)return 57;if(Me&&e===93)return 57;if(!Me&&e===92)return 57}return NR[e]||0}const Y5=Me?256:2048,X5=512,Q5=1024,J5=Me?2048:256;class Ot{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=Z5(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|=Y5),this.altKey&&(t|=X5),this.shiftKey&&(t|=Q5),this.metaKey&&(t|=J5),t|=e,t}_computeRuntimeKeybinding(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Fd(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let B1=!1,$h=null;function e3(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.origin!==t.origin)return B1=!0,null}catch{return B1=!0,null}return s.parent}class W1{static getSameOriginWindowChain(){if(!$h){$h=[];let e=window,t;do t=e3(e),t?$h.push({window:e,iframeElement:e.frameElement||null}):$h.push({window:e,iframeElement:null}),e=t;while(e)}return $h.slice(0)}static hasDifferentOriginAncestor(){return $h||this.getSameOriginWindowChain(),B1}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 cs{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=W1.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class qc{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?rn&&!Me?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof n.wheelDeltaX<"u")Ws&&Ai?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?rn&&!Me?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 ZI=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function t3(s){return!!s&&typeof s.then=="function"}function gi(s){const e=new ln,t=s(e.token),i=new Promise((n,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(Au())});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),n(a)},a=>{r.dispose(),e.dispose(),o(a)})});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 KD(s,e,t){return Promise.race([s,new Promise(i=>e.onCancellationRequested(()=>i(t)))])}class i3{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 ca{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(Au()),this.completionPromise=null)}cancelTimeout(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancel()}}class n3{constructor(e){this.delayer=new ca(e),this.throttler=new i3}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}dispose(){this.delayer.dispose()}}function rl(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{o.dispose(),t()},s),o=e.onCancellationRequested(()=>{clearTimeout(n),o.dispose(),i(Au())})}):gi(t=>rl(s,t))}function Bd(s,e=0){const t=setTimeout(s,e);return Ve(()=>clearTimeout(t))}function HR(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 hn{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 Ap{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 Lt{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 cb;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?cb=s=>{const e=setTimeout(()=>{const i=Date.now()+15;s(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0,clearTimeout(e))}}}:cb=(s,e)=>{const t=requestIdleCallback(s,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class Tc{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=cb(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}var V1;(function(s){function e(i){return ZI(this,void 0,void 0,function*(){let n;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return o})}s.settled=e;function t(i){return new Promise((n,o)=>ZI(this,void 0,void 0,function*(){try{yield i(n,o)}catch(r){o(r)}}))}s.withAsyncBody=t})(V1||(V1={}));var Te;(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"})(Te||(Te={}));class s3{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)}`),me.from({scheme:Nu?this._preferredWebSchema:Te.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:r})}}const zR=new s3;class mg{asBrowserUri(e,t){const i=this.toUri(e,t);return i.scheme===Te.vscodeRemote?zR.rewrite(i):i.scheme===Te.file&&(uo||typeof Et.importScripts=="function"&&Et.origin===`${Te.vscodeFileResource}://${mg.FALLBACK_AUTHORITY}`)?i.with({scheme:Te.vscodeFileResource,authority:i.authority||mg.FALLBACK_AUTHORITY,query:null,fragment:null}):i}toUri(e,t){return me.isUri(e)?e:me.parse(t.toUrl(e))}}mg.FALLBACK_AUTHORITY="vscode-app";const UR=new mg;function Li(s){for(;s.firstChild;)s.firstChild.remove()}function qD(s){var e;return(e=s==null?void 0:s.isConnected)!==null&&e!==void 0?e:!1}class o3{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 q(s,e,t,i){return new o3(s,e,t,i)}function $R(s){return function(e){return s(new cs(e))}}function r3(s){return function(e){return s(new Ot(e))}}let ii=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"?o=$R(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=r3(i)),q(e,t,o,n)},a3=function(e,t,i){let n=$R(t);return GD(e,n,i)};function GD(s,e,t){return q(s,lr&&KC.pointerEvents?ue.POINTER_DOWN:ue.MOUSE_DOWN,e,t)}function jR(s,e,t){return q(s,lr&&KC.pointerEvents?ue.POINTER_UP:ue.MOUSE_UP,e,t)}function ZD(s,e){return q(s,"mouseout",t=>{let i=t.relatedTarget;for(;i&&i!==s;)i=i.parentNode;i!==s&&e(t)})}function l3(s,e){return q(s,"pointerout",t=>{let i=t.relatedTarget;for(;i&&i!==s;)i=i.parentNode;i!==s&&e(t)})}let Ww=null;function d3(s){if(!Ww){const e=t=>setTimeout(()=>t(new Date().getTime()),0);Ww=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return Ww.call(self,s)}let KR,hr;class Vw{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){Le(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(Vw.sort),e.shift().execute();i=!1};hr=(o,r=0)=>{let a=new Vw(o,r);return s.push(a),t||(t=!0,d3(n)),a},KR=(o,r)=>{if(i){let a=new Vw(o,r);return e.push(a),a}else return hr(o,r)}})();const h3=8,c3=function(s,e){return e};class u3 extends H{constructor(e,t,i,n=c3,o=h3){super();let r=null,a=0,l=this._register(new hn),d=()=>{a=new Date().getTime(),i(r),r=null};this._register(q(e,t,h=>{r=n(r,h);let c=new Date().getTime()-a;c>=o?(l.cancel(),d()):l.setIfNotSet(d,o-c)}))}}function YD(s,e,t,i,n){return new u3(s,e,t,i,n)}function XD(s){return document.defaultView.getComputedStyle(s,null)}function qC(s){if(s!==document.body)return new _t(s.clientWidth,s.clientHeight);if(lr&&window.visualViewport)return new _t(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new _t(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new _t(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new _t(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Bt{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=XD(e),o="0";return n&&(n.getPropertyValue?o=n.getPropertyValue(t):o=n.getAttribute(i)),Bt.convertToPixels(e,o)}static getBorderLeftWidth(e){return Bt.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Bt.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Bt.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Bt.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Bt.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Bt.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Bt.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Bt.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Bt.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Bt.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Bt.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Bt.getDimension(e,"margin-bottom","marginBottom")}}class _t{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new _t(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof _t?e:new _t(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function qR(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=ZR(s)?null:XD(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=Bt.getBorderLeftWidth(s),t+=Bt.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function f3(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function Ii(s){let e=s.getBoundingClientRect();return{left:e.left+na.scrollX,top:e.top+na.scrollY,width:e.width,height:e.height}}const na=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 Es(s){let e=Bt.getMarginLeft(s)+Bt.getMarginRight(s);return s.offsetWidth+e}function Hw(s){let e=Bt.getBorderLeftWidth(s)+Bt.getBorderRightWidth(s),t=Bt.getPaddingLeft(s)+Bt.getPaddingRight(s);return s.offsetWidth-e-t}function g3(s){let e=Bt.getBorderTopWidth(s)+Bt.getBorderBottomWidth(s),t=Bt.getPaddingTop(s)+Bt.getPaddingBottom(s);return s.offsetHeight-e-t}function H1(s){let e=Bt.getMarginTop(s)+Bt.getMarginBottom(s);return s.offsetHeight+e}function nr(s,e){for(;s;){if(s===e)return!0;s=s.parentNode}return!1}function GR(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 YI(s,e,t){return!!GR(s,e,t)}function ZR(s){return s&&!!s.host&&!!s.mode}function GC(s){return!!bh(s)}function bh(s){for(;s.parentNode;){if(s===document.body)return null;s=s.parentNode}return ZR(s)?s:null}function Ac(){let s=document.activeElement;for(;s!=null&&s.shadowRoot;)s=s.shadowRoot.activeElement;return s}function Yn(s=document.getElementsByTagName("head")[0]){let e=document.createElement("style");return e.type="text/css",e.media="screen",s.appendChild(e),e}let zw=null;function YR(){return zw||(zw=Yn()),zw}function p3(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 z1(s,e,t=YR()){!t||!e||t.sheet.insertRule(s+"{"+e+"}",0)}function ub(s,e=YR()){if(!e)return;let t=p3(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 XR(s){return typeof HTMLElement=="object"?s instanceof HTMLElement:s&&typeof s=="object"&&s.nodeType===1&&typeof s.nodeName=="string"}const ue={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:vd?"webkitAnimationStart":"animationstart",ANIMATION_END:vd?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:vd?"webkitAnimationIteration":"animationiteration"},rt={stop:function(s,e){s.preventDefault?s.preventDefault():s.returnValue=!1,e&&(s.stopPropagation?s.stopPropagation():s.cancelBubble=!0)}};function m3(s){let e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function _3(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 b3 extends H{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=nr(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=()=>{nr(document.activeElement,e)!==t&&(t?o():n())},this._register(q(e,ue.FOCUS,n,!0)),this._register(q(e,ue.BLUR,o,!0))}}function Gc(s){return new b3(s)}function U(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function C3(s,e){return s.insertBefore(e,s.firstChild),e}function al(s,...e){s.innerText="",U(s,...e)}const v3=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var _g;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(_g||(_g={}));function QR(s,e,t,...i){let n=v3.exec(e);if(!n)throw new Error("Bad use of emmet");t=Object.assign({},t||{});let o=n[1]||"div",r;return s!==_g.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 QR(_g.HTML,s,e,...t)}Y.SVG=function(s,e,...t){return QR(_g.SVG,s,e,...t)};function zn(...s){for(let e of s)e.style.display="",e.removeAttribute("aria-hidden")}function _n(...s){for(let e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function w3(s){return Array.prototype.slice.call(document.getElementsByTagName(s),0)}function XI(s){const e=window.devicePixelRatio*s;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function JR(s){window.open(s,"_blank","noopener")}function S3(s){const e=()=>{s(),t=hr(e)};let t=hr(e);return Ve(()=>t.dispose())}zR.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function ua(s){return s?`url('${UR.asBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function QI(s){return`'${s.replace(/'/g,"%27")}'`}class cd extends M{constructor(){super(),this._subscriptions=new X,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(q(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Ot(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(q(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(q(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(q(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(q(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(q(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 cd.instance||(cd.instance=new cd),cd.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function y3(s,e){const t=window.matchMedia(s);typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)}function eM(s){return!s||typeof s!="string"?!0:s.trim().length===0}const L3=/{(\d+)}/g;function Vi(s,...e){return e.length===0?s:s.replace(L3,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function QD(s){return s.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function Ks(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function D3(s,e=" "){const t=JD(s,e);return tM(t,e)}function JD(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 tM(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 x3(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function k3(s){return s.replace(/\*/g,"")}function iM(s,e,t={}){if(!s)throw new Error("Cannot create regex from empty string");e||(s=Ks(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 I3(s){return s.source==="^"||s.source==="^$"||s.source==="$"||s.source==="^\\s*$"?!1:!!(s.exec("")&&s.lastIndex===0)}function Uw(s){return(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")}function cr(s){return s.split(/\r\n|\r|\n/)}function an(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 ht(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 sr(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 bg(s,e){return s<e?-1:s>e?1:0}function ex(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 U1(s,e){return Rp(s,e,0,s.length,0,e.length)}function Rp(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;if(l>=128||d>=128)return ex(s.toLowerCase(),e.toLowerCase(),t,i,n,o);Ha(l)&&(l-=32),Ha(d)&&(d-=32);const h=l-d;if(h!==0)return h}const r=i-t,a=o-n;return r<a?-1:r>a?1:0}function Ha(s){return s>=97&&s<=122}function jo(s){return s>=65&&s<=90}function Lf(s,e){return s.length===e.length&&Rp(s,e)===0}function nM(s,e){const t=e.length;return e.length>s.length?!1:Rp(s,e,0,t)===0}function Zc(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 fb(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 Si(s){return 55296<=s&&s<=56319}function Yc(s){return 56320<=s&&s<=57343}function tx(s,e){return(s-55296<<10)+(e-56320)+65536}function zr(s,e,t){const i=s.charCodeAt(t);if(Si(i)&&t+1<e){const n=s.charCodeAt(t+1);if(Yc(n))return tx(i,n)}return i}function Rc(s,e){const t=s.charCodeAt(e-1);if(Yc(t)&&e>1){const i=s.charCodeAt(e-2);if(Si(i))return tx(i,t)}return t}function gb(s,e){const t=Jr.getInstance(),i=e,n=s.length,o=zr(s,n,e);e+=o>=65536?2:1;let r=t.getGraphemeBreakType(o);for(;e<n;){const a=zr(s,n,e),l=t.getGraphemeBreakType(a);if(Ff(r,l))break;e+=a>=65536?2:1,r=l}return e-i}function E3(s,e){const t=Jr.getInstance(),i=e,n=Rc(s,e);e-=n>=65536?2:1;let o=t.getGraphemeBreakType(n);for(;e>0;){const r=Rc(s,e),a=t.getGraphemeBreakType(r);if(Ff(a,o))break;e-=r>=65536?2:1,o=a}return i-e}const N3=/(?:[\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 ZC(s){return N3.test(s)}const T3=/(?:[\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 A3(s){return T3.test(s)}const R3=/^[\t\n\r\x20-\x7E]*$/;function ix(s){return R3.test(s)}const sM=/[\u2028\u2029]/;function oM(s){return sM.test(s)}function M3(s){for(let e=0,t=s.length;e<t;e++)if(go(s.charCodeAt(e)))return!0;return!1}function go(s){return s=+s,s>=11904&&s<=55215||s>=63744&&s<=64255||s>=65281&&s<=65374}function Pf(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 O3="\uFEFF";function nx(s){return!!(s&&s.length>0&&s.charCodeAt(0)===65279)}function P3(s,e=!1){return s?(e&&(s=s.replace(/\\./g,"")),s.toLowerCase()!==s):!1}function rM(s){return s=s%(2*26),s<26?String.fromCharCode(97+s):String.fromCharCode(65+s-26)}function jh(s){return Jr.getInstance().getGraphemeBreakType(s)}function Ff(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 Jr{constructor(){this._data=F3()}static getInstance(){return Jr._INSTANCE||(Jr._INSTANCE=new Jr),Jr._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}}Jr._INSTANCE=null;function F3(){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 B3(s,e){if(s===0)return 0;const t=W3(s,e);if(t!==void 0)return t;const i=Rc(e,s);return s-=v_(i),s}function W3(s,e){let t=Rc(e,s);for(s-=v_(t);V3(t)||t===65039||t===8419;){if(s===0)return;t=Rc(e,s),s-=v_(t)}if(Pf(t)){if(s>=0){const i=Rc(e,s);i===8205&&(s-=v_(i))}return s}}function v_(s){return s>=65536?2:1}function V3(s){return 127995<=s&&s<=127999}var JI,eE;class H3{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 z3{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?ex(e,this._value,0,e.length,this._from,this._to):Rp(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class U3{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?ex(e,this._value,0,e.length,this._from,this._to):Rp(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class $3{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 U3(!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 U1(e,this._value.scheme);if(this._states[this._stateIdx]===2)return U1(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return bg(e,this._value.query);if(this._states[this._stateIdx]===5)return bg(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 mm{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return(t=(e=this.left)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}get heightRight(){var e,t;return(t=(e=this.right)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}}class Mc{constructor(e){this._iter=e}static forUris(e=()=>!1){return new Mc(new $3(e))}static forStrings(){return new Mc(new H3)}static forConfigKeys(){return new Mc(new z3)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new mm,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new mm,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(a<0)n.right||(n.right=new mm,n.right.segment=i.value()),o.push([1,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new mm,n.mid.segment=i.value()),o.push([0,n]),n=n.mid;else break}const r=n.value;n.value=t,n.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const d=l.balanceFactor();if(d<-1||d>1){const h=o[a][0],c=o[a+1][0];if(h===1&&c===1)o[a][1]=l.rotateLeft();else if(h===-1&&c===-1)o[a][1]=l.rotateRight();else if(h===1&&c===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(h===-1&&c===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}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){var i;const n=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=n.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right),{key:l,value:d,segment:h}=a;this._delete(a.key,!1),r.key=l,r.value=d,r.segment=h}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,d]=o[o.length-1];switch(l){case-1:d.left=a;break;case 0:d.mid=a;break;case 1:d.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const d=l.balanceFactor();if(d>1?(l.right.balanceFactor()>=0||(l.right=o[a+1][1]=o[a+1][1].rotateRight()),o[a][1]=l.rotateLeft()):d<-1&&(l.left.balanceFactor()<=0||(l.left=o[a+1][1]=o[a+1][1].rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}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){e&&(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class j3{constructor(e,t){this.uri=e,this.value=t}}class Zi{constructor(e,t){this[JI]="ResourceMap",e instanceof Zi?(this.map=new Map(e.map),this.toKey=t??Zi.defaultToKey):(this.map=new Map,this.toKey=e??Zi.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new j3(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(JI=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}Zi.defaultToKey=s=>s.toString();class K3{constructor(){this[eE]="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}[(eE=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 kl extends K3{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 tE=typeof Buffer<"u";let $w;class YC{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return tE&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new YC(e)}toString(){return tE?this.buffer.toString():($w||($w=new TextDecoder),$w.decode(this.buffer))}}function q3(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function G3(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Qs(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 Js(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 iE(s,e){return s[e]}function nE(s,e,t){s[t]=e}function $1(s){let e=JSON.parse(s);return e=j1(e),e}function j1(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case 1:return me.revive(s);case 2:return new RegExp(s.source,s.flags)}if(s instanceof YC||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t<s.length;++t)s[t]=j1(s[t],e+1);else for(const t in s)Object.hasOwnProperty.call(s,t)&&(s[t]=j1(s[t],e+1))}return s}function Z3(s){return s.replace(/[\\/]/g,oi.sep)}function Y3(s){return s.indexOf("/")===-1&&(s=Z3(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function X3(s,e,t,i=Cd){return s===e?!0:!s||!e||e.length>s.length?!1:(e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0)}function Q3(s){return s>=65&&s<=90||s>=97&&s<=122}function J3(s){const e=$D(s);return Ai?s.length>3?!1:aM(e)&&(s.length===2||e.charCodeAt(2)===92):e===oi.sep}function aM(s){return Ai?Q3(s.charCodeAt(0))&&s.charCodeAt(1)===58:!1}function w_(s){return ab(s,!0)}class eW{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:bg(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 me.joinPath(e,...t)}basenameOrAuthority(e){return qs(e)||e.authority}basename(e){return oi.basename(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Te.file?t=me.file(RR(w_(e))).path:(t=oi.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===Te.file?t=me.file($D(w_(e))).path:t=oi.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===Te.file){const i=me.file(R5(w_(e),t));return e.with({authority:i.authority,path:i.path})}return t=Y3(t),e.with({path:oi.resolve(e.path,t)})}}const vn=new eW(()=>!1),lM=vn.isEqual.bind(vn),dM=vn.basenameOrAuthority.bind(vn),qs=vn.basename.bind(vn),sx=vn.dirname.bind(vn),tW=vn.joinPath.bind(vn),iW=vn.normalizePath.bind(vn),sE=vn.resolvePath.bind(vn);var ll;(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})(ll||(ll={}));function hM(s){return Array.isArray(s)}function Gs(s){return typeof s=="string"}function bn(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Wd(s){return typeof s=="number"&&!isNaN(s)}function cM(s){return s===!0||s===!1}function sn(s){return typeof s>"u"}function nW(s){return!Un(s)}function Un(s){return sn(s)||s===null}function ut(s,e){if(!s)throw new Error("Unexpected type")}function _m(s){if(Un(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function Bf(s){return typeof s=="function"}function sW(s,e){const t=Math.min(s.length,e.length);for(let i=0;i<t;i++)oW(s[i],e[i])}function oW(s,e){if(Gs(e)){if(typeof s!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(Bf(e)){try{if(s instanceof e)return}catch{}if(!Un(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 rW(s){let e=[],t=Object.getPrototypeOf(s);for(;Object.prototype!==t;)e=e.concat(Object.getOwnPropertyNames(t)),t=Object.getPrototypeOf(t);return e}function ox(s){const e=[];for(const t of rW(s))typeof s[t]=="function"&&e.push(t);return e}function aW(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 Kn(s){return s===null?void 0:s}function lW(s,e="Unreachable"){throw new Error(e)}const Yt=Je("commandService"),$e=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 sW(d,r),a(l,...d)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new jn,this._commands.set(t,i));let n=i.unshift(s),o=Ve(()=>{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 $e.registerCommand(s,(t,...i)=>t.get(Yt).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return Ue.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}};$e.registerCommand("noop",()=>{});var pb;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(pb||(pb={}));var oE=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Co=Je("openerService"),dW=Object.freeze({_serviceBrand:void 0,registerOpener(){return H.None},registerValidator(){return H.None},registerExternalUriResolver(){return H.None},setDefaultExternalOpener(){},registerExternalOpener(){return H.None},open(){return oE(this,void 0,void 0,function*(){return!1})},resolveExternalUri(s){return oE(this,void 0,void 0,function*(){return{resolved:s,dispose(){}}})}});function dc(s,e){return me.isUri(s)?Lf(s.scheme,e):nM(s,e+":")}var rx=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},mb=function(s,e){return function(t,i){e(t,i,s)}},Jl=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let K1=class{constructor(e){this._commandService=e}open(e,t){return Jl(this,void 0,void 0,function*(){if(!dc(e,Te.command))return!1;if(!(t!=null&&t.allowCommands))return!0;typeof e=="string"&&(e=me.parse(e));let i=[];try{i=$1(decodeURIComponent(e.query))}catch{try{i=$1(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};K1=rx([mb(0,Yt)],K1);let q1=class{constructor(e){this._editorService=e}open(e,t){return Jl(this,void 0,void 0,function*(){typeof e=="string"&&(e=me.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===Te.file&&(e=iW(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:t!=null&&t.fromUserGesture?pb.USER:pb.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};q1=rx([mb(0,tt)],q1);let G1=class{constructor(e,t){this._openers=new jn,this._validators=new jn,this._resolvers=new jn,this._resolvedUriTargets=new Zi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new jn,this._defaultExternalOpener={openExternal:i=>Jl(this,void 0,void 0,function*(){return dc(i,Te.http)||dc(i,Te.https)?JR(i):window.location.href=i,!0})},this._openers.push({open:(i,n)=>Jl(this,void 0,void 0,function*(){return n!=null&&n.openExternal||dc(i,Te.mailto)||dc(i,Te.http)||dc(i,Te.https)?(yield this._doOpenExternal(i,n),!0):!1})}),this._openers.push(new K1(t)),this._openers.push(new q1(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 Jl(this,void 0,void 0,function*(){const n=typeof e=="string"?me.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 Jl(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 Jl(this,void 0,void 0,function*(){const i=typeof e=="string"?me.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},Oe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Oe.None)})}dispose(){this._validators.clear()}};G1=rx([mb(0,tt),mb(1,Yt)],G1);function S_(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Fa(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]=Fa(s[t]):e[t]=s[t]}),e}function hW(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(uM.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&e.push(n)}}return s}const uM=Object.prototype.hasOwnProperty;function cW(s,e){return Z1(s,e,new Set)}function Z1(s,e,t){if(Un(s))return s;const i=e(s);if(typeof i<"u")return i;if(hM(s)){const n=[];for(const o of s)n.push(Z1(o,e,t));return n}if(bn(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(let o in s)uM.call(s,o)&&(n[o]=Z1(s[o],e,t));return t.delete(s),n}return s}function xo(s,e,t=!0){return bn(s)?(bn(e)&&Object.keys(e).forEach(i=>{i in s?t&&(bn(s[i])&&bn(e[i])?xo(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function po(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(!po(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(),!po(n,o))return!1;for(t=0;t<n.length;t++)if(!po(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 uW={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class fW extends H{constructor(e,t={}){super(),this._onDidUpdate=this._register(new M),this._editor=e,this._options=xo(t,uW,!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 S(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn)})}):t.modifiedEndLineNumber===0?this.ranges.push({rhs:!0,range:new S(t.modifiedStartLineNumber,1,t.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new S(t.modifiedStartLineNumber,1,t.modifiedEndLineNumber+1,1)})}),this.ranges.sort((t,i)=>S.compareRangesUsingStarts(t.range,i.range)),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(S_(!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.revealRangeInCenter(i.range,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 fa=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))}},gW=Me?1.5:1.35,jw=8;class wd{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(42),r=e.get(46),a=e.get(45),l=e.get(44),d=e.get(58),h=e.get(55);return wd._create(o,r,a,l,d,h,t,i,n)}static _create(e,t,i,n,o,r,a,l,d){o===0?o=gW*i:o<jw&&(o=o*i),o=Math.round(o),o<jw&&(o=jw);const h=1+(d?0:fa.getZoomLevel()*.1);return i*=h,o*=h,new wd({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(e){const t=wd._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const pW=1;class Y1 extends wd{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=pW,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 mW(s){return s&&typeof s.id=="string"}const Mp={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Xn;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(Xn||(Xn={}));var fs;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(fs||(fs={}));class y_{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,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&po(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class Cg{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}var Sd;(function(s){s[s.Disabled=0]="Disabled",s[s.EnabledForActive=1]="EnabledForActive",s[s.Enabled=2]="Enabled"})(Sd||(Sd={}));class mc{constructor(e,t,i){this.visibleColumn=e,this.className=t,this.horizontalLine=i}}class X1{constructor(e,t){this.top=e,this.endColumn=t}}class Kw{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 _W{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function ax(s){return XC(s,0)}function XC(s,e){switch(typeof s){case"object":return s===null?ea(349,e):Array.isArray(s)?CW(s,e):vW(s,e);case"string":return lx(s,e);case"boolean":return bW(s,e);case"number":return ea(s,e);case"undefined":return ea(937,e);default:return ea(617,e)}}function ea(s,e){return(e<<5)-e+s|0}function bW(s,e){return ea(s?433:863,e)}function lx(s,e){e=ea(149417,e);for(let t=0,i=s.length;t<i;t++)e=ea(s.charCodeAt(t),e);return e}function CW(s,e){return e=ea(104579,e),s.reduce((t,i)=>XC(i,t),e)}function vW(s,e){return e=ea(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=lx(i,t),XC(s[i],t)),e)}function qw(s,e,t=32){const i=t-e,n=~((1<<i)-1);return(s<<e|(n&s)>>>i)>>>0}function rE(s,e=0,t=s.byteLength,i=0){for(let n=0;n<t;n++)s[e+n]=i}function wW(s,e,t="0"){for(;s.length<e;)s=t+s;return s}function sf(s,e=32){return s instanceof ArrayBuffer?Array.from(new Uint8Array(s)).map(t=>t.toString(16).padStart(2,"0")).join(""):wW((s>>>0).toString(16),e/4)}class QC{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(Si(r))if(a+1<t){const d=e.charCodeAt(a+1);Yc(d)?(a++,l=tx(r,d)):l=65533}else{o=r;break}else Yc(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()),sf(this._h0)+sf(this._h1)+sf(this._h2)+sf(this._h3)+sf(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,rE(this._buff,this._buffLen),this._buffLen>56&&(this._step(),rE(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=QC._bigBlock32,t=this._buffDV;for(let c=0;c<64;c+=4)e.setUint32(c,t.getUint32(c,!1),!1);for(let c=64;c<320;c+=4)e.setUint32(c,qw(e.getUint32(c-12,!1)^e.getUint32(c-32,!1)^e.getUint32(c-56,!1)^e.getUint32(c-64,!1),1),!1);let i=this._h0,n=this._h1,o=this._h2,r=this._h3,a=this._h4,l,d,h;for(let c=0;c<80;c++)c<20?(l=n&o|~n&r,d=1518500249):c<40?(l=n^o^r,d=1859775393):c<60?(l=n&o|n&r|o&r,d=2400959708):(l=n^o^r,d=3395469782),h=qw(i,5)+l+a+d+e.getUint32(c*4,!1)&4294967295,a=r,r=o,o=qw(n,30),n=i,i=h;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}}QC._bigBlock32=new DataView(new ArrayBuffer(320));function As(s,e,t){return Math.min(Math.max(s,e),t)}class SW{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 Gw="**",aE="/",L_="[/\\\\]",D_="[^/\\\\]",yW=/\//g;function lE(s){switch(s){case 0:return"";case 1:return`${D_}*?`;default:return`(?:${L_}|${D_}+${L_}|${L_}${D_}+)*?`}}function dE(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 fM(s){if(!s)return"";let e="";const t=dE(s,aE);if(t.every(i=>i===Gw))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===Gw){i||(e+=lE(2),i=!0);return}let r=!1,a="",l=!1,d="";for(const h of n){if(h!=="}"&&r){a+=h;continue}if(l&&(h!=="]"||!d)){let c;h==="-"?c=h:(h==="^"||h==="!")&&!d?c="^":h===aE?c="":c=Ks(h),d+=c;continue}switch(h){case"{":r=!0;continue;case"[":l=!0;continue;case"}":const u=`(?:${dE(a,",").map(f=>fM(f)).join("|")})`;e+=u,r=!1,a="";break;case"]":e+="["+d+"]",l=!1,d="";break;case"?":e+=D_;continue;case"*":e+=lE(1);continue;default:e+=Ks(h)}}o<t.length-1&&(t[o+1]!==Gw||o+2<t.length)&&(e+=L_),i=!1})}return e}const LW=/^\*\*\/\*\.[\w\.-]+$/,DW=/^\*\*\/([\w\.-]+)\/?$/,xW=/^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/,kW=/^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/,IW=/^\*\*((\/[\w\.-]+)+)\/?$/,EW=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,hE=new kl(1e4),cE=function(){return!1},or=function(){return null};function dx(s,e){if(!s)return or;let t;typeof s!="string"?t=s.pattern:t=s,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let n=hE.get(i);if(n)return uE(n,s);let o;if(LW.test(t)){const r=t.substr(4);n=function(a,l){return typeof a=="string"&&a.endsWith(r)?t:null}}else(o=DW.exec(Zw(t,e)))?n=NW(o[1],t):(e.trimForExclusions?kW:xW).test(t)?n=TW(t,e):(o=IW.exec(Zw(t,e)))?n=fE(o[1].substr(1),t,!0):(o=EW.exec(Zw(t,e)))?n=fE(o[1],t,!1):n=AW(t);return hE.set(i,n),uE(n,s)}function uE(s,e){return typeof e=="string"?s:function(t,i){return X3(t,e.base)?s(M5(e.base,t),i):null}}function Zw(s,e){return e.trimForExclusions&&s.endsWith("/**")?s.substr(0,s.length-2):s}function NW(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 TW(s,e){const t=pM(s.slice(1,-1).split(",").map(a=>dx(a,e)).filter(a=>a!==or),s),i=t.length;if(!i)return or;if(i===1)return t[0];const n=function(a,l){for(let d=0,h=t.length;d<h;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 fE(s,e,t){const i=Cd===oi.sep,n=i?s:s.replace(yW,Cd),o=Cd+n,r=oi.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 AW(s){try{const e=new RegExp(`^${fM(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return or}}function RW(s,e,t){return!s||typeof e!="string"?!1:gM(s)(e,void 0,t)}function gM(s,e={}){if(!s)return cE;if(typeof s=="string"||MW(s)){const t=dx(s,e);if(t===or)return cE;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return OW(s,e)}function MW(s){const e=s;return e&&typeof e.base=="string"&&typeof e.pattern=="string"}function OW(s,e){const t=pM(Object.getOwnPropertyNames(s).map(a=>PW(a,s[a],e)).filter(a=>a!==or)),i=t.length;if(!i)return or;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(h,c){for(let u=0,f=t.length;u<f;u++){const g=t[u](h,c);if(g)return g}return null},l=t.find(h=>!!h.allBasenames);l&&(a.allBasenames=l.allBasenames);const d=t.reduce((h,c)=>c.allPaths?h.concat(c.allPaths):h,[]);return d.length&&(a.allPaths=d),a}const n=function(a,l,d){let h;for(let c=0,u=t.length;c<u;c++){const f=t[c];f.requiresSiblings&&d&&(l||(l=bd(a)),h||(h=l.substr(0,l.length-O5(a).length)));const g=f(a,l,h,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 PW(s,e,t){if(e===!1)return or;const i=dx(s,t);if(i===or)return or;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 h=n.replace("$(basename)",l),c=d(h);return t3(c)?c.then(u=>u?s:null):c?s:null};return o.requiresSiblings=!0,o}}return i}function pM(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 h;for(h=a.length;h>0;h--){const c=a.charCodeAt(h-1);if(c===47||c===92)break}l=a.substr(h)}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 mM(s,e,t,i){if(Array.isArray(s)){let n=0;for(const o of s){const r=mM(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:$D(o.base)}),d===e.fsPath||RW(d,e.fsPath))l=10;else return 0}return l}else return 0}}const ri=Je("modelService");function FW(s){return!s.isTooLargeForSyncing()&&!s.isForSimpleWidget}function _M(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(_M):!!s.exclusive}class jt{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),Ve(()=>{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.getLanguageId()};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=mM(i.selector,e.uri,e.getLanguageId(),FW(e)),_M(i.selector)&&i._score>0){for(let n of this._entries)n._score=0;i._score=1e3;break}this._entries.sort(jt._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}}const gE=new WeakMap;let BW=0;function WW(s){let e=gE.get(s);return e===void 0&&(e=++BW,gE.set(s,e)),e}class _b{constructor(e,t,i=Number.MAX_SAFE_INTEGER){this._registry=e,this.min=t,this.max=i,this._cache=new kl(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>XC(WW(i),t),0)}_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 SW,this._cache.set(i,n)),n.update(t),this.get(e)}}class VW{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]),Ve(()=>{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))})),Ve(()=>{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 HW=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 bM=new HW,bb=bM;function Zs(s,e){return new ie(s,e)}function zW(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}class ie{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,bM.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var En;(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 ie)return["codicon","codicon-"+o.id];const r=e.exec(o.id);if(!r)return t(ie.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})(En||(En={}));(function(s){s.add=new s("add",{fontCharacter:"\\ea60"}),s.plus=new s("plus",s.add.definition),s.gistNew=new s("gist-new",s.add.definition),s.repoCreate=new s("repo-create",s.add.definition),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.dropDownButton=new s("drop-down-button",s.chevronDown.definition),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:"\\eba4"}),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.layers=new s("layers",{fontCharacter:"\\ebd2"}),s.layersDot=new s("layers-dot",{fontCharacter:"\\ebd3"}),s.layersActive=new s("layers-active",{fontCharacter:"\\ebd4"}),s.compass=new s("compass",{fontCharacter:"\\ebd5"}),s.compassDot=new s("compass-dot",{fontCharacter:"\\ebd6"}),s.compassActive=new s("compass-active",{fontCharacter:"\\ebd7"}),s.azure=new s("azure",{fontCharacter:"\\ebd8"}),s.issueDraft=new s("issue-draft",{fontCharacter:"\\ebd9"}),s.gitPullRequestClosed=new s("git-pull-request-closed",{fontCharacter:"\\ebda"}),s.gitPullRequestDraft=new s("git-pull-request-draft",{fontCharacter:"\\ebdb"}),s.debugAll=new s("debug-all",{fontCharacter:"\\ebdc"}),s.debugCoverage=new s("debug-coverage",{fontCharacter:"\\ebdd"}),s.runErrors=new s("run-errors",{fontCharacter:"\\ebde"}),s.folderLibrary=new s("folder-library",{fontCharacter:"\\ebdf"}),s.debugContinueSmall=new s("debug-continue-small",{fontCharacter:"\\ebe0"}),s.beakerStop=new s("beaker-stop",{fontCharacter:"\\ebe1"}),s.graphLine=new s("graph-line",{fontCharacter:"\\ebe2"}),s.graphScatter=new s("graph-scatter",{fontCharacter:"\\ebe3"}),s.pieChart=new s("pie-chart",{fontCharacter:"\\ebe4"}),s.bracket=new s("bracket",s.json.definition),s.bracketDot=new s("bracket-dot",{fontCharacter:"\\ebe5"}),s.bracketError=new s("bracket-error",{fontCharacter:"\\ebe6"}),s.lockSmall=new s("lock-small",{fontCharacter:"\\ebe7"}),s.azureDevops=new s("azure-devops",{fontCharacter:"\\ebe8"}),s.verifiedFilled=new s("verified-filled",{fontCharacter:"\\ebe9"})})(ie||(ie={}));class Yi{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 UW=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&&bb.get(t);return i||(console.info("No codicon found for CompletionItemKind "+e),i=ie.symbolProperty),i.classNames}}();let CM=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 ls;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(ls||(ls={}));var rr;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(rr||(rr={}));var vg;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(vg||(vg={}));function $W(s){return s&&me.isUri(s.uri)&&S.isIRange(s.range)&&(S.isIRange(s.originSelectionRange)||S.isIRange(s.targetSelectionRange))}var Q1;(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&&bb.get("symbol-"+l);return d||(console.info("No codicon found for SymbolKind "+r),d=ie.symbolProperty),`${a?"inline":"block"} ${d.classNames}`}s.toCssClassName=o})(Q1||(Q1={}));class vo{constructor(e){this.value=e}}vo.Comment=new vo("comment");vo.Imports=new vo("imports");vo.Region=new vo("region");var Cb;(function(s){s[s.Other=0]="Other",s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Cb||(Cb={}));const vb=new jt,wb=new jt,ro=new jt,hx=new jt,yd=new jt,wg=new jt,Vs=new jt,Xc=new jt,Sb=new jt,Sg=new jt,yb=new jt,Lb=new jt,Db=new jt,Zr=new jt,za=new jt,ar=new jt,Wf=new jt,ao=new jt,xb=new jt,yg=new jt,Qc=new jt,JC=new jt,J1=new jt,Jc=new jt,ev=new jt,Rt=new VW;class jW{clone(){return this}equals(e){return this===e}}const Op=new jW,dl="vs.editor.nullMode";function vM(s,e,t,i){return new jD([new $C(i,"",s)],t)}function cx(s,e,t,i){let n=new Uint32Array(2);return n[0]=i,n[1]=(s<<0|0|0|16384|2<<23)>>>0,new jC(n,t===null?Op:t)}const KW="editorWorkerService",Ys=Je(KW),Qi=Je("modeService"),Qn=Je("textModelService"),qW="$initialize";let pE=!1;function ey(s){Nu&&(pE||(pE=!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 GW{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class mE{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class ZW{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class YW{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class XW{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class QW{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new GW(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new M({onFirstListenerAdd:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new ZW(this._workerId,i,e,t))},onLastListenerRemove:()=>{this._pendingEmitters.delete(i),this._send(new XW(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}let t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){let t=e.req;this._handler.handleMessage(e.method,e.args).then(n=>{this._send(new mE(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=UI(n.detail)),this._send(new mE(this._workerId,t,void 0,UI(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new YW(this._workerId,t,n))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){let t=[];if(e.type===0)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else e.type===1&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class JW extends H{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",d=>{this._protocol.handleMessage(d)},d=>{n&&n(d)})),this._protocol=new QW({sendMessage:(d,h)=>{this._worker.postMessage(d,h)},handleMessage:(d,h)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,h))}catch(c){return Promise.reject(c)}},handleEvent:(d,h)=>{if(SM(d)){const c=i[d].call(i,h);if(typeof c!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return c}if(wM(d)){const c=i[d];if(typeof c!="function")throw new Error(`Missing event ${d} on main thread host.`);return c}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof Et.require<"u"&&typeof Et.require.getConfig=="function"?o=Et.require.getConfig():typeof Et.requirejs<"u"&&(o=Et.requirejs.s.contexts._.config);const r=ox(i);this._onModuleLoaded=this._protocol.sendMessage(qW,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(d,h)=>this._request(d,h),l=(d,h)=>this._protocol.listen(d,h);this._lazyProxy=new Promise((d,h)=>{n=h,this._onModuleLoaded.then(c=>{d(eV(c,a,l))},c=>{h(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)}}function wM(s){return s[0]==="o"&&s[1]==="n"&&jo(s.charCodeAt(2))}function SM(s){return/^onDynamic/.test(s)&&jo(s.charCodeAt(9))}function eV(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)};let o={};for(const r of s){if(SM(r)){o[r]=n(r);continue}if(wM(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}var Yw;const _E=(Yw=window.trustedTypes)===null||Yw===void 0?void 0:Yw.createPolicy("defaultWorkerFactory",{createScriptURL:s=>s});function tV(s,e){if(Et.MonacoEnvironment){if(typeof Et.MonacoEnvironment.getWorker=="function")return Et.MonacoEnvironment.getWorker(s,e);if(typeof Et.MonacoEnvironment.getWorkerUrl=="function"){const t=Et.MonacoEnvironment.getWorkerUrl(s,e);return new Worker(_E?_E.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function iV(s){return typeof s.then=="function"}class nV{constructor(e,t,i,n,o){this.id=t;const r=tV("workerMain.js",i);iV(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 tv{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++tv.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new nV(e,n,this._label||"anonymous"+n,t,o=>{ey(o),this._webWorkerFailedBeforeError=o,i(o)})}}tv.LAST_WORKER_ID=0;var Gt;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Gt||(Gt={}));class Xw{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 sV{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)of(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),of(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),of(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),of(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&of(this.autoClosingPairsCloseSingleChar,t.close,t)}}function of(s,e,t){s.has(e)?s.get(e).push(t):s.set(e,[t])}function bm(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 oV(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class oV{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 Wo(s){return(s&7)!==0}class eu{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Xw(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Xw({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=bE(e.colorizedBracketPairs.map(t=>[t[0],t[1]])):e.brackets?this._colorizedBracketPairs=bE(e.brackets.map(t=>[t[0],t[1]]).filter(t=>!(t[0]==="<"&&t[1]===">"))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Xw({open:t.open,close:t.close||""}))}this._autoCloseBefore=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:eu.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}getColorizedBrackets(){return this._colorizedBracketPairs}}eu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=`;:.,=}])>
  7. `;function bE(s){return s.filter(([e,t])=>e!==""&&t!=="")}let Qw;function yM(){return Qw||(Qw=new TextDecoder("UTF-16LE")),Qw}let Jw;function rV(){return Jw||(Jw=new TextDecoder("UTF-16BE")),Jw}let e0;function LM(){return e0||(e0=yR()?yM():rV()),e0}const DM=typeof TextDecoder<"u";let Vd,ty;DM?(Vd=s=>new lV(s),ty=aV):(Vd=s=>new dV,ty=xM);function aV(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?xM(s,e,t):yM().decode(i)}function xM(s,e,t){let i=[],n=0;for(let o=0;o<t;o++){const r=q3(s,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class lV{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 LM().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||Si(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 dV{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 kb{constructor(e,t,i,n,o,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=r,this._openSet=kb._toSet(this.open),this._closeSet=kb._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 hV(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,[h,c]=a;return l===h||l===c||d===h||d===c},n=(r,a)=>{const l=Math.min(r,a),d=Math.max(r,a);for(let h=0;h<e;h++)t[h]===d&&(t[h]=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[h,c]=s[d];a.push(h),l.push(c)}a.length>0&&o.push({open:a,close:l})}return o}class cV{constructor(e,t){this._richEditBracketsBrand=void 0;const i=hV(t);this.brackets=i.map((n,o)=>new kb(e,o,n.open,n.close,uV(n.open,n.close,i,o),fV(n.open,n.close,i,o))),this.forwardRegex=gV(this.brackets),this.reversedRegex=pV(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 kM(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 IM(s,e){return s.length-e.length}function iv(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 uV(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o<r;o++)kM(n[o],t,i,n);return n=iv(n),n.sort(IM),n.reverse(),nv(n)}function fV(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o<r;o++)kM(n[o],t,i,n);return n=iv(n),n.sort(IM),n.reverse(),nv(n.map(ux))}function gV(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=iv(e),nv(e)}function pV(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=iv(e),nv(e.map(ux))}function mV(s){const e=/^[\w ]+$/.test(s);return s=Ks(s),e?`\\b${s}\\b`:s}function nv(s){let e=`(${s.map(mV).join(")|(")})`;return iM(e,!0)}const ux=function(){function s(i){if(DM){const n=new Uint16Array(i.length);let o=0;for(let r=i.length-1;r>=0;r--)n[o++]=i.charCodeAt(r);return LM().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 Is{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 S(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const a=ux(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 S(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 _V{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(Wo(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Is.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 h=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(h)?{matchOpenBracket:l}:null}}function Cm(s){return s.global&&(s.lastIndex=0),!0}class bV{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Cm(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Cm(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Cm(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Cm(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 _c{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=_c._createOpenBracketRegExp(t[0]),n=_c._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:Gt.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:Gt.Indent}}return null}static _createOpenBracketRegExp(e){let t=Ks(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",_c._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Ks(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,_c._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return Le(t),null}}}class CV{constructor(){this.data=new Map}add(e,t){S_(Gs(e)),S_(bn(t)),S_(!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 Xt=new CV,sv={JSONContribution:"base.contributions.json"};function vV(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class wV{constructor(){this._onDidChangeSchema=new M,this.schemasById={}}registerSchema(e,t){this.schemasById[vV(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const SV=new wV;Xt.add(sv.JSONContribution,SV);const Ch={Configuration:"base.contributions.configuration"},t0="vscode://schemas/settings/resourceLanguage",CE=Xt.as(sv.JSONContribution);class yV{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={},CE.registerSchema(t0,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=this.doRegisterConfigurations(e,t);CE.registerSchema(t0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const i=[];return e.forEach(n=>{i.push(...this.validateAndRegisterProperties(n,t,n.extensionInfo)),this.configurationContributors.push(n),this.registerJSONConfiguration(n)}),i}validateAndRegisterProperties(e,t=!0,i,n=3){var o;n=Un(e.scope)?n:e.scope;let r=[],a=e.properties;if(a)for(let d in a){if(t&&kV(d)){delete a[d];continue}const h=a[d];if(this.updatePropertyDefaultValue(d,h),fx.test(d)?h.scope=void 0:(h.scope=Un(h.scope)?n:h.scope,h.restricted=Un(h.restricted)?!!(!((o=i==null?void 0:i.restrictedConfigurations)===null||o===void 0)&&o.includes(d)):h.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:t0};this.updatePropertyDefaultValue(t,i)}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];sn(i)&&(i=t.default),sn(i)&&(i=xV(t.type)),t.default=i}}const LV="\\[.*\\]$",fx=new RegExp(LV);function DV(s){return s.substring(1,s.length-1)}function xV(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 EM=new yV;Xt.add(Ch.Configuration,EM);function kV(s){return s.trim()?fx.test(s)?p("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):EM.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 Vt=Je("configurationService");function NM(s,e){const t=Object.create(null);for(let i in s)gx(t,i,s[i],e);return t}function gx(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 IV(s,e){const t=e.split(".");TM(s,t)}function TM(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)&&(TM(i,e),Object.keys(i).length===0&&delete s[t])}}function EV(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 NV(){const s=Xt.as(Ch.Configuration).getConfigurationProperties();return Object.keys(s)}function TV(){const s=Object.create(null),e=Xt.as(Ch.Configuration).getConfigurationProperties();for(let t in e){let i=e[t].default;gx(s,t,i,n=>console.error(`Conflict in default settings: ${n}`))}return s}class Oa{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const AM=[];function Il(s,e,t){e instanceof Oa||(e=new Oa(e,[],t)),AM.push([s,e])}function AV(){return AM}var RV=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},vE=function(s,e){return function(t,i){e(t,i,s)}};class i0{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Pp=Je("languageConfigurationService");let Ib=class extends H{constructor(e,t){super(),this.configurationService=e,this.modeService=t,this.onDidChangeEmitter=this._register(new M),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(iy));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(d=>i.has(d))).map(([a])=>this.modeService.validateLanguageId(a));if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new i0(void 0));else for(const a of r)a&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new i0(a)))})),this._register(Qe.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new i0(n.languageId))}))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=MV(e,this.configurationService,this.modeService),this.configurations.set(e,t)),t}};Ib=RV([vE(0,Vt),vE(1,Qi)],Ib);function MV(s,e,t){let i=Qe.getLanguageConfiguration(s);if(!i){const a=t.validateLanguageId(s);if(!a)throw new Error("Unexpected languageId");i=new Lg(a,{})}const n=OV(i.languageId,e),o=RM([i.underlyingConfig,n]);return new Lg(i.languageId,o)}const iy={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function OV(s,e){const t=e.getValue(iy.brackets,{overrideIdentifier:s}),i=e.getValue(iy.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:wE(t),colorizedBracketPairs:wE(i)}}function wE(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}class SE{constructor(e){this.languageId=e}}class PV{constructor(){this._entries=new Map,this._onDidChange=new M,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let n=this._entries.get(e);n||(n=new FV(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new SE(e)),Ve(()=>{o.dispose(),this._onDidChange.fire(new SE(e))})}getLanguageConfiguration(e){let t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}getIndentationRules(e){const t=this.getLanguageConfiguration(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let n=bm(t,i-1),o=this._getElectricCharacterSupport(n.languageId);return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}getComments(e){let t=this.getLanguageConfiguration(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new sV(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():eu.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=bm(t,i-1);return eu.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this.getLanguageConfiguration(e);return nb(t&&t.wordDefinition||null)}getFoldingRules(e){let t=this.getLanguageConfiguration(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this.getLanguageConfiguration(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.getLanguageId());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:ht(a),action:Gt.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ht(a),action:null,line:r};{if(r===1)return{indentation:ht(t.getLineContent(r)),action:null,line:r};const l=r-1,d=o.getIndentMetadata(t.getLineContent(l));if(!(d&3)&&d&4){let h=0;for(let c=l-1;c>0;c--)if(!o.shouldIndentNextLine(t.getLineContent(c))){h=c;break}return{indentation:ht(t.getLineContent(h+1)),action:null,line:h+1}}if(n)return{indentation:ht(t.getLineContent(r)),action:null,line:r};for(let h=r;h>0;h--){const c=t.getLineContent(h);if(o.shouldIncrease(c))return{indentation:ht(c),action:Gt.Indent,line:h};if(o.shouldIndentNextLine(c)){let u=0;for(let f=h-1;f>0;f--)if(!o.shouldIndentNextLine(t.getLineContent(h))){u=f;break}return{indentation:ht(t.getLineContent(u+1)),action:null,line:u+1}}else if(o.shouldDecrease(c))return{indentation:ht(c),action:null,line:h}}return{indentation:ht(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const r=this.getLanguageConfiguration(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 h=l.line;if(h!==void 0){const c=r.onEnter(e,"",t.getLineContent(h),"");if(c){let u=ht(t.getLineContent(h));return c.removeText&&(u=u.substring(0,u.length-c.removeText)),c.indentAction===Gt.Indent||c.indentAction===Gt.IndentOutdent?u=o.shiftIndent(u):c.indentAction===Gt.Outdent&&(u=o.unshiftIndent(u)),a.shouldDecrease(d)&&(u=o.unshiftIndent(u)),c.appendText&&(u+=c.appendText),ht(u)}}return a.shouldDecrease(d)?l.action===Gt.Indent?l.indentation:o.unshiftIndent(l.indentation):l.action===Gt.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=bm(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 h;i.isEmpty()?h=a.substr(i.startColumn-1-r.firstCharOffset):h=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=this.getIndentRulesSupport(r.languageId);if(!c)return null;const u=d,f=ht(d),g={getLineTokens:b=>t.getLineTokens(b),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(b,v)=>t.getLanguageIdAtPosition(b,v),getLineContent:b=>b===i.startLineNumber?u:t.getLineContent(b)},m=ht(o.getLineContent()),_=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!_){const b=l?m:f;return{beforeEnter:b,afterEnter:b}}let C=l?m:_.indentation;return _.action===Gt.Indent&&(C=n.shiftIndent(C)),c.shouldDecrease(h)&&(C=n.unshiftIndent(C)),{beforeEnter:l?m:f,afterEnter:C}}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 h;if(i.isEmpty()?h=l.substr(i.startColumn-1-r.firstCharOffset):h=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(d+h)&&a.shouldDecrease(d+n+h)){const c=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!c)return null;let u=c.indentation;return c.action!==Gt.Indent&&(u=o.unshiftIndent(u)),u}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageId());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.getLanguageConfiguration(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 h=o.onEnter(e,d,a,l);if(!h)return null;const c=h.indentAction;let u=h.appendText;const f=h.removeText||0;u?c===Gt.Indent&&(u=" "+u):c===Gt.Indent||c===Gt.IndentOutdent?u=" ":u="";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:c,appendText:u,removeText:f,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=ht(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 bm(n,o)}}const Qe=new PV;class FV{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new yE(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ve(()=>{for(let n=0;n<this._entries.length;n++)if(this._entries[n]===i){this._entries.splice(n,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new Lg(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(yE.cmp),RM(this._entries.map(e=>e.configuration)))}}function RM(s){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of s)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class yE{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 Lg{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new _c(this.underlyingConfig):null,this.comments=Lg._handleComments(this.underlyingConfig),this.characterPair=new eu(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||DR,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new bV(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return nb(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new cV(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new _V(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}}Il(Pp,Ib);class Aa{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 LE{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 BV(s,e,t){return new Yo(new LE(s),new LE(e)).ComputeDiff(t).changes}class Kh{static Assert(e,t){if(!e)throw new Error(t)}}class qh{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 DE{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 Aa(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 Yo{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=Yo._getElements(e),[a,l,d]=Yo._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(Yo._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n<o;n++)i[n]=lx(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=Yo._getStrictElement(this._originalSequence,e),n=Yo._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 c;return i<=n?(Kh.Assert(e===t+1,"originalStart should only be one more than originalEnd"),c=[new Aa(e,0,i,n-i+1)]):e<=t?(Kh.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),c=[new Aa(e,t-e+1,i,0)]):(Kh.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Kh.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),c=[]),c}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,o),d=r[0],h=a[0];if(l!==null)return l;if(!o[0]){const c=this.ComputeDiffRecursive(e,d,i,h,o);let u=[];return o[0]?u=[new Aa(d+1,t-(d+1)+1,h+1,n-(h+1)+1)]:u=this.ComputeDiffRecursive(d+1,t,h+1,n,o),this.ConcatenateChanges(c,u)}return[new Aa(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m,_,C,b){let v=null,w=null,y=new DE,k=t,L=i,D=f[0]-_[0]-n,N=-1073741824,B=this.m_forwardHistory.length-1;do{const O=D+e;O===k||O<L&&d[O-1]<d[O+1]?(c=d[O+1],g=c-D-n,c<N&&y.MarkNextChange(),N=c,y.AddModifiedElement(c+1,g),D=O+1-e):(c=d[O-1]+1,g=c-D-n,c<N&&y.MarkNextChange(),N=c-1,y.AddOriginalElement(c,g+1),D=O-1-e),B>=0&&(d=this.m_forwardHistory[B],e=d[0],k=1,L=d.length-1)}while(--B>=-1);if(v=y.getReverseChanges(),b[0]){let O=f[0]+1,$=_[0]+1;if(v!==null&&v.length>0){const K=v[v.length-1];O=Math.max(O,K.getOriginalEnd()),$=Math.max($,K.getModifiedEnd())}w=[new Aa(O,u-O+1,$,m-$+1)]}else{y=new DE,k=r,L=a,D=f[0]-_[0]-l,N=1073741824,B=C?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=D+o;O===k||O<L&&h[O-1]>=h[O+1]?(c=h[O+1]-1,g=c-D-l,c>N&&y.MarkNextChange(),N=c+1,y.AddOriginalElement(c+1,g+1),D=O+1-o):(c=h[O-1],g=c-D-l,c>N&&y.MarkNextChange(),N=c,y.AddModifiedElement(c+1,g+1),D=O-1-o),B>=0&&(h=this.m_reverseHistory[B],o=h[0],k=1,L=h.length-1)}while(--B>=-1);w=y.getChanges()}return this.ConcatenateChanges(v,w)}ComputeRecursionPoint(e,t,i,n,o,r,a){let l=0,d=0,h=0,c=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,_=new Int32Array(m),C=new Int32Array(m),b=n-i,v=t-e,w=e-i,y=t-n,L=(v-b)%2===0;_[b]=e,C[v]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let N=0,B=0;h=this.ClipDiagonalBound(b-D,D,b,m),c=this.ClipDiagonalBound(b+D,D,b,m);for(let $=h;$<=c;$+=2){$===h||$<c&&_[$-1]<_[$+1]?l=_[$+1]:l=_[$-1]+1,d=l-($-b)-w;const K=l;for(;l<t&&d<n&&this.ElementsAreEqual(l+1,d+1);)l++,d++;if(_[$]=l,l+d>N+B&&(N=l,B=d),!L&&Math.abs($-v)<=D-1&&l>=C[$])return o[0]=l,r[0]=d,K<=C[$]&&D<=1448?this.WALKTRACE(b,h,c,w,v,u,f,y,_,C,l,t,o,d,n,r,L,a):null}const O=(N-e+(B-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,O))return a[0]=!0,o[0]=N,r[0]=B,O>0&&D<=1448?this.WALKTRACE(b,h,c,w,v,u,f,y,_,C,l,t,o,d,n,r,L,a):(e++,i++,[new Aa(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(v-D,D,v,m),f=this.ClipDiagonalBound(v+D,D,v,m);for(let $=u;$<=f;$+=2){$===u||$<f&&C[$-1]>=C[$+1]?l=C[$+1]-1:l=C[$-1],d=l-($-v)-y;const K=l;for(;l>e&&d>i&&this.ElementsAreEqual(l,d);)l--,d--;if(C[$]=l,L&&Math.abs($-b)<=D&&l<=_[$])return o[0]=l,r[0]=d,K>=_[$]&&D<=1448?this.WALKTRACE(b,h,c,w,v,u,f,y,_,C,l,t,o,d,n,r,L,a):null}if(D<=1447){let $=new Int32Array(c-h+2);$[0]=b-h+1,qh.Copy2(_,h,$,1,c-h+1),this.m_forwardHistory.push($),$=new Int32Array(f-u+2),$[0]=v-u+1,qh.Copy2(C,u,$,1,f-u+1),this.m_reverseHistory.push($)}}return this.WALKTRACE(b,h,c,w,v,u,f,y,_,C,l,t,o,d,n,r,L,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 c=e[t-1];n=c.originalStart+c.originalLength,o=c.modifiedStart+c.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 c=1;;c++){const u=i.originalStart-c,f=i.modifiedStart-c;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=c)}i.originalStart-=l,i.modifiedStart-=l;const h=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],h)){e[t-1]=h[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,h=n.modifiedStart,c=o.modifiedStart+o.modifiedLength,u=c-h;if(r<5&&d<20&&u<20){const f=this._findBetterContiguousSequence(a,d,h,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=c-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,h=0;for(let c=e;c<r;c++)for(let u=i;u<a;u++){const f=this._contiguousSequenceScore(c,u,o);f>0&&f>l&&(l=f,d=c,h=u)}return l>0?[d,h]: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 qh.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],qh.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return qh.Copy(e,0,n,0,e.length),qh.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(Kh.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Kh.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 Aa(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 WV=3;function MM(s,e,t,i){return new Yo(s,e,t).ComputeDiff(i)}class xE{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=ny(e[n],1),i[n]=sy(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],h=e?this._startColumns[l]:1,c=e?this._endColumns[l]:d.length+1;for(let u=h;u<c;u++)n[a]=d.charCodeAt(u-1),o[a]=l+1,r[a]=u,a++}return new VV(n,o,r)}}class VV{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 Dg{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,h,c;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,h=0,c=0):(l=i.getStartLineNumber(e.modifiedStart),d=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),c=i.getEndColumn(e.modifiedStart+e.modifiedLength-1)),new Dg(n,o,r,a,l,d,h,c)}}function HV(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)<WV?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class Vf{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,h,c,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?(h=n.getStartLineNumber(t.modifiedStart)-1,c=0):(h=n.getStartLineNumber(t.modifiedStart),c=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=MM(f,g,o,!0).changes;a&&(m=HV(m)),u=[];for(let _=0,C=m.length;_<C;_++)u.push(Dg.createFromDiffChange(m[_],f,g))}return new Vf(l,d,h,c,u)}}class zV{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 xE(e),this.modified=new xE(t),this.continueLineDiff=kE(i.maxComputationTime),this.continueCharDiff=kE(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=MM(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(Vf.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,h=d?d.originalStart:this.originalLines.length,c=d?d.modifiedStart:this.modifiedLines.length;for(;o<h&&r<c;){const u=this.originalLines[o],f=this.modifiedLines[r];if(u!==f){{let g=ny(u,1),m=ny(f,1);for(;g>1&&m>1;){const _=u.charCodeAt(g-2),C=f.charCodeAt(m-2);if(_!==C)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,g,r+1,1,m)}{let g=sy(u,1),m=sy(f,1);const _=u.length+1,C=f.length+1;for(;g<_&&m<C;){const b=u.charCodeAt(g-1),v=u.charCodeAt(m-1);if(b!==v)break;g++,m++}(g<_||m<C)&&this._pushTrimWhitespaceCharChange(n,o+1,g,_,r+1,m,C)}}o++,r++}d&&(n.push(Vf.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 Dg(t,i,t,n,o,r,o,a)]),e.push(new Vf(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 Dg(t,i,t,n,o,r,o,a)),!0):!1}}function ny(s,e){const t=an(s);return t===-1?e:t+1}function sy(s,e){const t=sr(s);return t===-1?e:t+2}function kE(s){if(s===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<s}function Eb(s){return s<0?0:s>255?255:s|0}function Gh(s){return s<0?0:s>4294967295?4294967295:s|0}class OM{constructor(e,t){this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class UV{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Gh(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=Gh(e),t=Gh(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=Gh(e),t=Gh(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=Gh(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 OM(n,e-r)}}class $V{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 F(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 UV(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=cr(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 Ru{constructor(e){let t=Eb(e);this._defaultValue=t,this._asciiMap=Ru._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=Eb(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 bc{constructor(){this._actual=new Ru(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}}class jV{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 KV{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 jV(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 n0=null;function qV(){return n0===null&&(n0=new KV([[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]])),n0}let rf=null;function GV(){if(rf===null){rf=new Ru(0);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<s.length;t++)rf.set(s.charCodeAt(t),1);const e=".,;";for(let t=0;t<e.length;t++)rf.set(e.charCodeAt(t),2)}return rf}class Nb{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=qV()){const i=GV();let n=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let d=0,h=0,c=0,u=1,f=!1,g=!1,m=!1,_=!1;for(;d<l;){let C=!1;const b=a.charCodeAt(d);if(u===13){let v;switch(b){case 40:f=!0,v=0;break;case 41:v=f?0:1;break;case 91:m=!0,g=!0,v=0;break;case 93:m=!1,v=g?0:1;break;case 123:_=!0,v=0;break;case 125:v=_?0:1;break;case 39:v=c===34||c===96?0:1;break;case 34:v=c===39||c===96?0:1;break;case 96:v=c===39||c===34?0:1;break;case 42:v=c===42?1:0;break;case 124:v=c===124?1:0;break;case 32:v=m?0:1;break;default:v=i.get(b)}v===1&&(n.push(Nb._createLink(i,a,o,h,d)),C=!0)}else if(u===12){let v;b===91?(g=!0,v=0):v=i.get(b),v===1?C=!0:u=13}else u=t.nextState(u,b),u===0&&(C=!0);C&&(u=1,f=!1,g=!1,_=!1,h=d+1,c=b),d++}u===13&&n.push(Nb._createLink(i,a,o,h,l))}return n}}function ZV(s){return!s||typeof s.getLineCount!="function"||typeof s.getLineContent!="function"?[]:Nb.computeLinks(s)}class oy{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}}oy.INSTANCE=new oy;var Zh=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class YV extends $V{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=sb(e.column,nb(t),this._lines[e.lineNumber-1],0);return i?new S(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(!F.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 Hd{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 YV(me.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 Zh(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(),h=new zV(a,l,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}).computeDiff(),c=h.changes.length>0?!1:this._modelsAreIdentical(o,r);return{quitEarly:h.quitEarly,identical:c,changes:h.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 Zh(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 S.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),S.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)>Hd._diffLimit){n.push({range:r,text:a});continue}const h=BV(d,a,!1),c=i.offsetAt(S.lift(r).getStartPosition());for(const u of h){const f=i.positionAt(c+u.originalStart),g=i.positionAt(c+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 Zh(this,void 0,void 0,function*(){let t=this._getModel(e);return t?ZV(t):null})}textualSuggest(e,t,i,n){return Zh(this,void 0,void 0,function*(){const o=new dr(!0),r=new RegExp(i,n),a=new Set;e:for(let l of e){const d=this._getModel(l);if(d){for(let h of d.words(r))if(!(h===t||!isNaN(Number(h)))&&(a.add(h),a.size>Hd._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,n){return Zh(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 h of d){if(!isNaN(Number(h.word)))continue;let c=a[h.word];c||(c=[],a[h.word]=c),c.push({startLineNumber:l,startColumn:h.startColumn,endLineNumber:l,endColumn:h.endColumn})}}return a})}navigateValueSet(e,t,i,n,o){return Zh(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 h=r.getValueInRange(d);return oy.INSTANCE.navigateValueSet(t,l,d,h,i)})}loadForeignModule(e,t,i){let r={host:aW(i,(a,l)=>this._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(ox(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)}}}Hd._diffLimit=1e5;Hd._suggestionsLimit=1e4;typeof importScripts=="function"&&(Et.monaco=FR());const px=Je("textResourceConfigurationService"),PM=Je("textResourcePropertiesService");function os(s,e=0){return s[s.length-(1+e)]}function XV(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function zs(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 mx(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 FM(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 ry(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?ry(s,n,t):s<n.length+r.length?r[0]:ry(s-(n.length+r.length),o,t)}function IE(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 vh(s){return s.filter(e=>!!e)}function BM(s){return!Array.isArray(s)||s.length===0}function Tn(s){return Array.isArray(s)&&s.length>0}function Tb(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function QV(s,e){const t=JV(s,e);if(t!==-1)return s[t]}function JV(s,e){for(let t=s.length-1;t>=0;t--){const i=s[t];if(e(i))return t}return-1}function ay(s,e){return s.length>0?s[0]:e}function _x(s){return[].concat(...s)}function tn(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 xg(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function s0(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function vm(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function bx(s){return Array.isArray(s)?s:[s]}function eH(s,e,t){const i=WM(s,e),n=s.length,o=t.length;s.length=n+o;for(let r=n-1;r>=i;r--)s[r+o]=s[r];for(let r=0;r<o;r++)s[r+i]=t[r]}function EE(s,e,t,i){const n=WM(s,e),o=s.splice(n,t);return eH(s,n,i),o}function WM(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}class Hf{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}peek(){return this.items[this.firstIdx]}}const Cr=Je("logService");var ho;(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"})(ho||(ho={}));const VM=ho.Info;class tH extends H{constructor(){super(...arguments),this.level=VM,this._onDidChangeLogLevel=this._register(new M)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class iH extends tH{constructor(e=VM){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=ho.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=ho.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=ho.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=ho.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class nH extends H{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 sH=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},o0=function(s,e){return function(t,i){e(t,i,s)}},ly=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const NE=60*1e3,TE=5*60*1e3;function Cc(s,e){let t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let dy=class extends H{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new rH(this._modelService)),this._logService=i,this._register(yg.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(n,o)=>Cc(this._modelService,n.uri)?this._workerManager.withWorker().then(r=>r.computeLinks(n.uri)).then(r=>r&&{links:r}):Promise.resolve({links:[]})})),this._register(ro.register("*",new oH(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(Tn(t)){if(!Cc(this._modelService,e))return Promise.resolve(t);const i=dr.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,rl(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Cc(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Cc(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};dy=sH([o0(0,ri),o0(1,px),o0(2,Cr)],dy);class oH{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return ly(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")Cc(this._modelService,e.uri)&&n.push(e.uri);else for(const c of this._modelService.getModels())Cc(this._modelService,c.uri)&&(c===e?n.unshift(c.uri):(i.wordBasedSuggestionsMode==="allDocuments"||c.getLanguageId()===e.getLanguageId())&&n.push(c.uri));if(n.length===0)return;const o=Qe.getWordDefinition(e.getLanguageId()),r=e.getWordAtPosition(t),a=r?new S(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):S.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),h=yield(yield this._workerManager.withWorker()).textualSuggest(n,r==null?void 0:r.word,o);if(h)return{duration:h.duration,suggestions:h.words.map(c=>({kind:18,label:c,insertText:c,range:{insert:l,replace:a}}))}})}}class rH extends H{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Ap).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(TE/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>TE&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new HM(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class aH extends H{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 Ap;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(NE/2)),this._register(n)}}dispose(){for(let e in this._syncedModels)qe(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){let n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){let e=new Date().getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>NE&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){let i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;let n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new X;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Ve(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],qe(t)}}class AE{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class r0{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class HM extends H{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new tv(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 JW(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new r0(this)))}catch(e){ey(e),this._worker=new AE(new Hd(new r0(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(ey(e),this._worker=new AE(new Hd(new r0(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new aH(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return ly(this,void 0,void 0,function*(){return this._disposed?Promise.reject(Au()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).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 ly(this,void 0,void 0,function*(){const n=yield this._withSyncedResources(e),o=i.source,r=Uw(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=Qe.getWordDefinition(n.getLanguageId()),r=o.source,a=Uw(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=Qe.getWordDefinition(o.getLanguageId()),a=r.source,l=Uw(r);return n.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function lH(s,e){return new dH(s,e)}class dH extends HM{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?ox(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 yi{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=yi.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new yi(n,e,t)}equals(e){return e instanceof yi?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],i=Yi.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Yi.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Yi.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Yi.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Yi.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return yi.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new Cx(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 yi(new Uint32Array(o),n,this._languageIdCodec)}}yi.defaultTokenMetadata=(16384|2<<23)>>>0;class Cx{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 Cx?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 qn{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(!qn._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 qn(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],h=d.range;if(h.endLineNumber<t||h.startLineNumber>t||h.isEmpty()&&(d.type===0||d.type===3))continue;const c=h.startLineNumber===t?h.startColumn:i,u=h.endLineNumber===t?h.endColumn:n;o[r++]=new qn(c,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)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=qn._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class RE{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class Ab{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 RE(t,this.stopOffsets[n],this.classNames.join(" "),Ab._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 RE(t,e-1,this.classNames.join(" "),Ab._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 hH{static normalize(e,t){if(t.length===0)return[];let i=[];const n=new Ab;let o=0;for(let r=0,a=t.length;r<a;r++){const l=t[r];let d=l.startColumn,h=l.endColumn;const c=l.className,u=l.type===1?2:l.type===2?4:0;if(d>1){const m=e.charCodeAt(d-2);Si(m)&&d--}if(h>1){const m=e.charCodeAt(h-2);Si(m)&&h--}const f=d-1,g=h-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(g,c,u)}return n.consumeLowerThan(1073741824,o,i),i}}class ui{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 cH{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class wh{constructor(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m,_,C,b,v){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(qn.compare),this.tabSize=h,this.startVisibleColumn=c,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=C,this.fontLigatures=b,this.selectionsOnLine=v&&v.sort((k,L)=>k.startOffset<L.startOffset?-1:1);const w=Math.abs(g-u),y=Math.abs(f-u);w<y?(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&&qn.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class vx{constructor(e,t){this.partIndex=e,this.charIndex=t}}class Ko{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=Ko.getPartIndex(t),n=Ko.getCharIndex(t);return new vx(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,_=this._data[m];if(_===n)return m;_>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=Ko.getPartIndex(a),h=Ko.getCharIndex(a),c=Ko.getPartIndex(l),u;d!==c?u=t:u=Ko.getCharIndex(l);let f=i-h,g=u-i;return f<=g?o:r}}class hy{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function ov(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 Ko(1,t+i);return o.setColumnInfo(1,t,0,0),new hy(o,!1,n)}return e.appendASCIIString("<span><span></span></span>"),new hy(new Ko(0,0),!1,0)}return vH(gH(s),e)}class uH{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function rv(s){let e=Vd(1e4),t=ov(s,e);return new uH(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class fH{constructor(e,t,i,n,o,r,a,l,d,h,c,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=h,this.containsRTL=c,this.spaceWidth=u,this.renderSpaceCharCode=f,this.renderWhitespace=g,this.renderControlCharacters=m}}function gH(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=pH(s.lineTokens,s.fauxIndentLength,i);(s.renderWhitespace===4||s.renderWhitespace===1||s.renderWhitespace===2&&s.selectionsOnLine||s.renderWhitespace===3)&&(n=bH(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=CH(e,i,n,s.lineDecorations)}return s.containsRTL||(n=mH(e,n,!s.isBasicASCII||s.fontLigatures)),s.renderControlCharacters&&!s.isBasicASCII&&(n=_H(e,n)),new fH(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 pH(s,e,t){let i=[],n=0;e>0&&(i[n++]=new ui(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 ui(t,l,0);break}i[n++]=new ui(a,l,0)}return i}function mH(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 h=l.type,c=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 ui(u+1,h,c),f=u+1,u=-1);f!==d&&(n[o++]=new ui(d,h,c))}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 h=d-i;if(h>50){const c=l.type,u=l.metadata,f=Math.ceil(h/50);for(let g=1;g<f;g++){let m=i+g*50;n[o++]=new ui(m,c,u)}n[o++]=new ui(d,c,u)}else n[o++]=l;i=d}return n}function zM(s){return s<32?s!==9:s===127||s>=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function _H(s,e){let t=[],i=new ui(0,"",0),n=0;for(const o of e){const r=o.endIndex;for(;n<r;n++){const a=s.charCodeAt(n);zM(a)&&(n>i.endIndex&&(i=new ui(n,o.type,o.metadata),t.push(i)),i=new ui(n+1,"mtkcontrol",o.metadata),t.push(i))}n>i.endIndex&&(i=new ui(r,o.type,o.metadata),t.push(i))}return t}function bH(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,l=s.useMonospaceOptimizations,d=s.selectionsOnLine,h=s.renderWhitespace===1,c=s.renderWhitespace===3,u=s.renderSpaceWidth!==s.spaceWidth;let f=[],g=0,m=0,_=i[m].type,C=i[m].endIndex;const b=i.length;let v=!1,w=an(e),y;w===-1?(v=!0,w=t,y=t):y=sr(e);let k=!1,L=0,D=d&&d[L],N=a%r;for(let O=o;O<t;O++){const $=e.charCodeAt(O);D&&O>=D.endOffset&&(L++,D=d&&d[L]);let K;if(O<w||O>y)K=!0;else if($===9)K=!0;else if($===32)if(h)if(k)K=!0;else{const le=O+1<t?e.charCodeAt(O+1):0;K=le===32||le===9}else K=!0;else K=!1;if(K&&d&&(K=!!D&&D.startOffset<=O&&D.endOffset>O),K&&c&&(K=v||O>y),k){if(!K||!l&&N>=r){if(u){const le=g>0?f[g-1].endIndex:o;for(let de=le+1;de<=O;de++)f[g++]=new ui(de,"mtkw",1)}else f[g++]=new ui(O,"mtkw",1);N=N%r}}else(O===C||K&&O>o)&&(f[g++]=new ui(O,_,0),N=N%r);for($===9?N=r:go($)?N+=2:N++,k=K;O===C&&(m++,m<b);)_=i[m].type,C=i[m].endIndex}let B=!1;if(k)if(n&&h){let O=t>0?e.charCodeAt(t-1):0,$=t>1?e.charCodeAt(t-2):0;O===32&&$!==32&&$!==9||(B=!0)}else B=!0;if(B)if(u){const O=g>0?f[g-1].endIndex:o;for(let $=O+1;$<=t;$++)f[g++]=new ui($,"mtkw",1)}else f[g++]=new ui(t,"mtkw",1);else f[g++]=new ui(t,_,0);return f}function CH(s,e,t,i){i.sort(qn.compare);const n=hH.normalize(s,i),o=n.length;let r=0,a=[],l=0,d=0;for(let c=0,u=t.length;c<u;c++){const f=t[c],g=f.endIndex,m=f.type,_=f.metadata;for(;r<o&&n[r].startOffset<g;){const C=n[r];if(C.startOffset>d&&(d=C.startOffset,a[l++]=new ui(d,m,_)),C.endOffset+1<=g)d=C.endOffset+1,a[l++]=new ui(d,m+" "+C.className,_|C.metadata),r++;else{d=g,a[l++]=new ui(d,m+" "+C.className,_|C.metadata);break}}g>d&&(d=g,a[l++]=new ui(d,m,_))}const h=t[t.length-1].endIndex;if(r<o&&n[r].startOffset===h)for(;r<o&&n[r].startOffset===h;){const c=n[r];a[l++]=new ui(d,c.className,c.metadata),r++}return a}function vH(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,h=s.tabSize,c=s.startVisibleColumn,u=s.containsRTL,f=s.spaceWidth,g=s.renderSpaceCharCode,m=s.renderWhitespace,_=s.renderControlCharacters,C=new Ko(r+1,l.length);let b=!1,v=0,w=c,y=0,k=0,L=0,D=0;u?e.appendASCIIString('<span dir="ltr">'):e.appendASCIIString("<span>");for(let N=0,B=l.length;N<B;N++){D+=L;const O=l[N],$=O.endIndex,K=O.type,le=m!==0&&O.isWhitespace(),de=le&&!t&&(K==="mtkw"||!n),_e=v===$&&O.isPseudoAfter();if(y=0,e.appendASCIIString('<span class="'),e.appendASCIIString(de?"mtkz":K),e.appendASCII(34),le){let De=0;{let we=v,Se=w;for(;we<$;we++){const bt=(o.charCodeAt(we)===9?h-Se%h:1)|0;De+=bt,we>=d&&(Se+=bt)}}for(de&&(e.appendASCIIString(' style="width:'),e.appendASCIIString(String(f*De)),e.appendASCIIString('px"')),e.appendASCII(62);v<$;v++){C.setColumnInfo(v+1,N-k,y,D),k=0;const we=o.charCodeAt(v);let Se;if(we===9){Se=h-w%h|0,!i||Se>1?e.write1(8594):e.write1(65515);for(let Tt=2;Tt<=Se;Tt++)e.write1(160)}else Se=1,e.write1(g);y+=Se,v>=d&&(w+=Se)}L=De}else{let De=0;for(e.appendASCII(62);v<$;v++){C.setColumnInfo(v+1,N-k,y,D),k=0;const we=o.charCodeAt(v);let Se=1,Tt=1;switch(we){case 9:Se=h-w%h,Tt=Se;for(let bt=1;bt<=Se;bt++)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:_?e.write1(9216):e.appendASCIIString("&#00;");break;case 65279:case 8232:case 8233:case 133:e.write1(65533);break;default:go(we)&&Tt++,_&&we<32?e.write1(9216+we):_&&we===127?e.write1(9249):_&&zM(we)?(e.appendASCIIString("[U+"),e.appendASCIIString(wH(we)),e.appendASCIIString("]"),Se=8):e.write1(we)}y+=Se,De+=Se,v>=d&&(w+=Tt)}L=De}_e?k++:k=0,v>=r&&!b&&O.isPseudoAfter()&&(b=!0,C.setColumnInfo(v+1,N,y,D)),e.appendASCIIString("</span>")}return b||C.setColumnInfo(r+1,l.length-1,y,D),a&&e.appendASCIIString("<span>&hellip;</span>"),e.appendASCIIString("</span>"),new hy(C,u,n)}function wH(s){return s.toString(16).toUpperCase().padStart(4,"0")}class ME{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 SH{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e,t){const i=this.outputLineIndex>0?t:0;return new F(e+this.outputLineIndex,i+this.outputOffset+1)}}class zf{constructor(e,t,i,n,o){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i,this.injectionOffsets=n,this.injectionOptions=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.injectionOptions[n].content.length?i=this.injectionOffsets[n]:i-=this.injectionOptions[n].content.length;return i}getOutputPositionOfInputOffset(e,t=2){let i=0;if(this.injectionOffsets!==null)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n]||t!==1&&e===this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return e+=i,this.getOutputPositionOfOffsetInUnwrappedLine(e,t)}getOutputPositionOfOffsetInUnwrappedLine(e,t=2){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,t===0)if(e<=r)n=o-1;else if(e>a)i=o+1;else break;else if(e<r)n=o-1;else if(e>=a)i=o+1;else break}return new SH(o,e-r)}outputPositionToOffsetInUnwrappedLine(e,t){let i=(e>0?this.breakOffsets[e-1]:0)+t;return e>0&&(i-=this.wrappedTextIndentLength),i}normalizeOffsetAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2)return e===i.offsetInUnwrappedLine+i.length?i.offsetInUnwrappedLine+i.length:i.offsetInUnwrappedLine;if(t===1){let r=i.offsetInUnwrappedLine+i.length,a=i.injectedTextIndex;for(;a+1<this.injectionOffsets.length&&this.injectionOffsets[a+1]===this.injectionOffsets[a];)r+=this.injectionOptions[a+1].content.length,a++;return r}let n=i.offsetInUnwrappedLine,o=i.injectedTextIndex;for(;o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o++;return n}getInjectedText(e,t){const i=this.outputPositionToOffsetInUnwrappedLine(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let o=0;o<t.length;o++){const r=i[o].content.length,a=t[o]+n,l=t[o]+n+r;if(a>e)break;if(e<=l)return{injectedTextIndex:o,offsetInUnwrappedLine:a,length:r};n+=r}}}}class yH{constructor(e,t){this.tabSize=e,this.data=t}}class wx{constructor(e,t,i,n,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Jn{constructor(e,t,i,n,o,r,a,l,d,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Jn.isBasicASCII(i,r),this.containsRTL=Jn.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=d,this.startVisibleColumn=h}static isBasicASCII(e,t){return t?ix(e):!0}static containsRTL(e,t,i){return!t&&i?ZC(e):!1}}class Uf{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class LH{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Uf(new S(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class UM{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class $M{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}function DH(s){return Array.isArray(s)}function xH(s){return!DH(s)}function jM(s){return typeof s=="string"}function OE(s){return!jM(s)}function hc(s){return!s}function Xa(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function PE(s){return s.replace(/[&<>'"_]/g,"-")}function kH(s,e){console.log(`${s.languageId}: ${e}`)}function pt(s,e){return new Error(`${s.languageId}: ${e}`)}function Ba(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,h,c,u,f,g,m){return hc(d)?hc(h)?!hc(c)&&c<i.length?Xa(s,i[c]):!hc(f)&&s&&typeof s[f]=="string"?s[f]:(r===null&&(r=n.split("."),r.unshift(n)),!hc(u)&&u<r.length?Xa(s,r[u]):""):Xa(s,t):"$"})}function wm(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 IH(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 KM=5;class kg{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 Oc(e,t);let i=Oc.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new Oc(e,t),this._entries[i]=n,n)}}kg._INSTANCE=new kg(KM);class Oc{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 Oc._equals(this,e)}push(e){return kg.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return kg.create(this.parent,e)}}class $f{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new $f(this.languageId,this.state)}}class Wa{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 jf(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new jf(e,t);let i=Oc.getStackElementId(e),n=this._entries[i];return n||(n=new jf(e,null),this._entries[i]=n,n)}}Wa._INSTANCE=new Wa(KM);class jf{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:Wa.create(this.stack,this.embeddedModeData)}equals(e){return!(e instanceof jf)||!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 EH{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._languageId=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new $C(e,t,this._languageId)))}nestedModeTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=Rt.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._languageId=null,l.endState}finalize(e){return new jD(this._tokens,e)}}class Rb{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.languageIdCodec.encodeLanguageId(t)}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.languageId,r=i.state,a=Rt.get(o);if(!a)return this.enterMode(n,o),this.emit(n,""),r;let l=a.tokenize2(e,t,r,n);return this._prependTokens=Rb._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new jC(Rb._merge(this._prependTokens,this._tokens,null),e)}}class av{constructor(e,t,i,n){this._modeService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedModes=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._tokenizationRegistryListener=Rt.onDidChange(r=>{if(o)return;let a=!1;for(let l=0,d=r.changedLanguages.length;l<d;l++){let h=r.changedLanguages[l];if(this._embeddedModes[h]){a=!0;break}}a&&(o=!0,Rt.fire([this._languageId]),o=!1)})}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){let e=[];for(let t in this._embeddedModes){const i=Rt.get(t);if(i){if(i instanceof av){const o=i.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}const n=Rt.getPromise(t);n&&e.push(n)}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){let e=kg.create(null,this._lexer.start);return Wa.create(e,null)}tokenize(e,t,i,n){let o=new EH,r=this._tokenize(e,t,i,n,o);return o.finalize(r)}tokenize2(e,t,i,n){let o=new Rb(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=wm(this._lexer,t.stack.state),!i))throw pt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!OE(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 h=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),h)}let d=e.search(a);d===-1||d!==0&&r.matchOnlyAtLineStart||(n===-1||d<n)&&(n=d)}if(!o)throw pt(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 Wa.create(i.stack,new $f(i.embeddedModeData.languageId,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._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+`
  8. `:e,l=a.length;let d=i.embeddedModeData,h=i.stack,c=0,u=null,f=!0;for(;f||c<l;){const g=c,m=h.depth,_=u?u.groups.length:0,C=h.state;let b=null,v=null,w=null,y=null,k=null;if(u){b=u.matches;const N=u.groups.shift();v=N.matched,w=N.action,y=u.rule,u.groups.length===0&&(u=null)}else{if(!f&&c>=l)break;f=!1;let N=this._lexer.tokenizer[C];if(!N&&(N=wm(this._lexer,C),!N))throw pt(this._lexer,"tokenizer state is not defined: "+C);let B=a.substr(c);for(const O of N)if((c===0||!O.matchOnlyAtLineStart)&&(b=B.match(O.regex),b)){v=b[0],w=O.action;break}}if(b||(b=[""],v=""),w||(c<l&&(b=[a.charAt(c)],v=b[0]),w=this._lexer.defaultToken),v===null)break;for(c+=v.length;xH(w)&&OE(w)&&w.test;)w=w.test(v,b,C,c===l);let L=null;if(typeof w=="string"||Array.isArray(w))L=w;else if(w.group)L=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?L=Ba(this._lexer,w.token,v,b,C):L=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!d)throw pt(this._lexer,"cannot pop embedded mode if not inside one");d=null}else{if(d)throw pt(this._lexer,"cannot enter embedded mode from within an embedded mode");k=Ba(this._lexer,w.nextEmbedded,v,b,C)}if(w.goBack&&(c=Math.max(0,c-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let N=Ba(this._lexer,w.switchTo,v,b,C);if(N[0]==="@"&&(N=N.substr(1)),wm(this._lexer,N))h=h.switchTo(N);else throw pt(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(y))}else{if(w.transform&&typeof w.transform=="function")throw pt(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(h.depth>=this._lexer.maxStack)throw pt(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(C)}else if(w.next==="@pop"){if(h.depth<=1)throw pt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));h=h.pop()}else if(w.next==="@popall")h=h.popall();else{let N=Ba(this._lexer,w.next,v,b,C);if(N[0]==="@"&&(N=N.substr(1)),wm(this._lexer,N))h=h.push(N);else throw pt(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&kH(this._lexer,this._lexer.languageId+": "+Ba(this._lexer,w.log,v,b,C))}if(L===null)throw pt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const D=N=>{let B=this._modeService.getModeIdForLanguageName(N);B&&(N=B);const O=this._getNestedEmbeddedModeData(N);if(c<l){const $=e.substr(c);return this._nestedTokenize($,t,Wa.create(h,O),n+c,o)}else return Wa.create(h,O)};if(Array.isArray(L)){if(u&&u.groups.length>0)throw pt(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==L.length+1)throw pt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let N=0;for(let B=1;B<b.length;B++)N+=b[B].length;if(N!==v.length)throw pt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(y));u={rule:y,matches:b,groups:[]};for(let B=0;B<L.length;B++)u.groups[B]={action:L[B],matched:b[B+1]};c-=v.length;continue}else{if(L==="@rematch"&&(c-=v.length,v="",b=null,L="",k!==null))return D(k);if(v.length===0){if(l===0||m!==h.depth||C!==h.state||(u?u.groups.length:0)!==_)continue;throw pt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(y))}let N=null;if(jM(L)&&L.indexOf("@brackets")===0){let B=L.substr(9),O=NH(this._lexer,v);if(!O)throw pt(this._lexer,"@brackets token returned but no bracket defined as: "+v);N=PE(O.token+B)}else{let B=L===""?"":L+this._lexer.tokenPostfix;N=PE(B)}g<r&&o.emit(g+n,N)}if(k!==null)return D(k)}return Wa.create(h,d)}_getNestedEmbeddedModeData(e){let t=this._locateMode(e);if(t){let i=Rt.get(t);if(i)return new $f(t,i.getInitialState())}return new $f(t||dl,Op)}_locateMode(e){if(!e||!this._modeService.isRegisteredMode(e))return null;if(e===this._languageId)return e;const t=this._modeService.getModeId(e);return t&&(this._modeService.triggerMode(t),this._embeddedModes[t]=!0),t}}function NH(s,e){if(!e)return null;e=Xa(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 TH(s,e,t,i){return new av(s,e,t,i)}var a0;const l0=(a0=window.trustedTypes)===null||a0===void 0?void 0:a0.createPolicy("standaloneColorizer",{createHTML:s=>s});class Sx{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 h;const c=(h=l0==null?void 0:l0.createHTML(d))!==null&&h!==void 0?h:d;i.innerHTML=c};return this.colorize(t,a||"",r,n).then(l,d=>console.error(d))}static colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),nx(t)&&(t=t.substr(1));let a=cr(t),l=e.getModeId(i);if(!l)return Promise.resolve(FE(a,r,o));e.triggerMode(l);const d=Rt.get(l);if(d)return d0(a,r,d,o);const h=Rt.getPromise(l);return h?new Promise((c,u)=>{h.then(f=>{d0(a,r,f,o).then(c,u)},u)}):new Promise((c,u)=>{let f=null,g=null;const m=()=>{f&&(f.dispose(),f=null),g&&(g.dispose(),g=null);const _=Rt.get(l);if(_){d0(a,r,_,o).then(c,u);return}c(FE(a,r,o))};g=new hn,g.cancelAndSet(m,500),f=Rt.onDidChange(_=>{_.changedLanguages.indexOf(l)>=0&&m()})})}static colorizeLine(e,t,i,n,o=4){const r=Jn.isBasicASCII(e,t),a=Jn.containsRTL(e,r,i);return rv(new wh(!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 d0(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=AH(s,e,t,i);if(t instanceof av){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}n(a)};r()})}function FE(s,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=16793600;for(let r=0,a=s.length;r<a;r++){let l=s[r];o[0]=l.length;const d=new yi(o,l,t),h=Jn.isBasicASCII(l,!0),c=Jn.containsRTL(l,h,!0);let u=rv(new wh(!1,!0,l,!1,h,c,0,d,[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(u.html),i.push("<br/>")}return i.join("")}function AH(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r<a;r++){let l=s[r],d=t.tokenize2(l,!0,o,0);yi.convertToEndOffset(d.tokens,l.length);let h=new yi(d.tokens,l,i);const c=Jn.isBasicASCII(l,!0),u=Jn.containsRTL(l,c,!0);let f=rv(new wh(!1,!0,l,!1,c,u,0,h.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(f.html),n.push("<br/>"),o=d.endState}return n.join("")}var Ig;(function(s){s[s.Ignore=0]="Ignore",s[s.Info=1]="Info",s[s.Warning=2]="Warning",s[s.Error=3]="Error"})(Ig||(Ig={}));(function(s){const e="error",t="warning",i="warn",n="info",o="ignore";function r(l){return l?Lf(e,l)?s.Error:Lf(t,l)||Lf(i,l)?s.Warning:Lf(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})(Ig||(Ig={}));const Wt=Ig;function ur(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Mp.ICodeEditor:!1}function qM(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Mp.IDiffEditor:!1}function GM(s){return ur(s)?s:qM(s)?s.getModifiedEditor():null}const yx=Je("IWorkspaceEditService");function RH(s){return bn(s)&&(!!s.newUri||!!s.oldUri)}function MH(s){return bn(s)&&me.isUri(s.resource)&&bn(s.edit)}class lv{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(MH(t))return new ZM(t.resource,t.edit,t.modelVersionId,t.metadata);if(RH(t))return new OH(t.oldUri,t.newUri,t.options,t.metadata);throw new Error("Unsupported edit")})}}class ZM extends lv{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class OH extends lv{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const PH=Object.prototype.hasOwnProperty;function FH(s,e){for(let t in s)if(PH.call(s,t)&&e({key:t,value:s[t]},function(){delete s[t]})===!1)return}class BH{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 Mb=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))}},YM=Object.hasOwnProperty;class WH{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class VH{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Ur{static readOptions(e){const t=e,i=new VH;for(const n of pc){const o=n.name==="_never_"?void 0:t[n.name];i._write(n.id,o)}return i}static validateOptions(e){const t=new PB;for(const i of pc)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new WH;for(const n of pc)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)?zs(e,t):!1;for(let i in e)if(!Ur._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of pc){const r=!Ur._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new xR(i):null}}function HH(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 _={};_.method="showMethods",_.function="showFunctions",_.constructor="showConstructors",_.deprecated="showDeprecated",_.field="showFields",_.variable="showVariables",_.class="showClasses",_.struct="showStructs",_.interface="showInterfaces",_.module="showModules",_.property="showProperties",_.event="showEvents",_.operator="showOperators",_.unit="showUnits",_.value="showValues",_.constant="showConstants",_.enum="showEnums",_.enumMember="showEnumMembers",_.keyword="showKeywords",_.text="showWords",_.color="showColors",_.file="showFiles",_.reference="showReferences",_.folder="showFolders",_.typeParameter="showTypeParameters",_.snippet="showSnippets",FH(_,C=>{const b=d.filteredTypes[C.key];b===!1&&(d[C.value]=b)})}const h=s.hover;h===!0?s.hover={enabled:!0}:h===!1&&(s.hover={enabled:!1});const c=s.parameterHints;c===!0?s.parameterHints={enabled:!0}:c===!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");const{renderIndentGuides:g,highlightActiveIndentGuide:m}=s;s.guides||(s.guides={}),g!==void 0&&(s.guides.indentation=!!g),m!==void 0&&(s.guides.highlightActiveIndentation=!!m)}function BE(s){const e=Fa(s);return HH(e),e}class Ob extends H{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 kR,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=BE(t),this._readOptions=Ur.readOptions(this._rawOptions),this._validatedOptions=Ur.validateOptions(this._readOptions),this._register(fa.onDidChangeZoomLevel(i=>this._recomputeOptions())),this._register(Mb.onDidChangeTabFocus(i=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(!e)this.options=t;else{const i=Ur.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=wd.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:Mb.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return Ur.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(YM.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!zs(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=BE(e);Ob._subsetEquals(this._rawOptions,t)||(this._rawOptions=xo(this._rawOptions,t||{}),this._readOptions=Ur.readOptions(this._rawOptions),this._validatedOptions=Ur.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=Ob._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 zH=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),UH=Xt.as(Ch.Configuration),Pb=Object.assign(Object.assign({},zH),{properties:{"editor.tabSize":{type:"number",default:Gi.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:Gi.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:Gi.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:Gi.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Gi.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")},"editor.language.brackets":{type:"array",default:!1,description:p("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:p("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:p("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"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 $H(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of pc){const e=s.schema;if(typeof e<"u")if($H(e))Pb.properties[`editor.${s.name}`]=e;else for(let t in e)YM.call(e,t)&&(Pb.properties[t]=e[t])}let Sm=null;function XM(){return Sm===null&&(Sm=Object.create(null),Object.keys(Pb.properties).forEach(s=>{Sm[s]=!0})),Sm}function jH(s){return XM()[`editor.${s}`]||!1}function KH(s){return XM()[`diffEditor.${s}`]||!1}UH.registerConfiguration(Pb);class Ut{static insert(e,t){return{range:new S(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}}}class as{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1,this.overrideConfigurations=new Map}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?EV(this.contents,e):this.contents}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=Fa(this.contents),i=Fa(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=>zs(l.identifiers,r.identifiers));a?this.mergeContents(a.contents,r.contents):i.push(Fa(r))}for(const r of o.keys)n.indexOf(r)===-1&&n.push(r)}return new as(t,n,i)}freeze(){return this.isFrozen=!0,this}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;let i={};for(const n of Tb([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n],r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=Fa(o),this.mergeContents(o,r)):o=r),i[n]=o}return new as(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&bn(e[i])&&bn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Fa(t[i])}}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?hW(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),gx(this.contents,e,t,i=>{throw new Error(i)})}removeValue(e){this.removeKey(e)&&IV(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 qH extends as{constructor(){const e=TV(),t=NV(),i=[];for(const n of Object.keys(e))fx.test(n)&&i.push({identifiers:[DV(n).trim()],keys:Object.keys(e[n]),contents:NM(e[n],o=>console.error(`Conflict in default settings file: ${o}`))});super(e,t,i)}}let QM=class JM{constructor(e,t,i=new as,n=new as,o=new Zi,r=new as,a=new Zi,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 Zi,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 as,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(me.revive(a[0]),this.parseConfigurationModel(a[1])),r),new Zi);return new JM(t,i,new as,n,o,new as,new Zi,!1)}static parseConfigurationModel(e){return new as(e.contents,e.keys,e.overrides).freeze()}};class GH{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 as;this.affectedKeys.forEach(a=>r.setValue(a,{})),this.affectedKeysTree=r.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=QM.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!po(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i=NM({[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 ZH=/^(cursor|delete)/;class YH extends H{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 Ap,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=vc.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new hn,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:he.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();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=vc.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=vc.EMPTY,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===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getParts();return this._ignoreSingleModifiers=new vc(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),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[h]=e.getSingleModifierDispatchParts();o=h,r=h}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,h=>this._notificationService.warn(h)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,h=>this._notificationService.warn(h)),ZH.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 vc{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}vc.EMPTY=new vc(null);let dv=AB||"";const zi=new Map;zi.set("false",!1);zi.set("true",!0);zi.set("isMac",Me);zi.set("isLinux",Cn);zi.set("isWindows",Ai);zi.set("isWeb",Nu);zi.set("isMacNative",Me&&!Nu);zi.set("isEdge",dv.indexOf("Edg/")>=0);zi.set("isFirefox",dv.indexOf("Firefox")>=0);zi.set("isChrome",dv.indexOf("Chrome")>=0);zi.set("isSafari",dv.indexOf("Safari")>=0);const XH=Object.prototype.hasOwnProperty;class te{static has(e){return hl.create(e)}static equals(e,t){return tu.create(e,t)}static regex(e,t){return Fb.create(e,t)}static not(e){return zd.create(e)}static and(...e){return Ua.create(e,null)}static or(...e){return ta.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return ta.create(i.map(n=>this._deserializeAndExpression(n,t)),null,!0)}static _deserializeAndExpression(e,t){let i=e.split("&&");return Ua.create(i.map(n=>this._deserializeOne(n,t)),null)}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return hv.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return tu.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return Fb.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let i=e.split(" in ");return Lx.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const i=e.split(">=");return fv.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const i=e.split(">");return uv.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const i=e.split("<=");return pv.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const i=e.split("<");return gv.create(i[0].trim(),i[1].trim())}return/^\!\s*/.test(e)?zd.create(e.substr(1).trim()):hl.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(eM(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 QH(s,e){const t=s?s.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function Pc(s,e){return s.cmp(e)}class es{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Cs.INSTANCE}}es.INSTANCE=new es;class Cs{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return es.INSTANCE}}Cs.INSTANCE=new Cs;class hl{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const i=zi.get(e);return typeof i=="boolean"?i?Cs.INSTANCE:es.INSTANCE:new hl(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:tO(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=zi.get(this.key);return typeof e=="boolean"?e?Cs.INSTANCE:es.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=zd.create(this.key,this)),this.negated}}class tu{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}static create(e,t,i=null){if(typeof t=="boolean")return t?hl.create(e,i):zd.create(e,i);const n=zi.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Cs.INSTANCE:es.INSTANCE:new tu(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=zi.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Cs.INSTANCE:es.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hv.create(this.key,this.value,this)),this.negated}}class Lx{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new Lx(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:typeof i=="string"&&typeof t=="object"&&t!==null?XH.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=Dx.create(this)),this.negated}}class Dx{constructor(e){this._actual=e,this.type=11}static create(e){return new Dx(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}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class hv{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}static create(e,t,i=null){if(typeof t=="boolean")return t?zd.create(e,i):hl.create(e,i);const n=zi.get(e);return typeof n=="boolean"?t===(n?"true":"false")?es.INSTANCE:Cs.INSTANCE:new hv(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=zi.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?es.INSTANCE:Cs.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tu.create(this.key,this.value,this)),this.negated}}class zd{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const i=zi.get(e);return typeof i=="boolean"?i?es.INSTANCE:Cs.INSTANCE:new zd(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:tO(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=zi.get(this.key);return typeof e=="boolean"?e?es.INSTANCE:Cs.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hl.create(this.key,this)),this.negated}}function cv(s,e){if(typeof s=="string"){const t=parseFloat(s);isNaN(t)||(s=t)}return typeof s=="string"||typeof s=="number"?e(s):es.INSTANCE}class uv{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}static create(e,t,i=null){return cv(t,n=>new uv(e,n,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=pv.create(this.key,this.value,this)),this.negated}}class fv{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}static create(e,t,i=null){return cv(t,n=>new fv(e,n,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=gv.create(this.key,this.value,this)),this.negated}}class gv{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}static create(e,t,i=null){return cv(t,n=>new gv(e,n,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=fv.create(this.key,this.value,this)),this.negated}}class pv{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}static create(e,t,i=null){return cv(t,n=>new pv(e,n,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sh(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uv.create(this.key,this.value,this)),this.negated}}class Fb{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new Fb(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}substituteConstants(){return this}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 this.negated||(this.negated=xx.create(this)),this.negated}}class xx{constructor(e){this._actual=e,this.type=8}static create(e){return new xx(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}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function eO(s){let e=null;for(let t=0,i=s.length;t<i;t++){const n=s[t].substituteConstants();if(s[t]!==n&&e===null){e=[];for(let o=0;o<t;o++)e[o]=s[o]}e!==null&&(e[t]=n)}return e===null?s:e}class Ua{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return Ua._normalizeArr(e,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=Pc(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}substituteConstants(){const e=eO(this.expr);return e===this.expr?this:Ua.create(e,this.negated)}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,t){const i=[];let n=!1;for(const o of e)if(o){if(o.type===1){n=!0;continue}if(o.type===0)return es.INSTANCE;if(o.type===6){i.push(...o.expr);continue}i.push(o)}if(i.length===0&&n)return Cs.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(Pc);for(let o=1;o<i.length;o++)i[o-1].equals(i[o])&&(i.splice(o,1),o--);if(i.length===1)return i[0];for(;i.length>1;){const o=i[i.length-1];if(o.type!==9)break;i.pop();const r=i.pop(),a=i.length===0,l=ta.create(o.expr.map(d=>Ua.create([d,r],null)),null,a);l&&(i.push(l),i.sort(Pc))}return i.length===1?i[0]:new Ua(i,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(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=ta.create(e,this,!0)}return this.negated}}class ta{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,i){return ta._normalizeArr(e,t,i)}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=Pc(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}substituteConstants(){const e=eO(this.expr);return e===this.expr?this:ta.create(e,this.negated,!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,t,i){let n=[],o=!1;if(e){for(let r=0,a=e.length;r<a;r++){const l=e[r];if(l){if(l.type===0){o=!0;continue}if(l.type===1)return Cs.INSTANCE;if(l.type===9){n=n.concat(l.expr);continue}n.push(l)}}if(n.length===0&&o)return es.INSTANCE;n.sort(Pc)}if(n.length!==0){if(n.length===1)return n[0];for(let r=1;r<n.length;r++)n[r-1].equals(n[r])&&(n.splice(r,1),r--);if(n.length===1)return n[0];if(i){for(let r=0;r<n.length;r++)for(let a=r+1;a<n.length;a++)iO(n[r],n[a])&&(n.splice(a,1),a--);if(n.length===1)return n[0]}return new ta(n,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(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const r of Bb(t))for(const a of Bb(i))n.push(Ua.create([r,a],null));const o=e.length===0;e.unshift(ta.create(n,null,o))}this.negated=e[0]}return this.negated}}class re extends hl{constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?re._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&re._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}static all(){return re._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return tu.create(this.key,e)}}re._info=[];const ve=Je("contextKeyService"),JH="setContext";function tO(s,e){return s<e?-1:s>e?1:0}function Sh(s,e,t,i){return s<t?-1:s>t?1:e<i?-1:e>i?1:0}function iO(s,e){if(e.type===6&&s.type!==9&&s.type!==6){for(const n of e.expr)if(s.equals(n))return!0}const t=s.negate(),i=Bb(t).concat(Bb(e));i.sort(Pc);for(let n=0;n<i.length;n++){const r=i[n].negate();for(let a=n+1;a<i.length;a++){const l=i[a];if(r.equals(l))return!0}}return!1}function Bb(s){return s.type===9?s.expr:[s]}class Fc{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=Fc.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||!QH(o,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]||Fc.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:iO(e,t)}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: ${WE(o.when)}, source: ${VE(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${WE(o.when)}, source: ${VE(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(Fc.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function WE(s){return s?`${s.serialize()}`:"no when condition"}function VE(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}class Wb{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Ms===1){if(e&&e.win)return e.win}else if(Ms===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Wb.bindToCurrentPlatform(e);if(t&&t.primary){const i=F1(t.primary,Ms);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=F1(o,Ms);r&&this._registerDefaultKeybinding(r,e.id,e.args,e.weight,-i-1,e.when)}}registerCommandAndKeybindingRule(e){this.registerKeybindingRule(e),$e.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&&Wb._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){Ms===1&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,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(t8)),this._cachedMergedKeybindings.slice(0)}}const cn=new Wb,e8={EditorModes:"platform.keybindingsRegistry"};Xt.add(e8.EditorModes,cn);function t8(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 HE{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?cy(e.getDispatchParts()):[],e&&this.keypressParts.length===0&&(this.keypressParts=cy(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 cy(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 kx{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]=s8(a,l,this.modifierLabels[e])}return n.join(" ")}}const Ix=new kx({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:p({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:p({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:p({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:p({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:p({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:p({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:p({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:p({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),i8=new kx({ctrlKey:p({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:p({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:p({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:p({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:p({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:p({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:p({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:p({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:p({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:p({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:p({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:p({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),n8=new kx({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function s8(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 o8 extends G5{constructor(e,t){if(super(),t.length===0)throw fo("parts");this._os=e,this._parts=t}getLabel(){return Ix.toLabel(this._os,this._parts,e=>this._getLabel(e))}getAriaLabel(){return i8.toLabel(this._os,this._parts,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._parts.length>1||this._parts[0].isDuplicateModifierCase()?null:n8.toLabel(this._os,this._parts,e=>this._getElectronAccelerator(e))}isChord(){return this._parts.length>1}getParts(){return this._parts.map(e=>this._getPart(e))}_getPart(e){return new q5(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 Eg extends o8{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 hd.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":hd.toString(e.keyCode)}_getElectronAccelerator(e){return hd.toElectronAccelerator(e.keyCode)}_getDispatchPart(e){return Eg.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+=hd.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}static _scanCodeToKeyCode(e){const t=UD[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _resolveSimpleUserBinding(e){if(!e)return null;if(e instanceof Fd)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Fd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveUserBinding(e,t){const i=cy(e.map(n=>this._resolveSimpleUserBinding(n)));return i.length>0?[new Eg(new hb(i),t)]:[]}}const ni=Je("notificationService");class r8{}const nO=Je("contextService");class a8{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 Jt;(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")})(Jt||(Jt={}));var uy;(function(s){s.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(uy||(uy={}));var Vb;(function(s){s.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(Vb||(Vb={}));var fy;(function(s){s.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(fy||(fy={}));var Hb;(function(s){s.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),s.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(Hb||(Hb={}));var Ng;(function(s){s.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),s.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(Ng||(Ng={}));var zb;(function(s){s.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),s.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(zb||(zb={}));var gy;(function(s){s.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(gy||(gy={}));var py;(function(s){s.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(py||(py={}));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},oO=function(s,e){return function(t,i){e(t,i,s)}},rO=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class l8{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 d8(s,e,t){return ur(s)?e(s):t(s)}let my=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=d8(this.editor,i=>this.findModel(i,e),i=>this.findModel(i.getOriginalEditor(),e)||this.findModel(i.getModifiedEditor(),e))),t?Promise.resolve(new S5(new l8(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}};my=sO([oO(0,ri)],my);class mv{show(){return mv.NULL_PROGRESS_RUNNER}showWhile(e,t){return rO(this,void 0,void 0,function*(){yield e})}}mv.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class h8{confirm(e){return this.doConfirm(e).then(t=>({confirmed:t,checkboxChecked:!1}))}doConfirm(e){let t=e.message;return e.detail&&(t=t+`
  9. `+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class _v{info(e){return this.notify({severity:Wt.Info,message:e})}warn(e){return this.notify({severity:Wt.Warning,message:e})}error(e){return this.notify({severity:Wt.Error,message:e})}notify(e){switch(e.severity){case Wt.Error:console.error(e.message);break;case Wt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return _v.NO_OP}status(e,t){return H.None}}_v.NO_OP=new r8;class c8{constructor(e){this._onWillExecuteCommand=new M,this._onDidExecuteCommand=new M,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=$e.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 aO extends YH{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(q(r,ue.KEY_DOWN,a=>{const l=new Ot(a);this._dispatch(l,l.target)&&(l.preventDefault(),l.stopPropagation())})),this._register(q(window,ue.KEY_UP,a=>{const l=new Ot(a);this._singleModifierDispatch(l,l.target)&&l.preventDefault()}))}addDynamicKeybinding(e,t,i,n){const o=F1(t,Ms),r=new X;return o&&(this._dynamicKeybindings.push({keybinding:o.parts,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(Ve(()=>{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($e.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(cn.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Fc(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 HE(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=Eg.resolveUserBinding(a,Ms);for(const d of l)i[n++]=new HE(d,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){let t=new Fd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Eg(t,Ms)}}function zE(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof me)}class lO{constructor(){this._onDidChangeConfiguration=new M,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new QM(new qH,new as)}getValue(e,t){const i=typeof e=="string"?e:void 0,n=zE(e)?e:zE(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 GH({keys:i,overrides:[]},t,this._configuration);n.source=7,n.sourceConfig=null,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}}class u8{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=(F.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 _y=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Cn||Me?`
  10. `:`\r
  11. `}};_y=sO([oO(0,Vt)],_y);class f8{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class bv{constructor(){const e=me.from({scheme:bv.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new a8({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}bv.SCHEME="inmemory";function Ub(s,e,t){if(!e||!(s instanceof lO))return;let i=[];Object.keys(e).forEach(n=>{jH(n)&&i.push([`editor.${n}`,e[n]]),t&&KH(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}class g8{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return rO(this,void 0,void 0,function*(){const i=new Map;for(let r of e){if(!(r instanceof ZM))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(Ut.replaceMove(S.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:Vi(py.bulkEditServiceSummary,n,o)}})}}class p8{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}}class m8{constructor(e,t){this._codeEditorService=e,this._container=t,this.onDidLayout=he.None}get dimension(){return this._dimension||(this._dimension=qC(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}}const UE=2e4;let ed,x_,by,k_,Cy;function _8(s){ed=document.createElement("div"),ed.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"),ed.appendChild(i),i};x_=e(),by=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"),ed.appendChild(i),i};k_=t(),Cy=t(),s.appendChild(ed)}function Ei(s){ed&&(x_.textContent!==s?(Li(by),jb(x_,s)):(Li(x_),jb(by,s)))}function $b(s){ed&&(Me?Ei(s):k_.textContent!==s?(Li(Cy),jb(k_,s)):(Li(k_),jb(Cy,s)))}function jb(s,e){Li(s),e.length>UE&&(e=e.substr(0,UE)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const Ex=Je("markerDecorationsService");var Kb=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Us extends H{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._enabled=!0,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 Kb(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class iu extends H{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 Kb(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 Kb(this,void 0,void 0,function*(){yield e.run(t)})}}class $s extends Us{constructor(e){super($s.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}$s.ID="vs.actions.separator";class Cv{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 Kb(this,void 0,void 0,function*(){})}}class vv extends Us{constructor(){super(vv.ID,p("submenu.empty","(empty)"),void 0,!1)}}vv.ID="vs.actions.empty";var gs;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST="hc"})(gs||(gs={}));const Dt=Je("themeService");var vy;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(vy||(vy={}));function $t(s){return{id:s}}var kt;(function(s){function e(a){return a&&typeof a=="object"&&typeof a.id=="string"&&(typeof a.color>"u"||vy.isThemeColor(a.color))}s.isThemeIcon=e;const t=new RegExp(`^\\$\\((${En.iconNameExpression}(?:${En.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 h=d.lastIndexOf("~");return h!==-1&&(d=d.substring(0,h)),l&&(d=`${d}~${l}`),{id:d}}s.modify=n;function o(a,l){var d,h;return a.id===l.id&&((d=a.color)===null||d===void 0?void 0:d.id)===((h=l.color)===null||h===void 0?void 0:h.id)}s.isEqual=o;function r(a,l){return{id:a.id,color:l?$t(l):void 0}}s.asThemeIcon=r,s.asClassNameArray=En.asClassNameArray,s.asClassName=En.asClassName,s.asCSSSelector=En.asCSSSelector})(kt||(kt={}));function qb(s){switch(s){case gs.DARK:return"vs-dark";case gs.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const dO={ThemingContribution:"base.contributions.theming"};class b8{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new M}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ve(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let hO=new b8;Xt.add(dO.ThemingContribution,hO);function st(s){return hO.onColorThemeChange(s)}class C8 extends H{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 v8=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},$E=function(s,e){return function(t,i){e(t,i,s)}};function Df(s){return s.command!==void 0}class ae{constructor(e){this.id=ae._idPool++,this._debugName=e}}ae._idPool=0;ae.CommandPalette=new ae("CommandPalette");ae.EditorContext=new ae("EditorContext");ae.SimpleEditorContext=new ae("SimpleEditorContext");ae.EditorContextCopy=new ae("EditorContextCopy");ae.EditorContextPeek=new ae("EditorContextPeek");ae.MenubarEditMenu=new ae("MenubarEditMenu");ae.MenubarCopy=new ae("MenubarCopy");ae.MenubarGoMenu=new ae("MenubarGoMenu");ae.MenubarSelectionMenu=new ae("MenubarSelectionMenu");ae.InlineCompletionsActions=new ae("InlineCompletionsActions");const yh=Je("menuService"),ps=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===ae.CommandPalette}}addCommand(s){return this.addCommands(Ue.single(s))}addCommands(s){for(const e of s)this._commands.set(e.id,e);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Ve(()=>{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(Ue.single({id:s,item:e}))}appendMenuItems(s){const e=new Set,t=new jn;for(const{id:i,item:n}of s){let o=this._menuItems.get(i);o||(o=new jn,this._menuItems.set(i,o)),t.push(o.push(n)),e.add(i)}return this._onDidChangeMenu.fire(e),Ve(()=>{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===ae.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)Df(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 Nx extends Cv{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 $s));return e.length&&e.pop(),e}}let Ud=class cO{constructor(e,t,i,n,o){var r,a;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=(a=typeof e.tooltip=="string"?e.tooltip:(r=e.tooltip)===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"",this.enabled=!e.precondition||n.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=n.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}this.item=e,this.alt=t?new cO(t,void 0,i,n,o):void 0,this._options=i,kt.isThemeIcon(e.icon)&&(this.class=En.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)}};Ud=v8([$E(3,ve),$E(4,Yt)],Ud);const El=Je("telemetryService");class wv{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=te.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};cn.registerKeybindingRule(n)}}$e.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){ps.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 Mu extends wv{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(Cr);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);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}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class uO extends wv{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class Mi extends wv{static bindToContribution(e){return class extends Mi{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(tt),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext(o=>{if(o.get(ve).contextMatchesRules(Kn(this.precondition)))return this.runEditorCommand(o,n,t)})}}class oe extends Mi{constructor(e){super(oe.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=ae.EditorContext),n.title||(n.title=e.label),n.when=te.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(El).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class fO extends oe{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 vr(s,e){$e.registerCommand(s,function(t,...i){const[n,o]=i;ut(me.isUri(n)),ut(F.isIPosition(o));const r=t.get(ri).getModel(n);if(r){const a=F.lift(o);return e(r,a,...i.slice(2))}return t.get(Qn).createModelReference(n).then(a=>new Promise((l,d)=>{try{const h=e(a.object.textEditorModel,F.lift(o),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{a.dispose()}))})}function w8(s,e){$e.registerCommand(s,function(t,...i){const[n]=i;ut(me.isUri(n));const o=t.get(ri).getModel(n);return o?e(o,...i.slice(1)):t.get(Qn).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 J(s){return ds.INSTANCE.registerEditorCommand(s),s}function ee(s){const e=new s;return ds.INSTANCE.registerEditorAction(e),e}function gO(s){return ds.INSTANCE.registerEditorAction(s),s}function pO(s){ds.INSTANCE.registerEditorAction(s)}function nt(s,e){ds.INSTANCE.registerEditorContribution(s,e)}var Bc;(function(s){function e(r){return ds.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return ds.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return ds.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return ds.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return ds.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(Bc||(Bc={}));const S8={EditorCommonContributions:"editor.contributions"};class ds{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}}ds.INSTANCE=new ds;Xt.add(S8.EditorCommonContributions,ds.INSTANCE);function Fp(s){return s.register(),s}const Tx=Fp(new Mu({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:ae.MenubarEditMenu,group:"1_do",title:p({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:ae.CommandPalette,group:"",title:p("undo","Undo"),order:1}]}));Fp(new uO(Tx,{id:"default:undo",precondition:void 0}));const Ax=Fp(new Mu({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:ae.MenubarEditMenu,group:"1_do",title:p({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:ae.CommandPalette,group:"",title:p("redo","Redo"),order:1}]}));Fp(new uO(Ax,{id:"default:redo",precondition:void 0}));const y8=Fp(new Mu({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:ae.MenubarSelectionMenu,group:"1_basic",title:p({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:ae.CommandPalette,group:"",title:p("selectAll","Select All"),order:1}]}));var L8=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},D8=function(s,e){return function(t,i){e(t,i,s)}};let Tg=class{constructor(e,t){}dispose(){}};Tg.ID="editor.contrib.markerDecorations";Tg=L8([D8(1,Ex)],Tg);nt(Tg.ID,Tg);class x8{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Rx{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=this._bareFontInfo.getMassagedFontFamily(Ws?Hi.fontFamily:null),t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("div");i.style.fontFamily=e,i.style.fontWeight=this._bareFontInfo.fontWeight,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",t.appendChild(i);const n=document.createElement("div");n.style.fontFamily=e,n.style.fontWeight="bold",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",t.appendChild(n);const o=document.createElement("div");o.style.fontFamily=e,o.style.fontWeight=this._bareFontInfo.fontWeight,o.style.fontSize=this._bareFontInfo.fontSize+"px",o.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,o.style.lineHeight=this._bareFontInfo.lineHeight+"px",o.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",o.style.fontStyle="italic",t.appendChild(o);const r=[];for(const a of this._requests){let l;a.type===0&&(l=i),a.type===2&&(l=n),a.type===1&&(l=o),l.appendChild(document.createElement("br"));const d=document.createElement("span");Rx._render(d,a),l.appendChild(d),r.push(d)}this._container=t,this._testElements=r}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 k8(s,e){new Rx(s,e).read()}class mO extends H{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 jE{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 I8(){$d.INSTANCE.clearCache()}class $d extends H{constructor(){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,this._cache=new jE,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new jE,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=$d._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new Y1({zoomLevel:P1(),pixelRatio:lb(),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 x8(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("m",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),h=this.createRequest("3",0,t,i),c=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),_=this.createRequest("9",0,t,i),C=this.createRequest("→",0,t,i),b=this.createRequest("→",0,t,null),v=this.createRequest("·",0,t,i),w=this.createRequest("⸱",0,t,null),y="|/-_ilm%";for(let O=0,$=y.length;O<$;O++)this.createRequest(y.charAt(O),0,t,i),this.createRequest(y.charAt(O),1,t,i),this.createRequest(y.charAt(O),2,t,i);k8(e,t);const k=Math.max(a.width,l.width,d.width,h.width,c.width,u.width,f.width,g.width,m.width,_.width);let L=e.fontFeatureSettings===Hn.OFF;const D=i[0].width;for(let O=1,$=i.length;L&&O<$;O++){const K=D-i[O].width;if(K<-.001||K>.001){L=!1;break}}let N=!0;L&&b.width!==D&&(N=!1),b.width>C.width&&(N=!1);const B=$5()>2e3;return new Y1({zoomLevel:P1(),pixelRatio:lb(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:L,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:N,spaceWidth:r.width,middotWidth:v.width,wsmiddotWidth:w.width,maxDigitWidth:k},B)}}$d.INSTANCE=new $d;class Ui extends Ob{constructor(e,t,i=null,n){super(e,t),this.accessibilityService=n,this._elementSizeObserver=this._register(new mO(i,t.dimension,()=>this._recomputeOptions())),this._register($d.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(WR(o=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(Ws?Hi.fontFamily:null),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(Ws?Hi.fontFamily:null)),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!Ws&&!K5&&(e+="no-user-select "),Ws&&(e+="no-minimap-shadow "),Me&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:Ui._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:vd||rn,pixelRatio:lb(),zoomLevel:P1(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return $d.INSTANCE.readConfiguration(e)}}class _O{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 Ke(s){return new _O(s)}function si(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 E8=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 lt extends H{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(q(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(q(document,"touchend",e=>this.onTouchEnd(e))),this._register(q(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return lt.isTouchDevice()?(lt.INSTANCE||(lt.INSTANCE=new lt),lt.INSTANCE.targets.push(e),{dispose:()=>{lt.INSTANCE.targets=lt.INSTANCE.targets.filter(t=>t!==e)}}):H.None}static ignoreTarget(e){return lt.isTouchDevice()?(lt.INSTANCE||(lt.INSTANCE=new lt),lt.INSTANCE.ignoreTargets.push(e),{dispose:()=>{lt.INSTANCE.ignoreTargets=lt.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):H.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>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<lt.HOLD_DELAY&&Math.abs(a.initialPageX-os(a.rollingPageX))<30&&Math.abs(a.initialPageY-os(a.rollingPageY))<30){let d=this.newGestureEvent(vt.Tap,a.initialTarget);d.pageX=os(a.rollingPageX),d.pageY=os(a.rollingPageY),this.dispatchEvent(d)}else if(l>=lt.HOLD_DELAY&&Math.abs(a.initialPageX-os(a.rollingPageX))<30&&Math.abs(a.initialPageY-os(a.rollingPageY))<30){let d=this.newGestureEvent(vt.Contextmenu,a.initialTarget);d.pageX=os(a.rollingPageX),d.pageY=os(a.rollingPageY),this.dispatchEvent(d)}else if(i===1){let d=os(a.rollingPageX),h=os(a.rollingPageY),c=os(a.rollingTimestamps)-a.rollingTimestamps[0],u=d-a.rollingPageX[0],f=h-a.rollingPageY[0];const g=this.targets.filter(m=>a.initialTarget instanceof Node&&m.contains(a.initialTarget));this.inertia(g,t,Math.abs(u)/c,u>0?1:-1,d,Math.abs(f)/c,f>0?1:-1,h)}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>lt.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=hr(()=>{let d=Date.now(),h=d-t,c=0,u=0,f=!0;i+=lt.SCROLL_FRICTION*h,r+=lt.SCROLL_FRICTION*h,i>0&&(f=!1,c=n*i*h),r>0&&(f=!1,u=a*r*h);let g=this.newGestureEvent(vt.Change);g.translationX=c,g.translationY=u,e.forEach(m=>m.dispatchEvent(g)),f||this.inertia(e,d,i,n,o+c,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-os(r.rollingPageX),a.translationY=o.pageY-os(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)}}lt.SCROLL_FRICTION=-.005;lt.HOLD_DELAY=700;lt.CLEAR_TAP_COUNT_TIME=400;E8([si],lt,"isTouchDevice",null);function Ou(s,e){let t=new cs(e);return t.preventDefault(),{leftButton:t.leftButton,buttons:t.buttons,posx:t.posx,posy:t.posy}}class Lh{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=W1.getSameOriginWindowChain(),a=lr?"pointermove":"mousemove",l="mouseup",d=r.map(c=>c.window.document),h=bh(e);h&&d.unshift(h);for(const c of d)this._hooks.add(YD(c,a,u=>{if(u.buttons!==t){this.stopMonitoring(!0);return}this._mouseMoveCallback(u)},(u,f)=>this._mouseMoveEventMerger(u,f))),this._hooks.add(q(c,l,u=>this.stopMonitoring(!0)));if(W1.hasDifferentOriginAncestor()){let c=r[r.length-1];this._hooks.add(q(c.window.document,"mouseout",u=>{new cs(u).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(q(c.window.document,"mouseover",u=>{new cs(u).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(q(c.window.document.body,"mouseleave",u=>{this.stopMonitoring(!0)}))}}}class Mx{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new bO(this.x-na.scrollX,this.y-na.scrollY)}}class bO{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new Mx(this.clientX+na.scrollX,this.clientY+na.scrollY)}}class N8{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}function CO(s){const e=Ii(s);return new N8(e.left,e.top,e.width,e.height)}class jd extends cs{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new Mx(this.posx,this.posy),this.editorPos=CO(t)}}class T8{constructor(e){this._editorViewDomNode=e}_create(e){return new jd(e,this._editorViewDomNode)}onContextMenu(e,t){return q(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return q(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return q(e,"mousedown",i=>{t(this._create(i))})}onMouseLeave(e,t){return ZD(e,i=>{t(this._create(i))})}onMouseMoveThrottled(e,t,i,n){return YD(e,"mousemove",t,(r,a)=>i(r,this._create(a)),n)}}class A8{constructor(e){this._editorViewDomNode=e}_create(e){return new jd(e,this._editorViewDomNode)}onPointerUp(e,t){return q(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return q(e,"pointerdown",i=>{t(this._create(i))})}onPointerLeave(e,t){return l3(e,i=>{t(this._create(i))})}onPointerMoveThrottled(e,t,i,n){return YD(e,"pointermove",t,(r,a)=>i(r,this._create(a)),n)}}class R8 extends H{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new Lh),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=ii(document,"keydown",a=>{a.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,a.browserEvent)},!0);const r=(a,l)=>i(a,new jd(l,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,r,n,a=>{this._keydownListener.dispose(),o(a)})}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class Bp extends H{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 ws extends Bp{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class fr{static write(e,t){e instanceof _O,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 M8{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 O8 extends M8{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 P8{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class Sv{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const o=e[i];t[i]=new Sv(o.left,o.width)}return t}toString(){return`[${this.left},${this.width}]`}}class Wc{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 F8{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class B8{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class h0{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 e;e.sort(Wc.compare);let t=[],i=0,n=e[0];for(let o=1,r=e.length;o<r;o++){const a=e[o];n.left+n.width+.9>=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,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 Wc(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 h=e.children[t].firstChild,c=e.children[n].firstChild;if((!h||!c)&&(!h&&i===0&&t>0&&(h=e.children[t-1].firstChild,i=1073741824),!c&&o===0&&n>0&&(c=e.children[n-1].firstChild,o=1073741824)),!h||!c)return null;i=Math.min(h.textContent.length,Math.max(0,i)),o=Math.min(c.textContent.length,Math.max(0,o));const u=this._readClientRects(h,i,c,o,a);return this._createHorizontalRangesFromClientRects(u,r)}}const W8=function(){return uo?!0:!(Cn||rn||Ws)}();let Vc=!0;class KE{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 qE{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(43);this.renderWhitespace=i.get(87),this.renderControlCharacters=i.get(82),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(58),this.stopRenderingLineAfter=i.get(104),this.fontLigatures=i.get(44)}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 Xo{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=Ke(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===gs.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=qn.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(r.themeType===gs.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===gs.HIGH_CONTRAST||this._options.renderWhitespace!=="selection"?a.push(new qn(g,m,"inline-selected-text",0)):(l||(l=[]),l.push(new cH(g-1,m-1))))}}const d=new wh(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!==Hn.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(Xo.CLASS_NAME),n.appendASCIIString('">');const h=ov(d,n);n.appendASCIIString("</div>");let c=null;return Vc&&W8&&o.isBasicASCII&&r.useMonospaceOptimizations&&h.containsForeignElements===0&&o.content.length<300&&d.lineTokens.getCount()<100&&(c=new ym(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),c||(c=wO(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=c,!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 ym:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof ym?this._renderedViewLine.monospaceAssumptionsAreValid():Vc}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof ym&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=t|0,i=i|0,t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter|0;let r=!1;o!==-1&&t>o+1&&i>o+1&&(r=!0),o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const a=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return a&&a.length>0?new B8(r,a):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}Xo.CLASS_NAME="view-line";class ym{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return Vc;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!"),Vc=!1),Vc}toSlowRenderedLine(){return wO(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getCharPosition(t),r=this._getCharPosition(i);return[new Wc(o,r-o)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return 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 vx(o,i),n)}}class vO{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 Float32Array(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,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new Wc(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new Wc(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth();const o=this._getReadingTarget(e);return o.firstChild?o.firstChild.offsetWidth:0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const l=h0.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.endNode);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth();const o=this._characterMapping.getDomPosition(i),r=h0.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.endNode);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getAbsoluteOffset(i),d=Math.round(this.input.spaceWidth*l);if(Math.abs(d-a)<=1)return d}return a}_readRawVisibleRangesForRange(e,t,i,n){if(t===1&&i===this._characterMapping.length)return[new Wc(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return h0.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 vx(o,i),n)}}class V8 extends vO{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const l=r[r.length-1];l.left<a&&(l.width=a-l.left)}}return r}}const wO=function(){return vd?H8:z8}();function H8(s,e,t,i,n){return new V8(s,e,t,i,n)}function z8(s,e,t,i,n){return new vO(s,e,t,i,n)}function Lm(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class ki{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} "${Lm(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Lm(this.oldText)}")`:`(replace@${this.oldPosition} "${Lm(this.oldText)}" with "${Lm(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Js(e,n,i),i+=4;for(let o=0;o<n;o++)G3(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Qs(e,t);return t+=4,ty(e,t,i)}writeSize(){return 8+ki._writeStringSize(this.oldText)+ki._writeStringSize(this.newText)}write(e,t){return Js(e,this.oldPosition,t),t+=4,Js(e,this.newPosition,t),t+=4,t=ki._writeString(e,this.oldText,t),t=ki._writeString(e,this.newText,t),t}static read(e,t,i){const n=Qs(e,t);t+=4;const o=Qs(e,t);t+=4;const r=ki._readString(e,t);t+=ki._writeStringSize(r);const a=ki._readString(e,t);return t+=ki._writeStringSize(a),i.push(new ki(n,r,o,a)),t}}function U8(s,e){return s===null||s.length===0?e:new zo(s,e).compress()}class zo{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,h]=zo._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(d),n=h;continue}if(i.newPosition<n.oldPosition){const[d,h]=zo._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(d),i=h;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,h]=zo._splitPrev(i,n.oldLength);a=d,l=n,i=h,n=this._getCurr(++t)}else{const[d,h]=zo._splitCurr(n,i.newLength);a=i,l=d,i=this._getPrev(++e),n=h}this._result[this._resultLen++]=new ki(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=zo._merge(this._result);return zo._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=zo._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++]=zo._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 ki(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new ki(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 ki(e.oldPosition,e.oldText,e.newPosition,i),new ki(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new ki(e.oldPosition,i,e.newPosition,e.newText),new ki(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 ki(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 Yh(s){return s.toString()}class di{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=wy(e);return new di(i,i,n,n,t,t,[])}append(e,t,i,n,o){t.length>0&&(this.changes=U8(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(Js(e,t?t.length:0,i),i+=4,t)for(const n of t)Js(e,n.selectionStartLineNumber,i),i+=4,Js(e,n.selectionStartColumn,i),i+=4,Js(e,n.positionLineNumber,i),i+=4,Js(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Qs(e,t);t+=4;for(let o=0;o<n;o++){const r=Qs(e,t);t+=4;const a=Qs(e,t);t+=4;const l=Qs(e,t);t+=4;const d=Qs(e,t);t+=4,i.push(new ne(r,a,l,d))}return t}serialize(){let e=10+di._writeSelectionsSize(this.beforeCursorState)+di._writeSelectionsSize(this.afterCursorState)+4;for(const n of this.changes)e+=n.writeSize();const t=new Uint8Array(e);let i=0;Js(t,this.beforeVersionId,i),i+=4,Js(t,this.afterVersionId,i),i+=4,nE(t,this.beforeEOL,i),i+=1,nE(t,this.afterEOL,i),i+=1,i=di._writeSelections(t,this.beforeCursorState,i),i=di._writeSelections(t,this.afterCursorState,i),Js(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=Qs(t,i);i+=4;const o=Qs(t,i);i+=4;const r=iE(t,i);i+=1;const a=iE(t,i);i+=1;const l=[];i=di._readSelections(t,i,l);const d=[];i=di._readSelections(t,i,d);const h=Qs(t,i);i+=4;const c=[];for(let u=0;u<h;u++)i=ki.read(t,i,c);return new di(n,o,r,a,l,d,c)}}class SO{constructor(e,t){this.model=e,this._data=di.create(e,t)}get type(){return 0}get resource(){return me.isUri(this.model)?this.model:this.model.uri}get label(){return p("edit","Typing")}toString(){return(this._data instanceof di?this._data:di.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(me.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 di}append(e,t,i,n,o){this._data instanceof di&&this._data.append(e,t,i,n,o)}close(){this._data instanceof di&&(this._data=this._data.serialize())}open(){this._data instanceof di||(this._data=di.deserialize(this._data))}undo(){if(me.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof di&&(this._data=this._data.serialize());const e=di.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(me.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof di&&(this._data=this._data.serialize());const e=di.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof di&&(this._data=this._data.serialize()),this._data.byteLength+168}}class $8{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=Yh(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=Yh(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Yh(me.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Yh(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=Yh(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=Yh(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(`${qs(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function wy(s){return s.getEOL()===`
  12. `?0:1}function $r(s){return s?s instanceof SO||s instanceof $8:!1}class Ox{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);$r(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);$r(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if($r(t)&&t.canAppend(this._model))return t;const i=new SO(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],wy(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),r=Ox._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),wy(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Le(i),null}}}class j8{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function K8(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 h=Math.abs(a-d),c=Math.abs(r-l);if(h===0){n.spacesDiff=c,c>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(c%h===0){n.spacesDiff=c/h;return}}function GE(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 h=[0,0,0,0,0,0,0,0,0],c=new j8;for(let g=1;g<=i;g++){let m=s.getLineLength(g),_=s.getLineContent(g);const C=m<=65536;let b=!1,v=0,w=0,y=0;for(let L=0,D=m;L<D;L++){let N=C?_.charCodeAt(L):s.getLineCharCode(g,L);if(N===9)y++;else if(N===32)w++;else{b=!0,v=L;break}}if(!b||(y>0?n++:w>1&&o++,K8(r,a,_,v,c),c.looksLikeAlignment&&!(t&&e===c.spacesDiff)))continue;let k=c.spacesDiff;k<=d&&h[k]++,r=_,a=v}let u=t;n!==o&&(u=n<o);let f=e;if(u){let g=u?0:.1*i;l.forEach(m=>{let _=h[m];_>g&&(g=_,f=m)}),f===4&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}function gn(s){return(s.metadata&1)>>>0}function gt(s,e){s.metadata=s.metadata&254|e<<0}function Ti(s){return(s.metadata&2)>>>1===1}function ft(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function yO(s){return(s.metadata&4)>>>2===1}function ZE(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function q8(s){return(s.metadata&24)>>>3}function YE(s,e){s.metadata=s.metadata&231|e<<3}function G8(s){return(s.metadata&32)>>>5===1}function XE(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class LO{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,gt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,ZE(this,!1),YE(this,1),XE(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,ft(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;let t=this.options.className;ZE(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),YE(this,this.options.stickiness),XE(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 ke=new LO(null,0,0);ke.parent=ke;ke.left=ke;ke.right=ke;gt(ke,0);class c0{constructor(){this.root=ke,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===ke?[]:i7(this,e,t,i,n,o)}search(e,t,i){return this.root===ke?[]:t7(this,e,t,i)}collectNodesFromOwner(e){return J8(this,e)}collectNodesPostOrder(){return e7(this)}insert(e){QE(this,e),this._normalizeDeltaIfNecessary()}delete(e){JE(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=X8(this,e,e+t);for(let r=0,a=o.length;r<a;r++){const l=o[r];JE(this,l)}this._normalizeDeltaIfNecessary(),Q8(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,Y8(l,e,e+t,i,n),l.maxEnd=l.end,QE(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,Z8(this))}}function Z8(s){let e=s.root,t=0;for(;e!==ke;){if(e.left!==ke&&!Ti(e.left)){e=e.left;continue}if(e.right!==ke&&!Ti(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,cl(e),ft(e,!0),ft(e.left,!1),ft(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}ft(s.root,!1)}function Xh(s,e,t,i){return s<t?!0:s>t||i===1?!1:i===2?!0:e}function Y8(s,e,t,i,n){const o=q8(s),r=o===0||o===2,a=o===1||o===2,l=t-e,d=i,h=Math.min(l,d),c=s.start;let u=!1;const f=s.end;let g=!1;e<=c&&f<=t&&G8(s)&&(s.start=e,u=!0,s.end=e,g=!0);{const _=n?1:l>0?2:0;!u&&Xh(c,r,e,_)&&(u=!0),!g&&Xh(f,a,e,_)&&(g=!0)}if(h>0&&!n){const _=l>d?2:0;!u&&Xh(c,r,e+h,_)&&(u=!0),!g&&Xh(f,a,e+h,_)&&(g=!0)}{const _=n?1:0;!u&&Xh(c,r,t,_)&&(s.start=e+d,u=!0),!g&&Xh(f,a,t,_)&&(s.end=e+d,g=!0)}const m=d-l;u||(s.start=Math.max(0,c+m)),g||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function X8(s,e,t){let i=s.root,n=0,o=0,r=0,a=0,l=[],d=0;for(;i!==ke;){if(Ti(i)){ft(i.left,!1),ft(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Ti(i.left)){if(o=n+i.maxEnd,o<e){ft(i,!0);continue}if(i.left!==ke){i=i.left;continue}}if(r=n+i.start,r>t){ft(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[d++]=i),ft(i,!0),i.right!==ke&&!Ti(i.right)){n+=i.delta,i=i.right;continue}}return ft(s.root,!1),l}function Q8(s,e,t,i){let n=s.root,o=0,r=0,a=0;const l=i-(t-e);for(;n!==ke;){if(Ti(n)){ft(n.left,!1),ft(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),cl(n),n=n.parent;continue}if(!Ti(n.left)){if(r=o+n.maxEnd,r<e){ft(n,!0);continue}if(n.left!==ke){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),ft(n,!0);continue}if(ft(n,!0),n.right!==ke&&!Ti(n.right)){o+=n.delta,n=n.right;continue}}ft(s.root,!1)}function J8(s,e){let t=s.root,i=[],n=0;for(;t!==ke;){if(Ti(t)){ft(t.left,!1),ft(t.right,!1),t=t.parent;continue}if(t.left!==ke&&!Ti(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),ft(t,!0),t.right!==ke&&!Ti(t.right)){t=t.right;continue}}return ft(s.root,!1),i}function e7(s){let e=s.root,t=[],i=0;for(;e!==ke;){if(Ti(e)){ft(e.left,!1),ft(e.right,!1),e=e.parent;continue}if(e.left!==ke&&!Ti(e.left)){e=e.left;continue}if(e.right!==ke&&!Ti(e.right)){e=e.right;continue}t[i++]=e,ft(e,!0)}return ft(s.root,!1),t}function t7(s,e,t,i){let n=s.root,o=0,r=0,a=0,l=[],d=0;for(;n!==ke;){if(Ti(n)){ft(n.left,!1),ft(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(n.left!==ke&&!Ti(n.left)){n=n.left;continue}r=o+n.start,a=o+n.end,n.setCachedOffsets(r,a,i);let h=!0;if(e&&n.ownerId&&n.ownerId!==e&&(h=!1),t&&yO(n)&&(h=!1),h&&(l[d++]=n),ft(n,!0),n.right!==ke&&!Ti(n.right)){o+=n.delta,n=n.right;continue}}return ft(s.root,!1),l}function i7(s,e,t,i,n,o){let r=s.root,a=0,l=0,d=0,h=0,c=[],u=0;for(;r!==ke;){if(Ti(r)){ft(r.left,!1),ft(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(!Ti(r.left)){if(l=a+r.maxEnd,l<e){ft(r,!0);continue}if(r.left!==ke){r=r.left;continue}}if(d=a+r.start,d>t){ft(r,!0);continue}if(h=a+r.end,h>=e){r.setCachedOffsets(d,h,o);let f=!0;i&&r.ownerId&&r.ownerId!==i&&(f=!1),n&&yO(r)&&(f=!1),f&&(c[u++]=r)}if(ft(r,!0),r.right!==ke&&!Ti(r.right)){a+=r.delta,r=r.right;continue}}return ft(s.root,!1),c}function QE(s,e){if(s.root===ke)return e.parent=ke,e.left=ke,e.right=ke,gt(e,0),s.root=e,s.root;n7(s,e),Ra(e.parent);let t=e;for(;t!==s.root&&gn(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;gn(i)===1?(gt(t.parent,0),gt(i,0),gt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,Kf(s,t)),gt(t.parent,0),gt(t.parent.parent,1),qf(s,t.parent.parent))}else{const i=t.parent.parent.left;gn(i)===1?(gt(t.parent,0),gt(i,0),gt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,qf(s,t)),gt(t.parent,0),gt(t.parent.parent,1),Kf(s,t.parent.parent))}return gt(s.root,0),e}function n7(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(o7(n,o,i.start+t,i.end+t)<0)if(i.left===ke){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===ke){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=ke,e.right=ke,gt(e,1)}function JE(s,e){let t,i;if(e.left===ke?(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===ke?(t=e.left,i=e):(i=s7(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,gt(t,0),e.detach(),u0(),cl(t),s.root.parent=ke;return}let n=gn(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,gt(i,gn(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==ke&&(i.left.parent=i),i.right!==ke&&(i.right.parent=i)),e.detach(),n){Ra(t.parent),i!==e&&(Ra(i),Ra(i.parent)),u0();return}Ra(t),Ra(t.parent),i!==e&&(Ra(i),Ra(i.parent));let o;for(;t!==s.root&&gn(t)===0;)t===t.parent.left?(o=t.parent.right,gn(o)===1&&(gt(o,0),gt(t.parent,1),Kf(s,t.parent),o=t.parent.right),gn(o.left)===0&&gn(o.right)===0?(gt(o,1),t=t.parent):(gn(o.right)===0&&(gt(o.left,0),gt(o,1),qf(s,o),o=t.parent.right),gt(o,gn(t.parent)),gt(t.parent,0),gt(o.right,0),Kf(s,t.parent),t=s.root)):(o=t.parent.left,gn(o)===1&&(gt(o,0),gt(t.parent,1),qf(s,t.parent),o=t.parent.left),gn(o.left)===0&&gn(o.right)===0?(gt(o,1),t=t.parent):(gn(o.left)===0&&(gt(o.right,0),gt(o,1),Kf(s,o),o=t.parent.left),gt(o,gn(t.parent)),gt(t.parent,0),gt(o.left,0),qf(s,t.parent),t=s.root));gt(t,0),u0()}function s7(s){for(;s.left!==ke;)s=s.left;return s}function u0(){ke.parent=ke,ke.delta=0,ke.start=0,ke.end=0}function Kf(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!==ke&&(t.left.parent=e),t.parent=e.parent,e.parent===ke?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,cl(e),cl(t)}function qf(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!==ke&&(t.right.parent=e),t.parent=e.parent,e.parent===ke?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,cl(e),cl(t)}function DO(s){let e=s.end;if(s.left!==ke){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==ke){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function cl(s){s.maxEnd=DO(s)}function Ra(s){for(;s!==ke;){const e=DO(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function o7(s,e,t,i){return s===t?e-i:s-t}class Sy{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!==Ce)return Px(this.right);let e=this;for(;e.parent!==Ce&&e.parent.left!==e;)e=e.parent;return e.parent===Ce?Ce:e.parent}prev(){if(this.left!==Ce)return xO(this.left);let e=this;for(;e.parent!==Ce&&e.parent.right!==e;)e=e.parent;return e.parent===Ce?Ce:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Ce=new Sy(null,0);Ce.parent=Ce;Ce.left=Ce;Ce.right=Ce;Ce.color=0;function Px(s){for(;s.left!==Ce;)s=s.left;return s}function xO(s){for(;s.right!==Ce;)s=s.right;return s}function Fx(s){return s===Ce?0:s.size_left+s.piece.length+Fx(s.right)}function Bx(s){return s===Ce?0:s.lf_left+s.piece.lineFeedCnt+Bx(s.right)}function f0(){Ce.parent=Ce}function Gf(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!==Ce&&(t.left.parent=e),t.parent=e.parent,e.parent===Ce?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function Zf(s,e){let t=e.left;e.left=t.right,t.right!==Ce&&(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===Ce?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Dm(s,e){let t,i;if(e.left===Ce?(i=e,t=i.right):e.right===Ce?(i=e,t=i.left):(i=Px(e.right),t=i.right),i===s.root){s.root=t,t.color=0,e.detach(),f0(),s.root.parent=Ce;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,xf(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,xf(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!==Ce&&(i.left.parent=i),i.right!==Ce&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,xf(s,i)),e.detach(),t.parent.left===t){let r=Fx(t),a=Bx(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,Pr(s,t.parent,l,d)}}if(xf(s,t.parent),n){f0();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,Gf(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,Zf(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,Gf(s,t.parent),t=s.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,Zf(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,Gf(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,Zf(s,t.parent),t=s.root));t.color=0,f0()}function eN(s,e){for(xf(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,Gf(s,e)),e.parent.color=0,e.parent.parent.color=1,Zf(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,Zf(s,e)),e.parent.color=0,e.parent.parent.color=1,Gf(s,e.parent.parent))}s.root.color=0}function Pr(s,e,t,i){for(;e!==s.root&&e!==Ce;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function xf(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=Fx(e.left)-e.size_left,i=Bx(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;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 r7 extends Ru{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 a7(s){let e={};return t=>(e.hasOwnProperty(t)||(e[t]=s(t)),e[t])}const vs=a7(s=>new r7(s)),l7=999;class Yl{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=d7(this.searchString):e=this.searchString.indexOf(`
  13. `)>=0;let t=null;try{t=iM(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 h7(t,this.wordSeparators?vs(this.wordSeparators):null,i?this.searchString:null)}}function d7(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)return!0}return!1}class h7{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function td(s,e,t){if(!t)return new Cg(s,null);let i=[];for(let n=0,o=e.length;n<o;n++)i[n]=e[n];return new Cg(s,i)}class tN{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 xm{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new kf(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 h=e.getPositionAt(a),c=e.getPositionAt(d);return new S(h.lineNumber,h.column,c.lineNumber,c.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
  14. `?new tN(a):null,d=[];let h=0,c;for(i.reset(0);c=i.next(a);)if(d[h++]=td(this._getMultilineMatchRange(e,r,a,l,c.index,c[0]),c,n),h>=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||Wx(d,t,g,m,f))&&(r[o++]=new Cg(new S(i,m+1+n,i,m+1+f+n),null),o>=l))return o;return o}const h=new kf(e.wordSeparators,e.regex);let c;h.reset(0);do if(c=h.next(t),c&&(r[o++]=td(new S(i,c.index+1+n,i,c.index+1+c[0].length+n),c,a),o>=l))return o;while(c);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new kf(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 F(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new S(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),d=e.getEOL()===`\r
  15. `?new tN(l):null;i.reset(t.column-1);let h=i.next(l);return h?td(this._getMultilineMatchRange(e,r,l,d,h.index,h[0]),h,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new F(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 h=(r+d-1)%o,c=e.getLineContent(h+1),u=this._findFirstMatchInLine(i,c,h+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?td(new S(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 kf(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 S(1,1,t.lineNumber,t.column),i,n,10*l7);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 F(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 h=(o+r-d-1)%o,c=e.getLineContent(h+1),u=this._findLastMatchInLine(i,c,h+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=td(new S(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function c7(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 u7(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 Wx(s,e,t,i,n){return c7(s,e,t,i,n)&&u7(s,e,t,i,n)}class kf{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){zr(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||Wx(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const Er=65535;function kO(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 f7{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Fr(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?kO(t):t}function g7(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 h=e.charCodeAt(l);h===13?l+1<d&&e.charCodeAt(l+1)===10?(o++,s[t++]=l+2,l++):(i++,s[t++]=l+1):h===10?(n++,s[t++]=l+1):r&&h!==9&&(h<32||h>126)&&(r=!1)}const a=new f7(kO(s),i,n,o,r);return s.length=0,a}class Ln{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class id{constructor(e,t){this.buffer=e,this.lineStarts=t}}class p7{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ce&&e.iterate(e.root,i=>(i!==Ce&&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 m7{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 _7{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new id("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ce,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=Fr(e[o].buffer));let a=new Ln(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 m7(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=Er,i=t-Math.floor(t/3),n=i*2,o="",r=0,a=[];if(this.iterate(this.root,l=>{let d=this.getNodeContent(l),h=d.length;if(r<=i||r+h<n)return o+=d,r+=h,!0;let c=o.replace(/\r\n|\r|\n/g,e);return a.push(new id(c,Fr(c))),o=d,r=h,!0}),r>0){let l=o.replace(/\r\n|\r|\n/g,e);a.push(new id(l,Fr(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 p7(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Ce;)if(n.left!==Ce&&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!==Ce;)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 F(i+1,a+1)}return new F(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ce){let o=this.getOffsetAt(i+1,1),r=n-e-o;return new F(i+1,r+1)}else t=t.right;return new F(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!==Ce;){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===Ce)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,h=r.start.line,c=r.end.line;let u=d[h]+r.start.column;if(n&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(h===c)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[h+1]-this._EOLLength)):l.substring(u,d[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=h+1;f<c;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[c]+r.end.column-1)===13?(n=!0,r.end.column===0?t--:i=l.substr(d[c],r.end.column-1)):i=l.substr(d[c],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,h,c){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),_,C={line:0,column:0},b,v;t._wordSeparators?(b=u.buffer.substring(g,m),v=w=>w+g,t.reset(0)):(b=u.buffer,v=w=>w,t.reset(g));do if(_=t.next(b),_){if(v(_.index)>=m)return h;this.positionInBuffer(e,v(_.index)-f,C);let w=this.getLineFeedCnt(e.piece.bufferIndex,o,C),y=C.line===o.line?C.column-o.column+n:C.column+1,k=y+_[0].length;if(c[h++]=td(new S(i+w,y,i+w,k),_,l),v(_.index)+_[0].length>=m||h>=d)return h}while(_);return h}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new kf(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 h=this.positionInBuffer(l.node,l.remainder),c=this.positionInBuffer(d.node,d.remainder);if(l.node===d.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,h,c,t,i,n,r,o),o;let u=e.startLineNumber,f=l.node;for(;f!==d.node;){let m=this.getLineFeedCnt(f.piece.bufferIndex,h,f.piece.end);if(m>=1){let C=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),v=C[h.line+m],w=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,w,h,this.positionInBuffer(f,v-b),t,i,n,r,o),r>=n)return o;u+=m}let _=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const C=this.getLineContent(u).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,C,e.endLineNumber,_,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(_),u,_,r,o,i,n),r>=n)return o;u++,l=this.nodeAt2(u,1),f=l.node,h=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){let m=u===e.startLineNumber?e.startColumn-1:0;const _=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,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,h,c,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,l,d){const h=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((!h||Wx(h,i,g,m,f))&&(a[r++]=new Cg(new S(n,m+1+o,n,m+1+f+o),null),r>=d))return r;return r}let c;t.reset(0);do if(c=t.next(i),c&&(a[r++]=td(new S(n,c.index+1+o,n,c.index+1+c[0].length+o),c,l),r>=d))return r;while(c);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ce){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<Er){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 h=[],c=new Ln(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:c.start.line+1,column:0};c=new Ln(c.bufferIndex,m,c.end,this.getLineFeedCnt(c.bufferIndex,m,c.end),c.length-1),t+=`
  16. `}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&&h.push(n)}else this.deleteNodeTail(n,d);else this.deleteNodeTail(n,d);let u=this.createNewPieces(t);c.length>0&&this.rbInsertRight(n,c);let f=n;for(let g=0;g<u.length;g++)f=this.rbInsertRight(f,u[g]);this.deleteNodes(h)}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===Ce)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();Dm(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 h=o.next();for(let u=h;u!==Ce&&u!==r;u=u.next())a.push(u);let c=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(c),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 Ln(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
  17. `,Pr(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+=`
  18. `);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,h=n.end.line,c=0,u=0,f=0;for(;d<=h&&(c=d+(h-d)/2|0,f=r[c],c!==h);)if(u=r[c+1],l<f)h=c-1;else if(l>=u)d=c+1;else break;return i?(i.line=c,i.column=l-f,null):{line:c,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++)Dm(this,e[t])}createNewPieces(e){if(e.length>Er){let h=[];for(;e.length>Er;){const u=e.charCodeAt(Er-1);let f;u===13||u>=55296&&u<=56319?(f=e.substring(0,Er-1),e=e.substring(Er-1)):(f=e.substring(0,Er),e=e.substring(Er));let g=Fr(f);h.push(new Ln(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 id(f,g))}let c=Fr(e);return h.push(new Ln(this._buffers.length,{line:0,column:0},{line:c.length-1,column:e.length-c[c.length-1]},c.length-1,e.length)),this._buffers.push(new id(e,c)),h}let t=this._buffers[0].buffer.length;const i=Fr(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 h=0;h<i.length;h++)i[h]+=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 h=0;h<i.length;h++)i[h]+=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 Ln(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!==Ce;)if(i.left!==Ce&&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),h=this._buffers[i.piece.bufferIndex].buffer,c=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)}),h.substring(c+l,c+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,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=d.substring(h+l,h+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!==Ce;){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!==Ce;)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,h=a-o,c=i.length+h;e.piece=new Ln(i.bufferIndex,i.start,r,l,c),Pr(this,e,h,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,h=o-l,c=i.length+h;e.piece=new Ln(i.bufferIndex,r,i.end,a,c),Pr(this,e,h,d)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,d=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,d),c=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new Ln(n.bufferIndex,n.start,d,h,c),Pr(this,e,c-a,h-l);let u=new Ln(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+=`
  19. `);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Fr(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,h=e.piece.lineFeedCnt,c=this.getLineFeedCnt(0,e.piece.start,l),u=c-h;e.piece=new Ln(e.piece.bufferIndex,e.piece.start,l,c,d),this._lastChangeBufferPos=l,Pr(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!==Ce;)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!==Ce;)if(i.left!==Ce&&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!==Ce;){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===`
  20. `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Ce||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===Ce||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 Ln(e.piece.bufferIndex,e.piece.start,o,a,r),Pr(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,h=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Ln(t.piece.bufferIndex,l,t.piece.end,h,d),Pr(this,t,-1,-1),t.piece.length===0&&i.push(t);let c=this.createNewPieces(`\r
  21. `);this.rbInsertRight(e,c[0]);for(let u=0;u<i.length;u++)Dm(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let i=t.next();if(this.startWithLF(i)){if(e+=`
  22. `,i.piece.length===1)Dm(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 Ln(n.bufferIndex,o,n.end,a,r),Pr(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Ce)return t(Ce);let i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Ce)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 Sy(t,1);if(i.left=Ce,i.right=Ce,i.parent=Ce,i.size_left=0,i.lf_left=0,this.root===Ce)this.root=i,i.color=0;else if(e.right===Ce)e.right=i,i.parent=e;else{let o=Px(e.right);o.left=i,i.parent=o}return eN(this,i),i}rbInsertLeft(e,t){let i=new Sy(t,1);if(i.left=Ce,i.right=Ce,i.parent=Ce,i.size_left=0,i.lf_left=0,this.root===Ce)this.root=i,i.color=0;else if(e.left===Ce)e.left=i,i.parent=e;else{let n=xO(e.left);n.right=i,i.parent=n}return eN(this,i),i}}function nu(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 iN(s){return(s<<0|0|0|16384|2<<23)>>>0}const Nr=new Uint32Array(0).buffer;class g0{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 b7(e,[t]))}}class Gb{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 S(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 nN(this._tokens.subarray(4*r,4*a+4))}}return this._getDeltaLine(t)===e?new nN(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 h=0;h<r;h++){const c=4*h,u=o[c],f=o[c+1],g=o[c+2],m=o[c+3];if((u>e||u===e&&g>=t)&&(u<i||u===i&&f<=n))l=!0;else{if(a===0&&(d=u),l){const _=4*a;o[_]=u-d,o[_+1]=f,o[_+2]=g,o[_+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,h=0,c=0;for(let u=0;u<r;u++){const f=4*u,g=o[f],m=o[f+1],_=o[f+2],C=o[f+3];if(g>e||g===e&&_>=t){if(g<i||g===i&&m<=n)continue;d!==l&&(d=l,h=0,c=g)}d[h++]=g-c,d[h++]=m,d[h++]=_,d[h++]=C}return[new Gb(new Uint32Array(a)),new Gb(new Uint32Array(l)),c]}acceptDeleteRange(e,t,i,n,o){const r=this._tokens,a=this._tokenCount,l=n-t;let d=0,h=!1;for(let c=0;c<a;c++){const u=4*c;let f=r[u],g=r[u+1],m=r[u+2];const _=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{h=!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{h=!0;continue}else if(f>n){if(l===0&&!h){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 C=4*d;r[C]=f,r[C+1]=g,r[C+2]=m,r[C+3]=_,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 h=0;h<d;h++){const c=4*h;let u=l[c],f=l[c+1],g=l[c+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[c]=u,l[c+1]=f,l[c+2]=g}}}}class nN{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 Zb{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 S(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 Zb(this.startLineNumber,n),new Zb(this.startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=nu(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 F(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 b7{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function Tr(s){return s instanceof Uint32Array?s:new Uint32Array(s)}class Vx{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}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=xg(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=Vx._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0,d=[],h=0,c=0;const u=(f,g)=>{f!==c&&(c=f,d[h++]=f,d[h++]=g)};for(let f=0;f<a;f++){const g=o.getStartCharacter(f),m=o.getEndCharacter(f),_=o.getMetadata(f),C=((_&1?2048:0)|(_&2?4096:0)|(_&4?8192:0)|(_&8?8372224:0)|(_&16?4286578688:0))>>>0,b=~C>>>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|_&C),l++;if(l<r)u(m,t.getMetadata(l)&b|_&C),t.getEndOffset(l)===m&&l++;else{const v=Math.min(Math.max(0,l-1),r-1);u(m,t.getMetadata(v)&b|_&C)}}for(;l<r;)u(t.getEndOffset(l),t.getMetadata(l)),l++;return new yi(new Uint32Array(d),t.getLineContent(),this._languageIdCodec)}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 rs{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),n!==null&&n!==Nr)return new yi(Tr(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=iN(this._languageIdCodec.encodeLanguageId(e)),new yi(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?Tr(i):null;if(t===0){let o=!1;if(n&&n.length>1&&(o=Yi.getLanguageId(n[1])!==e),!o)return Nr}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=iN(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=xg(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const r=rs._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=r,o?!rs._equals(a,r):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=Tr(e),n=Tr(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 F(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]=rs._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=rs._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=rs._deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=rs._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]=rs._insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=rs._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=rs._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}static _deleteBeginning(e,t){return e===null||e===Nr?e:rs._delete(e,0,t)}static _deleteEnding(e,t){if(e===null||e===Nr)return e;const i=Tr(e),n=i[i.length-2];return rs._delete(e,t,n)}static _delete(e,t,i){if(e===null||e===Nr||t===i)return e;const n=Tr(e),o=n.length>>>1;if(t===0&&n[n.length-2]===i)return Nr;const r=yi.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,h;a!==t?(n[r<<1]=t,d=r+1<<1,h=t):(d=r<<1,h=a);const c=i-t;for(let f=r+1;f<o;f++){const g=n[f<<1]-c;g>h&&(n[d++]=g,n[d++]=n[(f<<1)+1],h=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===Nr)return e;if(e===Nr)return t;if(e===null)return e;if(t===null)return null;const i=Tr(e),n=Tr(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===Nr)return e;const n=Tr(e),o=n.length>>>1;let r=yi.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 Hc extends H{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 _7(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 S(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 h=l;h<d;h++)Si(a.charCodeAt(h))?(i=i+1,h=h+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=an(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=sr(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
  23. `;case 2:return`\r
  24. `;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 _=e[m];a&&_._isTracked&&(a=!1);let C=_.range;if(_.text){let k=!0;r||(k=!ix(_.text),r=k),!n&&k&&(n=ZC(_.text)),!o&&k&&(o=oM(_.text))}let b="",v=0,w=0,y=0;if(_.text){let k;[v,w,y,k]=nu(_.text);const L=this.getEOL();k===0||k===(L===`\r
  25. `?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,L)}l[m]={sortIndex:m,identifier:_.identifier||null,range:C,rangeOffset:this.getOffsetAt(C.startLineNumber,C.startColumn),rangeLength:this.getValueLengthInRange(C),text:b,eolCount:v,firstLineLength:w,lastLineLength:y,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(Hc._sortOpsAscending);let d=!1;for(let m=0,_=l.length-1;m<_;m++){let C=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(C)){if(b.isBefore(C))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));let h=i||t?Hc._getInverseEditRanges(l):[],c=[];if(t)for(let m=0;m<l.length;m++){let _=l[m],C=h[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=C.startLineNumber;b<=C.endLineNumber;b++){let v="";b===C.startLineNumber&&(v=this.getLineContent(_.range.startLineNumber),an(v)!==-1)||c.push({lineNumber:b,oldContent:v})}}let u=null;if(i){let m=0;u=[];for(let _=0;_<l.length;_++){const C=l[_],b=h[_],v=this.getValueInRange(C.range),w=C.rangeOffset+m;m+=C.text.length-v.length,u[_]={sortIndex:C.sortIndex,identifier:C.identifier,range:b,text:v,textChange:new ki(C.rangeOffset,v,w,C.text)}}d||u.sort((_,C)=>_.sortIndex-C.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&c.length>0){c.sort((m,_)=>_.lineNumber-m.lineNumber),g=[];for(let m=0,_=c.length;m<_;m++){let C=c[m].lineNumber;if(m>0&&c[m-1].lineNumber===C)continue;let b=c[m].oldContent,v=this.getLineContent(C);v.length===0||v===b||an(v)!==-1||g.push(C)}}return this._onDidChangeContent.fire(),new _W(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 S(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f<g;f++){const m=e[f],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new S(r,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),r=_.endLineNumber,a=_.endColumn}const d=l.join(""),[h,c,u]=nu(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:h,firstLineLength:c,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Hc._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 S(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,h;o?o.range.endLineNumber===l.range.startLineNumber?(d=i,h=n+(l.range.startColumn-o.range.endColumn)):(d=i+(l.range.startLineNumber-o.range.endLineNumber),h=l.range.startColumn):(d=l.range.startLineNumber,h=l.range.startColumn);let c;if(l.text.length>0){const u=l.eolCount+1;u===1?c=new S(d,h,d,h+l.firstLineLength):c=new S(d,h,d+u-1,l.lastLineLength+1)}else c=new S(d,h,d,h);i=c.endLineNumber,n=c.endColumn,t.push(c),o=l}return t}static _sortOpsAscending(e,t){let i=S.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=S.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class C7{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?`
  26. `:`\r
  27. `:i>t/2?`\r
  28. `:`
  29. `}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&(t===`\r
  30. `&&(this._cr>0||this._lf>0)||t===`
  31. `&&(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=Fr(a);i[o]=new id(a,l)}const n=new Hc(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class v7{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&&nx(e)&&(this.BOM=O3,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=g7(this._tmpLineStarts,e);this.chunks.push(new id(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=ZC(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=oM(e))}finish(e=!0){return this._finish(),new C7(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=Fr(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class w7{constructor(){this.changeType=1}}class wo{constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=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.options.content;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 wo(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new wo(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));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 sN{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class S7{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class y7{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class L7{constructor(){this.changeType=5}}class Ld{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 Ld(i,n,o,r)}}class IO{constructor(e){this.changes=e}}class Yb{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=Ld.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=Yb._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new Yb(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 D7{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;const i=[],n=[];for(let o=0;o<t;o++)i[o]=null,n[o]=!1;this._beginState=xg(this._beginState,e,i),this._valid=xg(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 F(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 x7 extends H{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isDisposed=!1,this._tokenizationStateStore=new D7,this._tokenizationSupport=null,this._register(Rt.onDidChange(i=>{const n=this._textModel.getLanguageId();i.changedLanguages.indexOf(n)!==-1&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeContentFast(i=>{if(i.isFlush){this._resetTokenizationState();return}for(let n=0,o=i.changes.length;n<o;n++){const r=i.changes[n],[a]=nu(r.text);this._tokenizationStateStore.applyEdits(r.range,a)}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]=k7(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&KS(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(){const e=this._textModel.getLineCount(),t=1,i=new g0,n=dr.create(!1);let o=-1;for(;this._hasLinesToTokenize()&&!(n.elapsed()>t||(o=this._tokenizeOneInvalidLine(i),o>=e)););this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}tokenizeViewport(e,t){const i=new g0;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new g0;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens,!this._hasLinesToTokenize())}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.getLanguageId(),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=p0(this._languageIdCodec,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);const o=[];let r=null;for(let d=t-1;n>1&&d>=1;d--){const h=this._textModel.getLineFirstNonWhitespaceColumn(d);if(h!==0&&h<n){if(r=this._tokenizationStateStore.getBeginState(d-1),r)break;o.push(this._textModel.getLineContent(d)),n=h}}r||(r=this._tokenizationSupport.getInitialState());const a=this._textModel.getLanguageId();let l=r;for(let d=o.length-1;d>=0;d--)l=p0(this._languageIdCodec,a,this._tokenizationSupport,o[d],!1,l).endState;for(let d=t;d<=i;d++){const h=this._textModel.getLineContent(d),c=p0(this._languageIdCodec,a,this._tokenizationSupport,h,!0,l);e.add(d,c.tokens),this._tokenizationStateStore.setFakeTokens(d-1),l=c.endState}}}function k7(s){const e=s.getLanguageId();let t=s.isTooLargeForTokenization()?null:Rt.get(e),i=null;if(t)try{i=t.getInitialState()}catch(n){Le(n),t=null}return[t,i]}function p0(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenize2(i,n,o.clone(),0)}catch(a){Le(a)}return r||(r=cx(s.encodeLanguageId(e),i,o,0)),yi.convertToEndOffset(r.tokens,i.length),r}function Qa(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class Be{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=Qa(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 oo{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Qa(Math.max(Math.min(1,t),0),3),this.l=Qa(Math.max(Math.min(1,i),0),3),this.a=Qa(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 h=(a+r)/2,c=r-a;if(c>0){switch(d=Math.min(h<=.5?c/(2*h):c/(2-2*h),1),r){case t:l=(i-n)/c+(i<n?6:0);break;case i:l=(n-t)/c+2;break;case n:l=(t-i)/c+4;break}l*=60,l=Math.round(l)}return new oo(l,d,h,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,h=2*n-d;r=oo._hue2rgb(h,d,t+1/3),a=oo._hue2rgb(h,d,t),l=oo._hue2rgb(h,d,t-1/3)}return new Be(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class tr{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Qa(Math.max(Math.min(1,t),0),3),this.v=Qa(Math.max(Math.min(1,i),0),3),this.a=Qa(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 tr(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,h,c]=[0,0,0];return t<60?(d=r,h=a):t<120?(d=a,h=r):t<180?(h=r,c=a):t<240?(h=a,c=r):t<300?(d=a,c=r):t<=360&&(d=r,c=a),d=Math.round((d+l)*255),h=Math.round((h+l)*255),c=Math.round((c+l)*255),new Be(d,h,c,o)}}class W{constructor(e){if(e)if(e instanceof Be)this.rgba=e;else if(e instanceof oo)this._hsla=e,this.rgba=oo.toRGBA(e);else if(e instanceof tr)this._hsva=e,this.rgba=tr.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}static fromHex(e){return W.Format.CSS.parseHex(e)||W.red}get hsla(){return this._hsla?this._hsla:oo.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:tr.fromRGBA(this.rgba)}equals(e){return!!e&&Be.equals(this.rgba,e.rgba)&&oo.equals(this.hsla,e.hsla)&&tr.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=W._relativeLuminanceForComponent(this.rgba.r),t=W._relativeLuminanceForComponent(this.rgba.g),i=W._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return Qa(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 W(new oo(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new W(new oo(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 W(new Be(t,i,n,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new W(new Be(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=W.Format.CSS.format(this)),this._toString}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)}}W.white=new W(new Be(255,255,255,1));W.black=new W(new Be(0,0,0,1));W.red=new W(new Be(255,0,0,1));W.blue=new W(new Be(0,0,255,1));W.cyan=new W(new Be(0,255,255,1));W.lightgrey=new W(new Be(211,211,211,1));W.transparent=new W(new Be(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 h(f){return f.isOpaque()?s.Format.CSS.formatHex(f):s.Format.CSS.formatRGBA(f)}t.format=h;function c(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)),_=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),C=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new s(new Be(m,_,C,1))}if(g===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),_=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),C=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),b=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new s(new Be(m,_,C,b/255))}if(g===4){const m=u(f.charCodeAt(1)),_=u(f.charCodeAt(2)),C=u(f.charCodeAt(3));return new s(new Be(16*m+m,16*_+_,16*C+C))}if(g===5){const m=u(f.charCodeAt(1)),_=u(f.charCodeAt(2)),C=u(f.charCodeAt(3)),b=u(f.charCodeAt(4));return new s(new Be(16*m+m,16*_+_,16*C+C,(16*b+b)/255))}return null}t.parseHex=c;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={}))})(W||(W={}));const Wp=Je("undoRedoService");class EO{constructor(e,t){this.resource=e,this.elements=t}}class su{constructor(){this.id=su._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}su._ID=0;su.None=new su;class Qo{constructor(){this.id=Qo._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Qo._ID=0;Qo.None=new Qo;class oN{constructor(e,t,i){this.range=e,this.nestingLevel=t,this.isInvalid=i}}class I7{constructor(e,t,i,n){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n}}class E7 extends I7{constructor(e,t,i,n,o){super(e,t,i,n),this.minVisibleColumnIndentation=o}}class N7{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}function T7(s,e,t,i){return s!==t?zt(t-s,i):zt(0,i-e)}const ga=0;function A7(s){return s===0}const Gn=Math.pow(2,26);function zt(s,e){return s*Gn+e}function Ja(s){const e=s,t=Math.floor(e/Gn),i=e-t*Gn;return new N7(t,i)}function R7(s){return Math.floor(s/Gn)}function Ni(s,e){return e<Gn?s+e:s-s%Gn+e}function M7(s,e){const t=s,i=e;if(i-t<=0)return ga;const o=Math.floor(t/Gn),r=Math.floor(i/Gn),a=i-r*Gn;if(o===r){const l=t-o*Gn;return zt(0,a-l)}else return zt(r-o,a)}function I_(s,e){return s<e}function ud(s,e){return s<=e}function km(s,e){return s>=e}function Im(s){return zt(s.lineNumber-1,s.column-1)}function Yf(s,e){const t=s,i=Math.floor(t/Gn),n=t-i*Gn,o=e,r=Math.floor(o/Gn),a=o-r*Gn;return new S(i+1,n+1,r+1,a+1)}function O7(s){const e=cr(s);return zt(e.length-1,e[e.length-1].length)}class rN{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class P7{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(i=>Hx.from(i))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):this.documentLength;return M7(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?zt(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):zt(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ja(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?zt(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):zt(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(ud(i,e)){this.nextEditIdx++;const n=Ja(i),o=Ja(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-o.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class Hx{constructor(e,t,i){this.endOffsetBeforeObj=Ja(t),this.endOffsetAfterObj=Ja(Ni(e,i)),this.offsetObj=Ja(e)}static from(e){return new Hx(e.startOffset,e.endOffset,e.newLength)}}class ct{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=zr(e,o,a);if(a+=l>=65536?2:1,l===9)r=ct.nextRenderTabStop(r,i);else{let d=jh(l);for(;a<o;){const h=zr(e,o,a),c=jh(h);if(Ff(d,c))break;a+=h>=65536?2:1,d=c}go(l)||Pf(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=zr(e,i,r);if(r+=a>=65536?2:1,n.push(o),a>=65536&&n.push(o),a===9)o=ct.nextRenderTabStop(o,t);else{let l=jh(a);for(;r<i;){const d=zr(e,i,r),h=jh(d);if(Ff(l,h))break;r+=d>=65536?2:1,n.push(o),a>=65536&&n.push(o),l=h}go(a)||Pf(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=zr(e,n,a);a+=l>=65536?2:1;let d;if(l===9)d=ct.nextRenderTabStop(o,i);else{let c=jh(l);for(;a<n;){const u=zr(e,n,a),f=jh(u);if(Ff(c,f))break;a+=u>=65536?2:1,c=f}go(l)||Pf(l)?d=o+2:d=o+1}const h=a+1;if(d>=t){const c=t-o;return d-t<c?h:r}o=d,r=h}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)}}const E_=new Array;class ei{constructor(e,t){this.items=e,this.additionalItems=t}static create(e,t){if(e<=128&&t.length===0){let i=ei.cache[e];return i||(i=new ei(e,t),ei.cache[e]=i),i}return new ei(e,t)}static getEmpty(){return this.empty}add(e,t){const i=t.getKey(e);let n=i>>5;if(n===0){const r=1<<i|this.items;return r===this.items?this:ei.create(r,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(i&31),ei.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===E_&&e.additionalItems===E_)return t===this.items?this:t===e.items?e:ei.create(t,E_);const i=new Array;for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const o=this.additionalItems[n]||0,r=e.additionalItems[n]||0;i.push(o|r)}return ei.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}ei.cache=new Array(129);ei.empty=ei.create(0,E_);const aN={getKey(s){return s}};class F7{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class zx{constructor(e){this._length=e}get length(){return this._length}}class Ag extends zx{constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}static create(e,t,i){let n=e.length;return t&&(n=Ni(n,t.length)),i&&(n=Ni(n,i.length)),new Ag(n,e,t,i,t?t.missingOpeningBracketIds:ei.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=new Array;return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new Ag(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Ni(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class gr extends zx{constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Ni(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Ni(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new B7(o,e.listHeight+1,e,t,i,r):new Rg(o,e.listHeight+1,e,t,i,r)}static getEmpty(){return new W7(ga,0,[],ei.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;let t=this,i;for(;t.kind===4&&(i=t.childrenLength)>0;)t=t.getChild(i-1);return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const o=this.getChild(n);t=Ni(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let o=0;o<this.childrenLength;o++){const r=this.getChild(o);r&&(i=Math.min(i,r.computeMinIndentation(n,t)),n=Ni(n,r.length))}return this.cachedMinIndentation=i,i}}class Rg extends gr{constructor(e,t,i,n,o,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=o}get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}deepClone(){return new Rg(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class B7 extends Rg{toMutable(){return new Rg(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Xb extends gr{constructor(e,t,i,n){super(e,t,n),this._children=i}get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Xb(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class W7 extends Xb{toMutable(){return new Xb(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const V7=[];class Ux extends zx{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return V7}deepClone(){return this}}class cc extends Ux{get kind(){return 0}get missingOpeningBracketIds(){return ei.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Ja(e),n=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=R7(Ni(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=o;a++){const l=t.getLineFirstNonWhitespaceColumn(a),d=t.getLineContent(a);if(l===0)continue;const h=ct.visibleColumnFromColumn(d,l,t.getOptions().tabSize);r=Math.min(r,h)}return r}}class Dd extends Ux{constructor(e){super(e)}static create(e){const t=e,i=Dd.cacheByLength.get(t);if(i)return i;const n=new Dd(e);return Dd.cacheByLength.set(t,n),n}get kind(){return 1}get missingOpeningBracketIds(){return ei.getEmpty()}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}Dd.cacheByLength=new Map;class H7 extends Ux{constructor(e,t){super(t),this.missingOpeningBracketIds=e}get kind(){return 3}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}let Va=class{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}};class z7{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new U7(this.textModel,this.bracketTokens),this._offset=ga,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return zt(this.textBufferLineCount,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Ni(this._offset,e);const t=Ja(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Ni(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class U7{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset)):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset<r){const l=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&l===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const d=Yi.getTokenType(l)===0,h=o.getEndOffset(this.lineTokenOffset);if(d&&h!==this.lineCharOffset){const c=o.getLanguageId(this.lineTokenOffset),u=this.line.substring(this.lineCharOffset,h),f=this.bracketTokens.getSingleLanguageBracketTokens(c),g=f.regExpGlobal;if(g){g.lastIndex=0;const m=g.exec(u);m&&(a=f.getToken(m[0]),a&&(this.lineCharOffset+=m.index))}}if(i+=h-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=h}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const n=T7(e,t,this.lineIdx,this.lineCharOffset);return new Va(n,0,-1,ei.getEmpty(),new cc(n))}}class $7{constructor(e,t){this.text=e,this._offset=ga,this.idx=0;const n=t.getRegExpStr()?new RegExp(t.getRegExpStr()+`|
  32. `,"g"):null,o=[];let r,a=0,l=0,d=0,h=0;const c=new Array;for(let g=0;g<60;g++)c.push(new Va(zt(0,g),0,-1,ei.getEmpty(),new cc(zt(0,g))));const u=new Array;for(let g=0;g<60;g++)u.push(new Va(zt(1,g),0,-1,ei.getEmpty(),new cc(zt(1,g))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const g=r.index,m=r[0];if(m===`
  33. `)a++,l=g+1;else{if(d!==g){let _;if(h===a){const C=g-d;if(C<c.length)_=c[C];else{const b=zt(0,C);_=new Va(b,0,-1,ei.getEmpty(),new cc(b))}}else{const C=a-h,b=g-l;if(C===1&&b<u.length)_=u[b];else{const v=zt(C,b);_=new Va(v,0,-1,ei.getEmpty(),new cc(v))}}o.push(_)}o.push(t.getToken(m)),d=g+m.length,h=a}}const f=e.length;if(d!==f){const g=h===a?zt(0,f-d):zt(a-h,f-l);o.push(new Va(g,0,-1,ei.getEmpty(),new cc(g)))}this.length=zt(a,f-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new v5}}class Qb{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(l,d){return t.getKey(`${l}:::${d}`)}const n=e.characterPair.getColorizedBrackets(),o=new Map,r=new Set;for(const[l,d]of n){r.add(l);let h=o.get(d);const c=i(e.languageId,l);h||(h={openingBrackets:ei.getEmpty(),first:c},o.set(d,h)),h.openingBrackets=h.openingBrackets.add(c,aN)}const a=new Map;for(const[l,d]of o){const h=zt(0,l.length);a.set(l,new Va(h,2,d.first,d.openingBrackets,Dd.create(h)))}for(const l of r){const d=zt(0,l.length),h=i(e.languageId,l);a.set(l,new Va(d,1,h,ei.getEmpty().add(h,aN),Dd.create(d)))}return new Qb(a)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>j7(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}get isEmpty(){return this.map.size===0}}function j7(s){const e=Ks(s);return/^[\w ]+$/.test(s)?`\\b${e}\\b`:e}class K7{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=Qb.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=Qb.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function q7(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-r>=2?NO(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())lN(i,n)<=lN(n,r)?(i=m0(i,n),n=r):n=m0(n,r);return m0(i,n)}function NO(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const o=n<<1;s[n]=gr.create23(s[o],s[o+1],o+3===t?s[o+2]:null,e)}t=i}return gr.create23(s[0],s[1],t>=3?s[2]:null,e)}function lN(s,e){return Math.abs(s.listHeight-e.listHeight)}function m0(s,e){return s.listHeight===e.listHeight?gr.create23(s,e,null,!1):s.listHeight>e.listHeight?G7(s,e):Z7(e,s)}function G7(s,e){s=s.toMutable();let t=s;const i=new Array;let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=gr.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?gr.create23(s,n,null,!1):s}function Z7(s,e){s=s.toMutable();let t=s;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=gr.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?gr.create23(n,s,null,!1):s}class Y7{constructor(e){this.lastOffset=ga,this.nextNodes=[e],this.offsets=[ga],this.idxs=[]}readLongestNodeAt(e,t){if(I_(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=af(this.nextNodes);if(!i)return;const n=af(this.offsets);if(I_(e,n))return;if(I_(n,e))if(Ni(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=_0(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=_0(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=af(this.offsets),t=af(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=af(this.nextNodes),n=_0(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Ni(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function _0(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function af(s){return s.length>0?s[s.length-1]:void 0}function dN(s,e,t,i){return new X7(s,e,t,i).parseDocument()}class X7{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Y7(i):void 0,this.positionMapper=new P7(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ei.getEmpty());return e||(e=gr.getEmpty()),e}parseList(e){const t=new Array;for(;;){const n=this.tokenizer.peek();if(!n||n.kind===2&&n.bracketIds.intersects(e))break;const o=this.parseChild(e);o.kind===4&&o.childrenLength===0||t.push(o)}return this.oldNodeReader?q7(t):NO(t,this.createImmutableLists)}parseChild(e){if(this.oldNodeReader){const i=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(!A7(i)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>I_(o.length,i)?o.canBeReused(e):!1);if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new H7(t.bracketIds,t.length);case 0:return t.astNode;case 1:const i=e.merge(t.bracketIds),n=this.parseList(i),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),Ag.create(t.astNode,n,o.astNode)):Ag.create(t.astNode,n,null);default:throw new Error("unexpected")}}}class Q7 extends H{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.cache=this._register(new dn),this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(e.onDidChangeOptions(i=>{this.cache.clear(),this.updateCache()})),this._register(e.onDidChangeLanguage(i=>{this.cache.clear(),this.updateCache()})),this._register(this.languageConfigurationService.onDidChange(i=>{var n;(!i.languageId||!((n=this.cache.value)===null||n===void 0)&&n.object.didLanguageChange(i.languageId))&&(this.cache.clear(),this.updateCache())}))}get isDocumentSupported(){return this.textModel.getValueLength()<=5e6}updateCache(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.cache.value){const e=new X;this.cache.value=J7(e.add(new e9(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.cache.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.cache.clear(),this.onDidChangeEmitter.fire()}handleContentChanged(e){var t;(t=this.cache.value)===null||t===void 0||t.object.handleContentChanged(e)}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketsInRange(e))||[]}}function J7(s,e){return{object:s,dispose:()=>e==null?void 0:e.dispose()}}class e9 extends H{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new M,this.denseKeyProvider=new F7,this.brackets=new K7(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this._register(e.onBackgroundTokenizationStateChanged(()=>{if(e.backgroundTokenizationState===2){const i=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,i||this.didChangeEmitter.fire()}})),this._register(e.onDidChangeTokens(({ranges:i})=>{const n=i.map(o=>new rN(zt(o.fromLineNumber-1,0),zt(o.toLineNumber,0),zt(o.toLineNumber-o.fromLineNumber+1,0)));this.astWithTokens=this.parseDocumentFromTextBuffer(n,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()})),e.backgroundTokenizationState===0){const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new $7(this.textModel.getValue(),i);this.initialAstWithoutTokens=dN(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else e.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):e.backgroundTokenizationState===1&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleContentChanged(e){const t=e.changes.map(i=>{const n=S.lift(i.range);return new rN(Im(n.getStartPosition()),Im(n.getEndPosition()),O7(i.text))}).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,i){const n=t,o=new z7(this.textModel,this.brackets);return dN(o,e,n,i)}getBracketsInRange(e){const t=zt(e.startLineNumber-1,e.startColumn-1),i=zt(e.endLineNumber-1,e.endColumn-1),n=new Array,o=this.initialAstWithoutTokens||this.astWithTokens;return If(o,ga,o.length,t,i,n),n}getBracketPairsInRange(e,t){const i=new Array,n=Im(e.getStartPosition()),o=Im(e.getEndPosition()),r=this.initialAstWithoutTokens||this.astWithTokens,a=new t9(i,t,this.textModel);return TO(r,ga,r.length,n,o,a),i}}function If(s,e,t,i,n,o,r=0){if(s.kind===1){const a=Yf(e,t);o.push(new oN(a,r-1,!1))}else if(s.kind===3){const a=Yf(e,t);o.push(new oN(a,r-1,!0))}else if(s.kind===4)for(const a of s.children)t=Ni(e,a.length),ud(e,n)&&km(t,i)&&If(a,e,t,i,n,o,r),e=t;else if(s.kind===2){r++;{const a=s.openingBracket;t=Ni(e,a.length),ud(e,n)&&km(t,i)&&If(a,e,t,i,n,o,r),e=t}if(s.child){const a=s.child;t=Ni(e,a.length),ud(e,n)&&km(t,i)&&If(a,e,t,i,n,o,r),e=t}if(s.closingBracket){const a=s.closingBracket;t=Ni(e,a.length),ud(e,n)&&km(t,i)&&If(a,e,t,i,n,o,r),e=t}}}class t9{constructor(e,t,i){this.result=e,this.includeMinIndentation=t,this.textModel=i}}function TO(s,e,t,i,n,o,r=0){var a;if(s.kind===2){const d=Ni(e,s.openingBracket.length);let h=-1;o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),o.result.push(new E7(Yf(e,t),Yf(e,d),s.closingBracket?Yf(Ni(d,((a=s.child)===null||a===void 0?void 0:a.length)||ga),t):void 0,r,h)),r++}let l=e;for(const d of s.children){const h=l;l=Ni(l,d.length),ud(h,n)&&ud(i,l)&&TO(d,h,l,i,n,o,r)}}const AO={ColorContribution:"base.contributions.colors"};class i9{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 Br(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(`
  34. `)}}const yv=new i9;Xt.add(AO.ColorContribution,yv);function R(s,e,t,i,n){return yv.registerColor(s,e,t,i,n)}const ge=R("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},p("foreground","Overall foreground color. This color is only used if not overridden by a component.")),n9=R("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.")),b0=R("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},p("iconForeground","The default color for icons in the workbench.")),ul=R("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.")),Zt=R("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Xi=R("contrastActiveBorder",{light:null,dark:null,hc:ul},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),Vp=R("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},p("textLinkForeground","Foreground color for links in text.")),Hp=R("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),$x=R("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:W.black},p("textCodeBlockBackground","Background color for code blocks in text.")),fl=R("widget.shadow",{dark:wt(W.black,.36),light:wt(W.black,.16),hc:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),jx=R("input.background",{dark:"#3C3C3C",light:W.white,hc:W.black},p("inputBoxBackground","Input box background.")),Kx=R("input.foreground",{dark:ge,light:ge,hc:ge},p("inputBoxForeground","Input box foreground.")),qx=R("input.border",{dark:null,light:null,hc:Zt},p("inputBoxBorder","Input box border.")),yy=R("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Zt},p("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),Ly=R("inputOption.activeBackground",{dark:wt(ul,.4),light:wt(ul,.2),hc:W.transparent},p("inputOption.activeBackground","Background color of activated options in input fields.")),Dy=R("inputOption.activeForeground",{dark:W.white,light:W.black,hc:null},p("inputOption.activeForeground","Foreground color of activated options in input fields.")),Gx=R("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:W.black},p("inputValidationInfoBackground","Input validation background color for information severity.")),Zx=R("inputValidation.infoForeground",{dark:null,light:null,hc:null},p("inputValidationInfoForeground","Input validation foreground color for information severity.")),Yx=R("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:Zt},p("inputValidationInfoBorder","Input validation border color for information severity.")),RO=R("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:W.black},p("inputValidationWarningBackground","Input validation background color for warning severity.")),MO=R("inputValidation.warningForeground",{dark:null,light:null,hc:null},p("inputValidationWarningForeground","Input validation foreground color for warning severity.")),OO=R("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:Zt},p("inputValidationWarningBorder","Input validation border color for warning severity.")),PO=R("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:W.black},p("inputValidationErrorBackground","Input validation background color for error severity.")),FO=R("inputValidation.errorForeground",{dark:null,light:null,hc:null},p("inputValidationErrorForeground","Input validation foreground color for error severity.")),BO=R("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:Zt},p("inputValidationErrorBorder","Input validation border color for error severity.")),C0=R("dropdown.background",{dark:"#3C3C3C",light:W.white,hc:W.black},p("dropdownBackground","Dropdown background.")),hN=R("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:W.white},p("dropdownForeground","Dropdown foreground.")),s9=R("button.foreground",{dark:W.white,light:W.white,hc:W.white},p("buttonForeground","Button foreground color.")),xy=R("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},p("buttonBackground","Button background color.")),o9=R("button.hoverBackground",{dark:jO(xy,.2),light:$O(xy,.2),hc:null},p("buttonHoverBackground","Button background color when hovering.")),Xf=R("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:W.black},p("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Qf=R("badge.foreground",{dark:W.white,light:"#333",hc:W.white},p("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),zp=R("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},p("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Jf=R("scrollbarSlider.background",{dark:W.fromHex("#797979").transparent(.4),light:W.fromHex("#646464").transparent(.4),hc:wt(Zt,.6)},p("scrollbarSliderBackground","Scrollbar slider background color.")),eg=R("scrollbarSlider.hoverBackground",{dark:W.fromHex("#646464").transparent(.7),light:W.fromHex("#646464").transparent(.7),hc:wt(Zt,.8)},p("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),tg=R("scrollbarSlider.activeBackground",{dark:W.fromHex("#BFBFBF").transparent(.4),light:W.fromHex("#000000").transparent(.6),hc:Zt},p("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),r9=R("progressBar.background",{dark:W.fromHex("#0E70C0"),light:W.fromHex("#0E70C0"),hc:Zt},p("progressBarBackground","Background color of the progress bar that can show for long running operations.")),a9=R("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),ig=R("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},p("editorError.foreground","Foreground color of error squigglies in the editor.")),WO=R("editorError.border",{dark:null,light:null,hc:W.fromHex("#E47777").transparent(.8)},p("errorBorder","Border color of error boxes in the editor.")),l9=R("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),sa=R("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},p("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Lv=R("editorWarning.border",{dark:null,light:null,hc:W.fromHex("#FFCC00").transparent(.8)},p("warningBorder","Border color of warning boxes in the editor.")),d9=R("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),mo=R("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},p("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Xx=R("editorInfo.border",{dark:null,light:null,hc:W.fromHex("#3794FF").transparent(.8)},p("infoBorder","Border color of info boxes in the editor.")),h9=R("editorHint.foreground",{dark:W.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},p("editorHint.foreground","Foreground color of hint squigglies in the editor.")),c9=R("editorHint.border",{dark:null,light:null,hc:W.fromHex("#eeeeee").transparent(.8)},p("hintBorder","Border color of hint boxes in the editor.")),ms=R("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:W.black},p("editorBackground","Editor background color.")),el=R("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:W.white},p("editorForeground","Editor default foreground color.")),Zn=R("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},p("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),oa=R("editorWidget.foreground",{dark:ge,light:ge,hc:ge},p("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),xd=R("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:Zt},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.")),u9=R("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.")),cN=R("quickInput.background",{dark:Zn,light:Zn,hc:Zn},p("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),f9=R("quickInput.foreground",{dark:oa,light:oa,hc:oa},p("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),g9=R("quickInputTitle.background",{dark:new W(new Be(255,255,255,.105)),light:new W(new Be(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.")),p9=R("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:W.white},p("pickerGroupForeground","Quick picker color for grouping labels.")),m9=R("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:W.white},p("pickerGroupBorder","Quick picker color for grouping borders.")),_9=R("keybindingLabel.background",{dark:new W(new Be(128,128,128,.17)),light:new W(new Be(221,221,221,.4)),hc:W.transparent},p("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),b9=R("keybindingLabel.foreground",{dark:W.fromHex("#CCCCCC"),light:W.fromHex("#555555"),hc:W.white},p("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),C9=R("keybindingLabel.border",{dark:new W(new Be(51,51,51,.6)),light:new W(new Be(204,204,204,.4)),hc:new W(new Be(111,195,223))},p("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),v9=R("keybindingLabel.bottomBorder",{dark:new W(new Be(68,68,68,.6)),light:new W(new Be(187,187,187,.4)),hc:new W(new Be(111,195,223))},p("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),tl=R("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},p("editorSelectionBackground","Color of the editor selection.")),w9=R("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},p("editorSelectionForeground","Color of the selected text for high contrast.")),Qx=R("editor.inactiveSelectionBackground",{light:wt(tl,.5),dark:wt(tl,.5),hc:wt(tl,.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),Jx=R("editor.selectionHighlightBackground",{light:gN(tl,ms,.3,.6),dark:gN(tl,ms,.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),S9=R("editor.selectionHighlightBorder",{light:null,dark:null,hc:Xi},p("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),y9=R("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},p("editorFindMatch","Color of the current search match.")),ky=R("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),L9=R("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),D9=R("editor.findMatchBorder",{light:null,dark:null,hc:Xi},p("editorFindMatchBorder","Border color of the current search match.")),x9=R("editor.findMatchHighlightBorder",{light:null,dark:null,hc:Xi},p("findMatchHighlightBorder","Border color of the other search matches.")),k9=R("editor.findRangeHighlightBorder",{dark:null,light:null,hc:wt(Xi,.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),I9=R("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),Kd=R("editorHoverWidget.background",{light:Zn,dark:Zn,hc:Zn},p("hoverBackground","Background color of the editor hover.")),ek=R("editorHoverWidget.foreground",{light:oa,dark:oa,hc:oa},p("hoverForeground","Foreground color of the editor hover.")),tk=R("editorHoverWidget.border",{light:xd,dark:xd,hc:xd},p("hoverBorder","Border color of the editor hover.")),E9=R("editorHoverWidget.statusBarBackground",{dark:jO(Kd,.2),light:$O(Kd,.05),hc:Zn},p("statusBarBackground","Background color of the editor hover status bar.")),ik=R("editorLink.activeForeground",{dark:"#4E94CE",light:W.blue,hc:W.cyan},p("activeLinkForeground","Color of active links.")),kd=R("editorInlayHint.foreground",{dark:wt(Qf,.8),light:wt(Qf,.8),hc:Qf},p("editorInlayHintForeground","Foreground color of inline hints")),Id=R("editorInlayHint.background",{dark:wt(Xf,.6),light:wt(Xf,.3),hc:Xf},p("editorInlayHintBackground","Background color of inline hints")),N9=R("editorInlayHint.typeForeground",{dark:kd,light:kd,hc:kd},p("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),T9=R("editorInlayHint.typeBackground",{dark:Id,light:Id,hc:Id},p("editorInlayHintBackgroundTypes","Background color of inline hints for types")),A9=R("editorInlayHint.parameterForeground",{dark:kd,light:kd,hc:kd},p("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),R9=R("editorInlayHint.parameterBackground",{dark:Id,light:Id,hc:Id},p("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),M9=R("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},p("editorLightBulbForeground","The color used for the lightbulb actions icon.")),O9=R("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},p("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),Iy=new W(new Be(155,185,85,.2)),Ey=new W(new Be(255,0,0,.2)),VO=R("diffEditor.insertedTextBackground",{dark:Iy,light:Iy,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),HO=R("diffEditor.removedTextBackground",{dark:Ey,light:Ey,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),P9=R("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},p("diffEditorInsertedOutline","Outline color for the text that got inserted.")),F9=R("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},p("diffEditorRemovedOutline","Outline color for text that got removed.")),B9=R("diffEditor.border",{dark:null,light:null,hc:Zt},p("diffEditorBorder","Border color between the two text editors.")),W9=R("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.")),V9=R("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.")),H9=R("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.")),z9=R("list.focusOutline",{dark:ul,light:ul,hc:Xi},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.")),il=R("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.")),nl=R("list.activeSelectionForeground",{dark:W.white,light:W.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.")),N_=R("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.")),U9=R("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.")),$9=R("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.")),j9=R("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.")),K9=R("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.")),q9=R("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.")),G9=R("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},p("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Z9=R("list.hoverForeground",{dark:null,light:null,hc:null},p("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Y9=R("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},p("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),ra=R("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:ul},p("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),v0=R("list.focusHighlightForeground",{dark:ra,light:D6(il,ra,"#9DDDFF"),hc:ra},p("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),X9=R("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:W.black},p("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Q9=R("listFilterWidget.outline",{dark:W.transparent,light:W.transparent,hc:"#f38518"},p("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),J9=R("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:Zt},p("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),e6=R("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),t6=R("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),uN=R("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,p("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),T_=R("quickInputList.focusForeground",{dark:nl,light:nl,hc:nl},p("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),A_=R("quickInputList.focusIconForeground",{dark:N_,light:N_,hc:N_},p("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),R_=R("quickInputList.focusBackground",{dark:Mg(uN,il),light:Mg(uN,il),hc:null},p("quickInput.listFocusBackground","Quick picker background color for the focused item.")),i6=R("menu.border",{dark:null,light:null,hc:Zt},p("menuBorder","Border color of menus.")),n6=R("menu.foreground",{dark:hN,light:ge,hc:hN},p("menuForeground","Foreground color of menu items.")),s6=R("menu.background",{dark:C0,light:C0,hc:C0},p("menuBackground","Background color of menu items.")),o6=R("menu.selectionForeground",{dark:nl,light:nl,hc:nl},p("menuSelectionForeground","Foreground color of the selected menu item in menus.")),r6=R("menu.selectionBackground",{dark:il,light:il,hc:il},p("menuSelectionBackground","Background color of the selected menu item in menus.")),a6=R("menu.selectionBorder",{dark:null,light:null,hc:Xi},p("menuSelectionBorder","Border color of the selected menu item in menus.")),l6=R("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:Zt},p("menuSeparatorBackground","Color of a separator menu item in menus.")),d6=R("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},p("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),h6=R("editor.snippetTabstopHighlightBackground",{dark:new W(new Be(124,124,124,.3)),light:new W(new Be(10,50,100,.2)),hc:new W(new Be(124,124,124,.3))},p("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),c6=R("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},p("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),u6=R("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},p("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),f6=R("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new W(new Be(10,50,100,.5)),hc:"#525252"},p("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),nk=R("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),zO=R("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),UO=R("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},p("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),Dv=R("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},p("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),fN=R("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},p("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),g6=R("minimap.errorHighlight",{dark:new W(new Be(255,18,18,.7)),light:new W(new Be(255,18,18,.7)),hc:new W(new Be(255,50,50,1))},p("minimapError","Minimap marker color for errors.")),p6=R("minimap.warningHighlight",{dark:sa,light:sa,hc:Lv},p("overviewRuleWarning","Minimap marker color for warnings.")),m6=R("minimap.background",{dark:null,light:null,hc:null},p("minimapBackground","Minimap background color.")),_6=R("minimap.foregroundOpacity",{dark:W.fromHex("#000f"),light:W.fromHex("#000f"),hc:W.fromHex("#000f")},p("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),b6=R("minimapSlider.background",{light:wt(Jf,.5),dark:wt(Jf,.5),hc:wt(Jf,.5)},p("minimapSliderBackground","Minimap slider background color.")),C6=R("minimapSlider.hoverBackground",{light:wt(eg,.5),dark:wt(eg,.5),hc:wt(eg,.5)},p("minimapSliderHoverBackground","Minimap slider background color when hovering.")),v6=R("minimapSlider.activeBackground",{light:wt(tg,.5),dark:wt(tg,.5),hc:wt(tg,.5)},p("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),w6=R("problemsErrorIcon.foreground",{dark:ig,light:ig,hc:ig},p("problemsErrorIconForeground","The color used for the problems error icon.")),S6=R("problemsWarningIcon.foreground",{dark:sa,light:sa,hc:sa},p("problemsWarningIconForeground","The color used for the problems warning icon.")),y6=R("problemsInfoIcon.foreground",{dark:mo,light:mo,hc:mo},p("problemsInfoIconForeground","The color used for the problems info icon."));function L6(s,e){var t,i,n;switch(s.op){case 0:return(t=Br(s.value,e))===null||t===void 0?void 0:t.darken(s.factor);case 1:return(i=Br(s.value,e))===null||i===void 0?void 0:i.lighten(s.factor);case 2:return(n=Br(s.value,e))===null||n===void 0?void 0:n.transparent(s.factor);case 3:for(const a of s.values){const l=Br(a,e);if(l)return l}return;case 5:return Br(e.defines(s.if)?s.then:s.else,e);case 4:const o=Br(s.value,e);if(!o)return;const r=Br(s.background,e);return r?o.isDarkerThan(r)?W.getLighterColor(o,r,s.factor).transparent(s.transparency):W.getDarkerColor(o,r,s.factor).transparent(s.transparency):o.transparent(s.factor*s.transparency);default:throw lW()}}function $O(s,e){return{op:0,value:s,factor:e}}function jO(s,e){return{op:1,value:s,factor:e}}function wt(s,e){return{op:2,value:s,factor:e}}function Mg(...s){return{op:3,values:s}}function D6(s,e,t){return{op:5,if:s,then:e,else:t}}function gN(s,e,t,i){return{op:4,value:s,background:e,factor:t,transparency:i}}function Br(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?W.fromHex(s):e.getColor(s);if(s instanceof W)return s;if(typeof s=="object")return L6(s,e)}}const KO="vscode://schemas/workbench-colors";let qO=Xt.as(sv.JSONContribution);qO.registerSchema(KO,yv.getColorSchema());const pN=new Lt(()=>qO.notifySchemaChanged(KO),200);yv.onDidChangeSchema(()=>{pN.isScheduled()||pN.schedule()});const x6=R("editor.lineHighlightBackground",{dark:null,light:null,hc:null},p("lineHighlight","Background color for the highlight of line at the cursor position.")),mN=R("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),k6=R("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),I6=R("editor.rangeHighlightBorder",{dark:null,light:null,hc:Xi},p("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),E6=R("editor.symbolHighlightBackground",{dark:ky,light:ky,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),N6=R("editor.symbolHighlightBorder",{dark:null,light:null,hc:Xi},p("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),GO=R("editorCursor.foreground",{dark:"#AEAFAD",light:W.black,hc:W.white},p("caret","Color of the editor cursor.")),T6=R("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Ed=R("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},p("editorWhitespaces","Color of whitespace characters in the editor.")),xv=R("editorIndentGuide.background",{dark:Ed,light:Ed,hc:Ed},p("editorIndentGuides","Color of the editor indentation guides.")),kv=R("editorIndentGuide.activeBackground",{dark:Ed,light:Ed,hc:Ed},p("editorActiveIndentGuide","Color of the active editor indentation guides.")),ZO=R("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:W.white},p("editorLineNumbers","Color of editor line numbers.")),w0=R("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:Xi},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),A6=R("editorLineNumber.activeForeground",{dark:w0,light:w0,hc:w0},p("editorActiveLineNumber","Color of editor active line number")),R6=R("editorRuler.foreground",{dark:"#5A5A5A",light:W.lightgrey,hc:W.white},p("editorRuler","Color of the editor rulers.")),M6=R("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},p("editorCodeLensForeground","Foreground color of editor CodeLens")),O6=R("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},p("editorBracketMatchBackground","Background color behind matching brackets")),YO=R("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:Zt},p("editorBracketMatchBorder","Color for matching brackets boxes")),P6=R("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),F6=R("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.")),B6=R("editorGutter.background",{dark:ms,light:ms,hc:ms},p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),W6=R("editorUnnecessaryCode.border",{dark:null,light:null,hc:W.fromHex("#fff").transparent(.8)},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),V6=R("editorUnnecessaryCode.opacity",{dark:W.fromHex("#000a"),light:W.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.`)),XO=R("editorGhostText.border",{dark:null,light:null,hc:W.fromHex("#fff").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor.")),QO=R("editorGhostText.foreground",{dark:W.fromHex("#ffffff56"),light:W.fromHex("#0007"),hc:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),S0=new W(new Be(0,122,204,.6)),H6=R("editorOverviewRuler.rangeHighlightForeground",{dark:S0,light:S0,hc:S0},p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),z6=R("editorOverviewRuler.errorForeground",{dark:new W(new Be(255,18,18,.7)),light:new W(new Be(255,18,18,.7)),hc:new W(new Be(255,50,50,1))},p("overviewRuleError","Overview ruler marker color for errors.")),U6=R("editorOverviewRuler.warningForeground",{dark:sa,light:sa,hc:Lv},p("overviewRuleWarning","Overview ruler marker color for warnings.")),$6=R("editorOverviewRuler.infoForeground",{dark:mo,light:mo,hc:Xx},p("overviewRuleInfo","Overview ruler marker color for infos.")),JO=R("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),eP=R("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),tP=R("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),iP=R("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),nP=R("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),sP=R("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),j6=R("editorBracketHighlight.unexpectedBracket.foreground",{dark:new W(new Be(255,18,18,.8)),light:new W(new Be(255,18,18,.8)),hc:new W(new Be(255,50,50,1))},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),K6=R("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),q6=R("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),G6=R("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Z6=R("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Y6=R("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),X6=R("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Q6=R("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),J6=R("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),ez=R("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),tz=R("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),iz=R("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),nz=R("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));st((s,e)=>{const t=s.getColor(ms);t&&e.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${t}; }`);const i=s.getColor(el);i&&e.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${i}; }`);const n=s.getColor(B6);n&&e.addRule(`.monaco-editor .margin { background-color: ${n}; }`);const o=s.getColor(k6);o&&e.addRule(`.monaco-editor .rangeHighlight { background-color: ${o}; }`);const r=s.getColor(I6);r&&e.addRule(`.monaco-editor .rangeHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${r}; }`);const a=s.getColor(E6);a&&e.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=s.getColor(N6);l&&e.addRule(`.monaco-editor .symbolHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${l}; }`);const d=s.getColor(Ed);d&&(e.addRule(`.monaco-editor .mtkw { color: ${d} !important; }`),e.addRule(`.monaco-editor .mtkz { color: ${d} !important; }`))});class sz extends H{constructor(e){super(),this.textModel=e,this.colorProvider=new oP,this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.onDidChangeOptions(t=>{this.colorizationOptions=e.getOptions().bracketPairColorizationOptions})),this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}getDecorationsInRange(e,t,i){if(t===void 0)return[];if(!this.colorizationOptions.enabled)return[];const n=new Array,o=this.textModel.bracketPairs.getBracketsInRange(e);for(const r of o)n.push({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r)},ownerId:0,range:r.range});return n}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new S(1,1,this.textModel.getLineCount(),1),e,t):[]}}class oP{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}st((s,e)=>{const t=[JO,eP,tP,iP,nP,sP],i=new oP;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(j6)}; }`);let n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var oz=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},y0=function(s,e){return function(t,i){e(t,i,s)}};function rz(){return new v7}function az(s){const e=rz();return e.acceptChunk(s),e.finish()}function _N(s,e){return(typeof s=="string"?az(s):s).create(e)}let Em=0;const lz=999,dz=1e4;class hz{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 lf=()=>{throw new Error("Invalid change accessor")};class jr{constructor(){this._searchCanceledBrand=void 0}}jr.INSTANCE=new jr;function Nm(s){return s instanceof jr?null:s}let ts=class Vo extends H{constructor(e,t,i,n=null,o,r,a){super(),this._undoRedoService=o,this._modeService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new M),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new gz(u=>this.handleBeforeFireDecorationsChangedEvent(u))),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 pz),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new M),this.onBackgroundTokenizationStateChanged=this._onBackgroundTokenizationStateChanged.event,this._register(this._eventEmitter.fastEvent(u=>{this._onDidChangeContentOrInjectedText.fire(u.rawContentChangedEvent)})),Em++,this.id="$model"+Em,this.isForSimpleWidget=t.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=me.parse("inmemory://model/"+Em):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=_N(e,t.defaultEOL);this._buffer=l,this._bufferDisposable=d,this._options=Vo.resolveOptions(this._buffer,t);const h=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new S(1,1,h,this._buffer.getLineLength(h)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=c>Vo.LARGE_FILE_SIZE_THRESHOLD||h>Vo.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=c>Vo.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=i||dl,this._languageRegistryListener=this._languageConfigurationService.onDidChange(u=>{u.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=rM(Em),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new bN,this._commandManager=new Ox(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new rs(this._modeService.languageIdCodec),this._tokens2=new Vx(this._modeService.languageIdCodec),this._tokenization=new x7(this,this._modeService.languageIdCodec),this._bracketPairColorizer=this._register(new Q7(this,this._languageConfigurationService)),this._decorationProvider=this._register(new sz(this)),this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))}static resolveOptions(e,t){if(t.detectIndentation){const i=GE(e,t.tabSize,t.insertSpaces);return new y_({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new y_({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}get bracketPairs(){return this._bracketPairColorizer}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(this._backgroundTokenizationState===2)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._onBackgroundTokenizationStateChanged.fire())}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 Hc([],"",`
  35. `,!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._bracketPairColorizer.handleContentChanged(t),!this._isDisposing&&this._eventEmitter.fire(new Yb(e,t))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=_N(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 bN,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ld([new w7],this._versionId,!1,!1),this._createContentChanged2(new S(1,1,o,r),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
  36. `:`
  37. `;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 Ld([new L7],this._versionId,!1,!1),this._createContentChanged2(new S(1,1,o,r),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const o=t[i],r=o.range,a=o.cachedAbsoluteStart-o.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),d=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);o.cachedAbsoluteStart=l,o.cachedAbsoluteEnd=d,o.cachedVersionId=e,o.start=l-a,o.end=d-a,cl(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>=dz?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=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new y_({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;let l=this._options.createChangeEvent(a);this._options=a,this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();let i=GE(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=an(e);return n===-1&&(n=e.length),Vo._normalizeIndentationFromWhitespace(e.substring(0,n),t,i)+e.substring(n)}normalizeIndentation(e){return this._assertNotDisposed(),Vo.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(sM.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 hz(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()===`
  38. `?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 c=this.getLineMaxColumn(o);r>=c&&(r=c)}const a=e.endLineNumber,l=e.endColumn;let d=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),h=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(d<1)d=1,h=1;else if(d>t)d=t,h=this.getLineMaxColumn(d);else if(h<=1)h=1;else{const c=this.getLineMaxColumn(d);h>=c&&(h=c)}return i===o&&n===r&&a===d&&l===h&&e instanceof S&&!(e instanceof ne)?e:new S(o,r,d,h)}_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(Si(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 F(1,1);if(n>r)return new F(r,this.getLineMaxColumn(r));if(o<=1)return new F(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new F(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(Si(l))return new F(n,o-1)}return new F(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof F&&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=Si(a),h=Si(l);return!d&&!h}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof S&&!(e instanceof ne)&&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,h=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,c=Si(d),u=Si(h);return!c&&!u?new S(o,r,a,l):o===a&&r===l?new S(o,r-1,a,l-1):c&&u?new S(o,r-1,a,l+1):c?new S(o,r-1,a,l):new S(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 S(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=lz){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(c=>S.isIRange(c))&&(l=t.map(c=>this.validateRange(c)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((c,u)=>c.startLineNumber-u.startLineNumber||c.startColumn-u.startColumn);const d=[];d.push(l.reduce((c,u)=>S.areIntersecting(c,u)?c.plusRange(u):(d.push(c),u)));let h;if(!i&&e.indexOf(`
  39. `)<0){const u=new Yl(e,i,n,o).parseSearchRequest();if(!u)return[];h=f=>this.findMatchesLineByLine(f,u,r,a)}else h=c=>xm.findMatches(this,new Yl(e,i,n,o),c,r,a);return d.map(h).reduce((c,u)=>c.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
  40. `)<0){const d=new Yl(e,i,n,o).parseSearchRequest();if(!d)return null;const h=this.getLineCount();let c=new S(a.lineNumber,a.column,h,this.getLineMaxColumn(h)),u=this.findMatchesLineByLine(c,d,r,1);return xm.findNextMatch(this,new Yl(e,i,n,o),a,r),u.length>0||(c=new S(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(c,d,r,1),u.length>0)?u[0]:null}return xm.findNextMatch(this,new Yl(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return xm.findPreviousMatch(this,new Yl(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
  41. `?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 Kw?e:new Kw(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 h=0,c=n.length;h<c;h++){let u=n[h].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),h=!0;for(let c=0,u=n.length;c<u;c++){let f=n[c].range,g=n[c].text;if(!(l<f.startLineNumber||l>f.endLineNumber)&&!(l===f.startLineNumber&&f.startColumn===d&&f.isEmpty()&&g&&g.length>0&&g.charAt(0)===`
  42. `)&&!(l===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&g&&g.length>0&&g.charAt(g.length-1)===`
  43. `)){h=!1;break}}if(h){const c=new S(l,1,l,d);t.push(new Kw(null,c,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 S(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 S(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,h=r.length;d<h;d++){const c=r[d],[u,f,g]=nu(c.text);this._tokens.acceptEdit(c.range,u,f),this._tokens2.acceptEdit(c.range,u,f,g,c.text.length>0?c.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(c.rangeOffset,c.rangeLength,c.text.length,c.forceMoveMarkers)}let a=[];this._increaseVersionId();let l=i;for(let d=0,h=r.length;d<h;d++){const c=r[d],[u]=nu(c.text);this._onDidChangeDecorations.fire();const f=c.range.startLineNumber,g=c.range.endLineNumber,m=g-f,_=u,C=Math.min(m,_),b=_-m,v=o-l-b+f,w=v,y=v+_,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new F(w,1)),this.getOffsetAt(new F(y,this.getLineMaxColumn(y))),0),L=wo.fromDecorations(k),D=new Hf(L);for(let N=C;N>=0;N--){const B=f+N,O=v+N;D.takeFromEndWhile(K=>K.lineNumber>O);const $=D.takeFromEndWhile(K=>K.lineNumber===O);a.push(new sN(B,this.getLineContent(O),$))}if(C<m){const N=f+C;a.push(new S7(N+1,g))}if(C<_){const N=new Hf(L),B=f+C,O=_-C,$=o-l-O+B+1;let K=[],le=[];for(let de=0;de<O;de++){let _e=$+de;le[de]=this.getLineContent(_e),N.takeWhile(De=>De.lineNumber<_e),K[de]=N.takeWhile(De=>De.lineNumber===_e)}a.push(new y7(B+1,f+_,le,K))}l+=b}this._emitContentChangedEvent(new Ld(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 sN(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeContentOrInjectedText.fire(new IO(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,vN(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){Le(o)}return i.addDecoration=lf,i.changeDecoration=lf,i.changeDecorationOptions=lf,i.removeDecoration=lf,i.deltaDecorations=lf,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:CN[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(CN[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._decorationsTree.getNodeRange(this,t):null}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);const d=new S(r,1,a,l),h=this._getDecorationsInRange(d,i,n);return h.push(...this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e);const o=this._getDecorationsInRange(n,t,i);return o.push(...this._decorationProvider.getDecorationsInRange(n,t,i)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return wo.fromDecorations(n).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,n,o,t,i)}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);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.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 h=null;if(r<o){do h=this._decorations[t[r++]];while(!h&&r<o);if(h){if(h.options.after){const c=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(h.options.before){const c=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}this._decorationsTree.delete(h),this._onDidChangeDecorations.checkAffectedAndFire(h.options)}}if(l<a){if(!h){const _=++this._lastDecorationId,C=`${this._instanceId};${_}`;h=new LO(C,0,0),this._decorations[C]=h}const c=i[l],u=this._validateRangeRelaxedNoAllocations(c.range),f=vN(c.options),g=this._buffer.getOffsetAt(u.startLineNumber,u.startColumn),m=this._buffer.getOffsetAt(u.endLineNumber,u.endColumn);h.ownerId=e,h.reset(n,g,m,u),h.setOptions(f),h.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(u.endLineNumber),h.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(u.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(f),this._decorationsTree.insert(h),d[l]=h.id,l++}else h&&delete this._decorations[h.id]}return d}setTokens(e,t=!1){if(e.length!==0){let i=[];for(let n=0,o=e.length;n<o;n++){const r=e[n];let a=0,l=0,d=!1;for(let h=0,c=r.tokens.length;h<c;h++){const u=r.startLineNumber+h;d?(this._tokens.setTokens(this._languageId,u-1,this._buffer.getLineLength(u),r.tokens[h],!1),l=u):this._tokens.setTokens(this._languageId,u-1,this._buffer.getLineLength(u),r.tokens[h],!0)&&(d=!0,a=u,l=u)}d&&i.push({fromLineNumber:a,toLineNumber:l})}i.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:i})}this.handleTokenizationProgress(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._languageId,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;let t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new F(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}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]=Vo._findLanguageBoundaries(n,o),l=sb(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),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,h]=Vo._findLanguageBoundaries(n,o-1),c=sb(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(d,h),d);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c}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=this.getLanguageConfiguration(r).brackets;if(!a)return null;let l=a.textIsBracket[i];return l?Nm(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 h=t.getEndOffset(d);if(h<=a)break;if(Wo(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){a=h;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let d=n+1;d<o;d++){const h=t.getStartOffset(d);if(h>=l)break;if(Wo(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){l=h;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=this.getLanguageConfiguration(i.getLanguageId(o)).brackets;if(r&&!Wo(i.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,i,r,o),d=null;for(;;){const h=Is.findNextBracketInRange(r.forwardRegex,t,n,a,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const c=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),u=this._matchFoundBracket(h,r.textIsBracket[c],r.textIsOpenBracket[c],null);if(u){if(u instanceof jr)return null;d=u}}a=h.endColumn-1}if(d)return d}if(o>0&&i.getStartOffset(o)===e.column-1){const a=o-1,l=this.getLanguageConfiguration(i.getLanguageId(a)).brackets;if(l&&!Wo(i.getStandardTokenType(a))){let{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,i,l,a);const c=Is.findPrevBracketInRange(l.reversedRegex,t,n,d,h);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn){const u=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),f=this._matchFoundBracket(c,l.textIsBracket[u],l.textIsOpenBracket[u],null);if(f)return f instanceof jr?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 jr?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(d,h,c,u)=>{for(;;){if(i&&++a%100===0&&!i())return jr.INSTANCE;const f=Is.findPrevBracketInRange(o,d,h,c,u);if(!f)break;const g=h.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 h=this._getLineTokens(d),c=h.getCount(),u=this._buffer.getLineContent(d);let f=c-1,g=u.length,m=u.length;d===t.lineNumber&&(f=h.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let _=!0;for(;f>=0;f--){const C=h.getLanguageId(f)===n&&!Wo(h.getStandardTokenType(f));if(C)_?g=h.getStartOffset(f):(g=h.getStartOffset(f),m=h.getEndOffset(f));else if(_&&g!==m){const b=l(d,u,g,m);if(b)return b}_=C}if(_&&g!==m){const C=l(d,u,g,m);if(C)return C}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(h,c,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return jr.INSTANCE;const g=Is.findNextBracketInRange(o,h,c,u,f);if(!g)break;const m=c.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 h=t.lineNumber;h<=d;h++){const c=this._getLineTokens(h),u=c.getCount(),f=this._buffer.getLineContent(h);let g=0,m=0,_=0;h===t.lineNumber&&(g=c.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let C=!0;for(;g<u;g++){const b=c.getLanguageId(g)===n&&!Wo(c.getStandardTokenType(g));if(b)C||(m=c.getStartOffset(g)),_=c.getEndOffset(g);else if(C&&m!==_){const v=l(h,f,m,_);if(v)return v}C=b}if(C&&m!==_){const b=l(h,f,m,_);if(b)return b}}return null}findPrevBracket(e){const t=this.validatePosition(e);let i=null,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,h=l.length,c=l.length;if(o===t.lineNumber){d=r.findTokenIndexAtOffset(t.column-1),h=t.column-1,c=t.column-1;const f=r.getLanguageId(d);i!==f&&(i=f,n=this.getLanguageConfiguration(i).brackets)}let u=!0;for(;d>=0;d--){const f=r.getLanguageId(d);if(i!==f){if(n&&u&&h!==c){const m=Is.findPrevBracketInRange(n.reversedRegex,o,l,h,c);if(m)return this._toFoundBracket(n,m);u=!1}i=f,n=this.getLanguageConfiguration(i).brackets}const g=!!n&&!Wo(r.getStandardTokenType(d));if(g)u?h=r.getStartOffset(d):(h=r.getStartOffset(d),c=r.getEndOffset(d));else if(n&&u&&h!==c){const m=Is.findPrevBracketInRange(n.reversedRegex,o,l,h,c);if(m)return this._toFoundBracket(n,m)}u=g}if(n&&u&&h!==c){const f=Is.findPrevBracketInRange(n.reversedRegex,o,l,h,c);if(f)return this._toFoundBracket(n,f)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=null,o=null;for(let r=t.lineNumber;r<=i;r++){const a=this._getLineTokens(r),l=a.getCount(),d=this._buffer.getLineContent(r);let h=0,c=0,u=0;if(r===t.lineNumber){h=a.findTokenIndexAtOffset(t.column-1),c=t.column-1,u=t.column-1;const g=a.getLanguageId(h);n!==g&&(n=g,o=this.getLanguageConfiguration(n).brackets)}let f=!0;for(;h<l;h++){const g=a.getLanguageId(h);if(n!==g){if(o&&f&&c!==u){const _=Is.findNextBracketInRange(o.forwardRegex,r,d,c,u);if(_)return this._toFoundBracket(o,_);f=!1}n=g,o=this.getLanguageConfiguration(n).brackets}const m=!!o&&!Wo(a.getStandardTokenType(h));if(m)f||(c=a.getStartOffset(h)),u=a.getEndOffset(h);else if(o&&f&&c!==u){const _=Is.findNextBracketInRange(o.forwardRegex,r,d,c,u);if(_)return this._toFoundBracket(o,_)}f=m}if(o&&f&&c!==u){const g=Is.findNextBracketInRange(o.forwardRegex,r,d,c,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 _=0,C=g?g.brackets.length:0;_<C;_++)m[_]=0;r.set(f,m)}a=r.get(f)};let d=0;const h=(f,g,m,_,C)=>{for(;;){if(i&&++d%100===0&&!i())return jr.INSTANCE;const b=Is.findNextBracketInRange(f.forwardRegex,g,m,_,C);if(!b)break;const v=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[v];if(w&&(w.isOpen(v)?a[w.index]++:w.isClose(v)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!1,i);_=b.endColumn-1}return null};let c=null,u=null;for(let f=n.lineNumber;f<=o;f++){const g=this._getLineTokens(f),m=g.getCount(),_=this._buffer.getLineContent(f);let C=0,b=0,v=0;if(f===n.lineNumber){C=g.findTokenIndexAtOffset(n.column-1),b=n.column-1,v=n.column-1;const y=g.getLanguageId(C);c!==y&&(c=y,u=this.getLanguageConfiguration(c).brackets,l(c,u))}let w=!0;for(;C<m;C++){const y=g.getLanguageId(C);if(c!==y){if(u&&w&&b!==v){const L=h(u,f,_,b,v);if(L)return Nm(L);w=!1}c=y,u=this.getLanguageConfiguration(c).brackets,l(c,u)}const k=!!u&&!Wo(g.getStandardTokenType(C));if(k)w||(b=g.getStartOffset(C)),v=g.getEndOffset(C);else if(u&&w&&b!==v){const L=h(u,f,_,b,v);if(L)return Nm(L)}w=k}if(u&&w&&b!==v){const y=h(u,f,_,b,v);if(y)return Nm(y)}}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 Vo.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=this.getLanguageConfiguration(this._languageId).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,d=-2,h=-1;const c=L=>{if(a!==-1&&(a===-2||a>L-1)){a=-1,l=-1;for(let D=L-2;D>=0;D--){let N=this._computeIndentLevel(D);if(N>=0){a=D,l=N;break}}}if(d===-2){d=-1,h=-1;for(let D=L;D<n;D++){let N=this._computeIndentLevel(D);if(N>=0){d=D,h=N;break}}}};let u=-2,f=-1,g=-2,m=-1;const _=L=>{if(u===-2){u=-1,f=-1;for(let D=L-2;D>=0;D--){let N=this._computeIndentLevel(D);if(N>=0){u=D,f=N;break}}}if(g!==-1&&(g===-2||g<L-1)){g=-1,m=-1;for(let D=L;D<n;D++){let N=this._computeIndentLevel(D);if(N>=0){g=D,m=N;break}}}};let C=0,b=!0,v=0,w=!0,y=0,k=0;for(let L=0;b||w;L++){const D=e-L,N=e+L;L>1&&(D<1||D<t)&&(b=!1),L>1&&(N>n||N>i)&&(w=!1),L>5e4&&(b=!1,w=!1);let B=-1;if(b){const $=this._computeIndentLevel(D-1);$>=0?(d=D-1,h=$,B=Math.ceil($/this._options.indentSize)):(c(D),B=this._getIndentLevelForWhitespaceLine(r,l,h))}let O=-1;if(w){const $=this._computeIndentLevel(N-1);$>=0?(u=N-1,f=$,O=Math.ceil($/this._options.indentSize)):(_(N),O=this._getIndentLevelForWhitespaceLine(r,f,m))}if(L===0){k=B;continue}if(L===1){if(N<=n&&O>=0&&k+1===O){b=!1,C=N,v=N,y=O;continue}if(D>=1&&B>=0&&B-1===k){w=!1,C=D,v=D,y=B;continue}if(C=e,v=e,y=k,y===0)return{startLineNumber:C,endLineNumber:v,indent:y}}b&&(B>=y?C=D:b=!1),w&&(O>=y?v=N:w=!1)}return{startLineNumber:C,endLineNumber:v,indent:y}}getLinesBracketGuides(e,t,i,n){var o,r,a,l,d;const h=[],c=this._bracketPairColorizer.getBracketPairsInRangeWithMinIndentation(new S(e,1,t,this.getLineMaxColumn(t)));let u;if(i&&c.length>0){const C=e<=i.lineNumber&&i.lineNumber<=t?c.filter(b=>b.range.containsPosition(i)):this._bracketPairColorizer.getBracketPairsInRange(S.fromPositions(i));u=(o=QV(C,b=>b.range.startLineNumber!==b.range.endLineNumber))===null||o===void 0?void 0:o.range}const f=new Hf(c),g=new Array,m=new Array,_=new rP;for(let C=e;C<=t;C++){let b=new Array;m.length>0&&(b=b.concat(m),m.length=0),h.push(b);for(const w of f.takeWhile(y=>y.openingBracketRange.startLineNumber<=C)||[]){if(w.range.startLineNumber===w.range.endLineNumber)continue;const y=Math.min(this.getVisibleColumnFromPosition(w.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition((a=(r=w.closingBracketRange)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:w.range.getEndPosition()),w.minVisibleColumnIndentation+1);let k=!1;w.closingBracketRange&&an(this.getLineContent(w.closingBracketRange.startLineNumber))<w.closingBracketRange.startColumn-1&&(k=!0);const L=w.openingBracketRange.getStartPosition(),D=(d=(l=w.closingBracketRange)===null||l===void 0?void 0:l.getStartPosition())!==null&&d!==void 0?d:w.range.getEndPosition();w.closingBracketRange===void 0?g[w.nestingLevel]=null:g[w.nestingLevel]={nestingLevel:w.nestingLevel,guideVisibleColumn:y,start:L,visibleStartColumn:this.getVisibleColumnFromPosition(L),end:D,visibleEndColumn:this.getVisibleColumnFromPosition(D),bracketPair:w,renderHorizontalEndLineAtTheBottom:k}}for(const w of g){if(!w)continue;const y=u&&w.bracketPair.range.equalsRange(u),k=_.getInlineClassNameOfLevel(w.nestingLevel)+(n.highlightActive&&y?" "+_.activeClassName:"");(y&&n.horizontalGuides!==Sd.Disabled||n.includeInactive&&n.horizontalGuides===Sd.Enabled)&&(w.start.lineNumber===C&&w.guideVisibleColumn<w.visibleStartColumn&&b.push(new mc(w.guideVisibleColumn,k,new X1(!1,w.start.column))),w.end.lineNumber===C+1&&w.guideVisibleColumn<w.visibleEndColumn&&m.push(new mc(w.guideVisibleColumn,k,new X1(!w.renderHorizontalEndLineAtTheBottom,w.end.column))))}let v=Number.MAX_SAFE_INTEGER;for(let w=g.length-1;w>=0;w--){const y=g[w];if(!y)continue;const k=n.highlightActive&&u&&y.bracketPair.range.equalsRange(u),L=_.getInlineClassNameOfLevel(y.nestingLevel)+(k?" "+_.activeClassName:"");(k||n.includeInactive)&&y.renderHorizontalEndLineAtTheBottom&&y.end.lineNumber===C+1&&m.push(new mc(y.guideVisibleColumn,L,null)),!(y.end.lineNumber<=C||y.start.lineNumber>=C)&&(y.guideVisibleColumn>=v&&!k||(v=y.guideVisibleColumn,(k||n.includeInactive)&&b.push(new mc(y.guideVisibleColumn,L,null))))}b.sort((w,y)=>w.visibleColumn-y.visibleColumn)}return h}getVisibleColumnFromPosition(e){return ct.visibleColumnFromColumn(this.getLineContent(e.lineNumber),e.column,this._options.tabSize)+1}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=this.getLanguageConfiguration(this._languageId).foldingRules,o=!!(n&&n.offSide);let r=new Array(t-e+1),a=-2,l=-1,d=-2,h=-1;for(let c=e;c<=t;c++){let u=c-e;const f=this._computeIndentLevel(c-1);if(f>=0){a=c-1,l=f,r[u]=Math.ceil(f/this._options.indentSize);continue}if(a===-2){a=-1,l=-1;for(let g=c-2;g>=0;g--){let m=this._computeIndentLevel(g);if(m>=0){a=g,l=m;break}}}if(d!==-1&&(d===-2||d<c-1)){d=-1,h=-1;for(let g=c;g<i;g++){let m=this._computeIndentLevel(g);if(m>=0){d=g,h=m;break}}}r[u]=this._getIndentLevelForWhitespaceLine(o,l,h)}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 cz(this.getLineContent(e))+1}};ts.MODEL_SYNC_LIMIT=50*1024*1024;ts.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;ts.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;ts.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Gi.tabSize,indentSize:Gi.indentSize,insertSpaces:Gi.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Gi.trimAutoWhitespace,largeFileOptimizations:Gi.largeFileOptimizations,bracketPairColorizationOptions:Gi.bracketPairColorizationOptions};ts=oz([y0(4,Wp),y0(5,Qi),y0(6,Pp)],ts);function cz(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}class rP{constructor(){this.activeClassName="indent-active"}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}function L0(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function D0(s){return!!s.options.after||!!s.options.before}class bN{constructor(){this._decorationsTree0=new c0,this._decorationsTree1=new c0,this._injectedTextDecorationsTree=new c0}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o){const r=e.getVersionId(),a=this._intervalSearch(t,i,n,o,r);return this._ensureNodesHaveRanges(e,a)}_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){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n){const o=e.getVersionId(),r=this._search(t,i,n,o);return this._ensureNodesHaveRanges(e,r)}_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){D0(e)?this._injectedTextDecorationsTree.insert(e):L0(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){D0(e)?this._injectedTextDecorationsTree.delete(e):L0(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){D0(e)?this._injectedTextDecorationsTree.resolveNode(e,t):L0(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 xa(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class aP{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class uz extends aP{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Xn.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 fz extends aP{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"?W.fromHex(e):t.getColor(e.id)}}class Og{constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1}static from(e){return e instanceof Og?e:new Og(e)}}class Ee{constructor(e){this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?xa(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 uz(e.overviewRuler):null,this.minimap=e.minimap?new fz(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?xa(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?xa(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?xa(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?xa(e.marginClassName):null,this.inlineClassName=e.inlineClassName?xa(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?xa(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?xa(e.afterContentClassName):null,this.after=e.after?Og.from(e.after):null,this.before=e.before?Og.from(e.before):null}static register(e){return new Ee(e)}static createDynamic(e){return new Ee(e)}}Ee.EMPTY=Ee.register({description:"empty"});const CN=[Ee.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Ee.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Ee.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Ee.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function vN(s){return s instanceof Ee?s:Ee.createDynamic(s)}class gz extends H{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 pz extends H{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 mz=()=>!0,wN=()=>!1,_z=s=>s===" "||s===" ";class Rs{constructor(e,t,i){this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const n=i.options,o=n.get(129);this.readOnly=n.get(80),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(103),this.lineHeight=n.get(58),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(114),this.wordSeparators=n.get(115),this.emptySelectionClipboard=n.get(32),this.copyWithSyntaxHighlighting=n.get(21),this.multiCursorMergeOverlapping=n.get(68),this.multiCursorPaste=n.get(70),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:Rs._getShouldAutoClose(e,this.autoClosingQuotes),bracket:Rs._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=Qe.getAutoClosingPairs(e);let r=Rs._getSurroundingPairs(e);if(r)for(const a of r)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(129)||e.hasChanged(115)||e.hasChanged(32)||e.hasChanged(68)||e.hasChanged(70)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(114)||e.hasChanged(58)||e.hasChanged(80)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=Rs._getElectricCharacters(this._languageId);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return ts.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return Qe.getElectricCharacters(e)}catch(t){return Le(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return _z;case"languageDefined":return Rs._getLanguageDefinedShouldAutoClose(e);case"always":return mz;case"never":return wN}}static _getLanguageDefinedShouldAutoClose(e){try{const t=Qe.getAutoCloseBeforeSet(e);return i=>t.indexOf(i)!==-1}catch(t){return Le(t),wN}}static _getSurroundingPairs(e){try{return Qe.getSurroundingPairs(e)}catch(t){return Le(t),null}}}class vi{constructor(e,t,i,n){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=vi._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 vi(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new F(t,i),n):new vi(new S(t,i,t,i),n,new F(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 ne(i,n,o,r)}}class SN{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class bz{constructor(e){this.modelState=e,this.viewState=null}}class Cz{constructor(e){this.modelState=null,this.viewState=e}}let Re=class lP{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new bz(e)}static fromViewState(e){return new Cz(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,r=new vi(new S(t,i,t,i),0,new F(n,o),0);return lP.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 Dn{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function uc(s){return s==="'"||s==='"'||s==="`"}class Pg{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=ct.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]=Pg.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=ct.nextRenderTabStop(u,i);break;default:return-1}}return u===a+i?r:-1}const h=ct.nextRenderTabStop(l,i);let c=l;for(let u=t;u<o;u++){if(c===h)return u;switch(e.charCodeAt(u)){case 32:c+=1;break;case 9:c=ct.nextRenderTabStop(c,i);break;default:return-1}}return c===h?o:-1}}class Ma{constructor(e=null){this.hitTarget=e,this.type=0}}class Ny{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var nd;(function(s){function e(t,i,n){const o=t.getPositionFromDOMInfo(i,n);return o?new Ny(o,i,null):new Ma(i)}s.createFromDOMInfo=e})(nd||(nd={}));class vz{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class to{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 S(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 to.toString(this)}}class xs{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 ou{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(129),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(58),this.stickyTabStops=n.get(103),this.typicalHalfwidthCharacterWidth=n.get(43).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return ou.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 F(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new F(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 S(n,o,n,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.model.getLineMaxColumn(t);return{range:new S(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 ou._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 wz{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,Fi._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class sk extends wz{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=fr.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}
  44. 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=ct.visibleColumnFromColumn(this._ctx.model.getLineContent(t.lineNumber),t.column,this._ctx.model.getTextModelOptions().tabSize)+1),new to(this.target,e,o,t,i,n)}withTarget(e){return new sk(this._ctx,this.editorPos,this.pos,e)}}const yN={isAfterLines:!0};function x0(s){return{isAfterLines:!1,horizontalDistanceToText:s}}class Fi{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=fr.collect(t,this._viewHelper.viewDomNode);return!!(xs.isChildOfContentWidgets(i)||xs.isChildOfOverflowingContentWidgets(i)||xs.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n){const o=new ou(this._context,this._viewHelper,e),r=new sk(o,t,i,n);try{return Fi._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=Fi._doHitTest(e,t);return r.type===1?Fi.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const n=t;let o=null;return o=o||Fi._hitTestContentWidget(e,n),o=o||Fi._hitTestOverlayWidget(e,n),o=o||Fi._hitTestMinimap(e,n),o=o||Fi._hitTestScrollbarSlider(e,n),o=o||Fi._hitTestViewZone(e,n),o=o||Fi._hitTestMargin(e,n),o=o||Fi._hitTestViewCursor(e,n),o=o||Fi._hitTestTextArea(e,n),o=o||Fi._hitTestViewLines(e,n,i),o=o||Fi._hitTestScrollbar(e,n),o||t.fulfill(0)}static _hitTestContentWidget(e,t){if(xs.isChildOfContentWidgets(t.targetPath)||xs.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(xs.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 xs.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(!xs.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new F(1,1),null,yN);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return t.fulfill(7,new F(o,r),null,yN)}if(i){if(xs.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.model.getLineLength(o)===0){const a=e.getLineWidth(o),l=x0(t.mouseContentHorizontalOffset-a);return t.fulfill(7,new F(o,1),null,l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=x0(t.mouseContentHorizontalOffset-r),l=new F(o,e.model.getLineMaxColumn(o));return t.fulfill(7,l,null,a)}}return t.fulfill(0)}const n=Fi._doHitTest(e,t);return n.type===1?Fi.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(xs.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new F(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(xs.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 F(n,o))}}return null}static _hitTestScrollbar(e,t){if(xs.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new F(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(129),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return Fi._getMouseColumn(o,i.get(43).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const _=x0(t.mouseContentHorizontalOffset-l);return t.fulfill(7,n,null,_)}const d=e.visibleRangeForPosition(r,a);if(!d)return t.fulfill(0,n);const h=d.left;if(t.mouseContentHorizontalOffset===h)return t.fulfill(6,n,null,{mightBeForeignElement:!!o});const c=[];if(c.push({offset:d.left,column:a}),a>1){const _=e.visibleRangeForPosition(r,a-1);_&&c.push({offset:_.left,column:a-1})}const u=e.model.getLineMaxColumn(r);if(a<u){const _=e.visibleRangeForPosition(r,a+1);_&&c.push({offset:_.left,column:a+1})}c.sort((_,C)=>_.offset-C.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),m=g.left<=f.clientX&&f.clientX<=g.right;for(let _=1;_<c.length;_++){const C=c[_-1],b=c[_];if(C.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=b.offset){const v=new S(r,C.column,r,b.column);return t.fulfill(6,n,v,{mightBeForeignElement:!m||!!o})}}return t.fulfill(6,n,null,{mightBeForeignElement:!m||!!o})}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 Mx(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=bh(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=Sz(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Ma;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)===Xo.CLASS_NAME?nd.createFromDOMInfo(e,r,n.startOffset):new Ma(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)===Xo.CLASS_NAME?nd.createFromDOMInfo(e,o,o.textContent.length):new Ma(o)}return new Ma}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)===Xo.CLASS_NAME?nd.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Ma(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===Xo.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return nd.createFromDOMInfo(e,l,0)}else if(a===Xo.CLASS_NAME)return nd.createFromDOMInfo(e,i.offsetNode,0)}return new Ma(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.getTextModelOptions(),o=Pg.atomicPosition(i,e.column-1,n,2);return o!==-1?new F(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Ma;if(typeof document.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const n=e.model.getInjectedTextAt(i.position),o=e.model.normalizePosition(i.position,2);(n||!o.equals(i.position))&&(i=new Ny(o,i.spanNode,n))}return i.type===1&&e.stickyTabStops&&(i=new Ny(this._snapToSoftTabBoundary(i.position,e.model),i.spanNode,i.injectedText)),i}}function Sz(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,h;if(e>o.left+o.width)d=a.length;else{const c=fd.getInstance();for(let u=0;u<a.length+1;u++){if(h=c.getCharWidth(a.charAt(u),r)/2,l+=h,e<l){d=u;break}l+=h}}i.setStart(n.firstChild,d),i.setEnd(n.firstChild,d)}return i}class fd{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return fd._INSTANCE||(fd._INSTANCE=new fd),fd._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}}fd._INSTANCE=null;function Jb(s){return function(e,t){let i=!1;return s&&(i=s.mouseTargetIsWidget(t)),i||t.preventDefault(),t}}class qd extends Bp{constructor(e,t,i){super(),this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Fi(this._context,i),this._mouseDownOperation=this._register(new yz(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(129).height;const n=new T8(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),Jb(this.mouseTargetFactory),qd.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(67))return;const a=new qc(r);if(Me?(r.metaKey||r.ctrlKey)&&!r.shiftKey&&!r.altKey:r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey){const d=fa.getZoomLevel(),h=a.deltaY>0?1:-1;fa.setZoomLevel(d+h),a.preventDefault(),a.stopPropagation()}};this._register(q(this.viewHelper.viewDomNode,ue.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(129)){const t=this._context.configuration.options.get(129).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 bO(e,t).toPageCoordinates(),o=CO(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){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=bh(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?i: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(97),a=t.type===8||t.type===5,l=t.type===9;let d=e.leftButton||e.middleButton;Me&&e.leftButton&&e.ctrlKey&&(d=!1);const h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(i||o&&r))h(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const c=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(c.viewZoneId)&&(h(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}qd.MOUSE_MOVE_MINIMUM_TIME=100;class yz extends H{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 R8(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new hn),this._mouseState=new Iv,this._currentSelection=new ne(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(80)&&n.get(31)&&!n.get(18)&&!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,Jb(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,Jb(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=ou.getZoneAtCoord(this._context,a);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return new to(null,13,o,h)}const d=n.getLineNumberAtVerticalOffset(a);return new to(null,13,o,new F(d,1))}if(e.posy>t.y+t.height){const a=n.getCurrentScrollTop()+(e.posy-t.y),l=ou.getZoneAtCoord(this._context,a);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return new to(null,13,o,h)}const d=n.getLineNumberAtVerticalOffset(a);return new to(null,13,o,new F(d,i.getLineMaxColumn(d)))}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posx<t.x?new to(null,13,o,new F(r,1)):e.posx>t.x+t.width?new to(null,13,o,new F(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 to(n.element,n.type,n.mouseColumn,r,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new F(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 Iv{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>Iv.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)}}Iv.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var Os;(function(s){s.text="text/plain",s.binary="application/octet-stream",s.unknown="application/unknown",s.markdown="text/markdown",s.latex="text/latex"})(Os||(Os={}));let Fg=[],ok=[],rk=[];function Tm(s,e=!1){const t=Lz(s);Fg.push(t),t.userConfigured?rk.push(t):ok.push(t),e&&!t.userConfigured&&Fg.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 Lz(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?gM(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(oi.sep)>=0:!1}}function Dz(s){Fg=[],ok=[],rk=[]}function xz(s,e){let t;if(s)switch(s.scheme){case Te.file:t=s.fsPath;break;case Te.data:t=ll.parseMetaData(s).get(ll.META_DATA_LABEL);break;default:t=s.path}if(!t)return[Os.unknown];t=t.toLowerCase();const i=bd(t),n=LN(t,i,rk);if(n)return[n,Os.text];const o=LN(t,i,ok);if(o)return[o,Os.text];if(e){const r=kz(e);if(r)return[r,Os.text]}return[Os.unknown]}function LN(s,e,t){var i;let n=null,o=null,r=null;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){n=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const d=l.filepatternOnPath?s:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,d)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}return n?n.mime:o?o.mime:r?r.mime:null}function kz(s){if(nx(s)&&(s=s.substr(1)),s.length>0)for(let e=Fg.length-1;e>=0;e--){const t=Fg[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t.mime}return null}class ci{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 ci(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new ci(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(`
  45. `,o+1))!==-1;)n++;return[e,i*t.length,n]}static selectedText(e){return new ci(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 h=n.substring(r),c=a.substring(d),u=fb(h,c);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=Zc(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 C=null;if(l===a.length?a.startsWith(n)&&(C=a.substring(n.length)):a.endsWith(n)&&(C=a.substring(0,a.length-n.length)),C!==null&&C.length>0&&(/\uFE0F/.test(C)||A3(C)))return{text:C,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}if(l===d){if(n===a&&o===0&&r===n.length&&l===a.length&&a.indexOf(`
  46. `)===-1&&M3(a))return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const C=f.length-m;return{text:a,replacePrevCharCnt:C,replaceNextCharCnt:0,positionDelta:0}}const _=r-o;return{text:a,replacePrevCharCnt:_,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(Zc(e.value,t.value),e.selectionEnd),n=Math.min(fb(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}}}ci.EMPTY=new ci("",0,0,null,null);class wc{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 S(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const r=wc._getPageOfLine(i.startLineNumber,n),a=wc._getRangeForPage(r,n),l=wc._getPageOfLine(i.endLineNumber,n),d=wc._getRangeForPage(l,n),h=a.intersectRanges(new S(1,1,i.startLineNumber,i.startColumn));let c=t.getValueInRange(h,1);const u=t.getLineCount(),f=t.getLineMaxColumn(u),g=d.intersectRanges(new S(i.endLineNumber,i.endColumn,u,f));let m=t.getValueInRange(g,1),_;if(r===l||r+1===l)_=t.getValueInRange(i,1);else{const C=a.intersectRanges(i),b=d.intersectRanges(i);_=t.getValueInRange(C,1)+"…"+t.getValueInRange(b,1)}return o&&(c.length>500&&(c=c.substring(c.length-500,c.length)),m.length>500&&(m=m.substring(0,500)),_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length))),new ci(c+_+m,c.length,c.length+_.length,new F(i.startLineNumber,i.startColumn),new F(i.endLineNumber,i.endColumn))}}var eC;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(eC||(eC={}));const Ty={forceCopyWithSyntaxHighlighting:!1};class Bg{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)}}Bg.INSTANCE=new Bg;class Iz extends H{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 Ez(t)),this._asyncTriggerCut=this._register(new Lt(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Lt(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=ci.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(ii(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(ii(t.domNode,"keyup",a=>{this._onKeyUp.fire(a)})),this._register(q(t.domNode,"compositionstart",a=>{if(!this._isDoingComposition){if(this._isDoingComposition=!0,Me&&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")||rn)){this._textAreaState=new ci(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new F(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),this._onCompositionStart.fire({revealDeltaColumns:-1});return}if(yf){this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart});return}this._setAndWriteTextAreaState("compositionstart",ci.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0})}}));const n=a=>{const l=this._textAreaState,d=ci.readFromTextArea(this._textArea);return[d,ci.deduceInput(l,d,a)]},o=()=>{const a=this._textAreaState,l=ci.readFromTextArea(this._textArea);return[l,ci.deduceAndroidCompositionInput(a,l)]},r=a=>{const l=this._textAreaState,d=ci.selectedText(a),h={text:d.value,replacePrevCharCnt:l.selectionEnd-l.selectionStart,replaceNextCharCnt:0,positionDelta:0};return[d,h]};this._register(q(t.domNode,"compositionupdate",a=>{if(yf){const[h,c]=o();this._textAreaState=h,this._onType.fire(c),this._onCompositionUpdate.fire(a);return}const[l,d]=r(a.data||"");this._textAreaState=l,this._onType.fire(d),this._onCompositionUpdate.fire(a)})),this._register(q(t.domNode,"compositionend",a=>{if(!this._isDoingComposition)return;if(this._isDoingComposition=!1,yf){const[h,c]=o();this._textAreaState=h,this._onType.fire(c),this._onCompositionEnd.fire();return}const[l,d]=r(a.data||"");this._textAreaState=l,this._onType.fire(d),(db||rn)&&(this._textAreaState=ci.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()})),this._register(q(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[a,l]=n(Me);l.replacePrevCharCnt===0&&l.text.length===1&&Si(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(q(t.domNode,"cut",a=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(a),this._asyncTriggerCut.schedule()})),this._register(q(t.domNode,"copy",a=>{this._ensureClipboardGetsEditorSelection(a)})),this._register(q(t.domNode,"paste",a=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),df.canUseTextData(a)){const[l,d]=df.getTextData(a);l!==""&&this._firePaste(l,d)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",ci.EMPTY),this._nextCommand=1})),this._register(q(t.domNode,"focus",()=>{const a=this._hasFocus;this._setHasFocus(!0),Ws&&!a&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(q(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(q(t.domNode,eC.Tap,()=>{yf&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return q(document,"selectionchange",t=>{if(!this._hasFocus||this._isDoingComposition||!db)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),h=this._host.deduceModelPosition(d[0],d[1],d[2]),c=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(c[0],c[1],c[2]),f=new ne(h.lineNumber,h.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=bh(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):qD(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(df.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};if(Bg.INSTANCE.set(rn?t.text.replace(/\r\n/g,`
  47. `):t.text,i),!df.canUseTextData(e)){this._setAndWriteTextAreaState("copy or cut",ci.selectedText(t.text));return}df.setTextData(e,t.text,t.html,i)}_firePaste(e,t){t||(t=Bg.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class df{static canUseTextData(e){return!!e.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData(Os.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]}throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,n){if(e.clipboardData){e.clipboardData.setData(Os.text,t),typeof i=="string"&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(n)),e.preventDefault();return}throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class Ez extends H{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=bh(n);r?o=r.activeElement:o=document.activeElement;const a=o===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i){rn&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),rn&&window.parent!==window&&n.focus();return}try{const h=m3(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),_3(n,h)}catch{}}}class Nz extends qd{constructor(e,t,i){super(e,t,i),this._register(lt.addTarget(this.viewHelper.linesContentDomNode)),this._register(q(this.viewHelper.linesContentDomNode,vt.Tap,o=>this.onTap(o))),this._register(q(this.viewHelper.linesContentDomNode,vt.Change,o=>this.onChange(o))),this._register(q(this.viewHelper.linesContentDomNode,vt.Contextmenu,o=>this._onContextMenu(new jd(o,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(q(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 A8(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,o=>this._onMouseMove(o),Jb(this.mouseTargetFactory),qd.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 jd(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 Tz extends qd{constructor(e,t,i){super(e,t,i),this._register(lt.addTarget(this.viewHelper.linesContentDomNode)),this._register(q(this.viewHelper.linesContentDomNode,vt.Tap,n=>this.onTap(n))),this._register(q(this.viewHelper.linesContentDomNode,vt.Change,n=>this.onChange(n))),this._register(q(this.viewHelper.linesContentDomNode,vt.Contextmenu,n=>this._onContextMenu(new jd(n,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new jd(e,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(eC.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class Az extends H{constructor(e,t,i){super(),lr&&KC.pointerEvents?this.handler=this._register(new Nz(e,t,i)):window.TouchEvent?this.handler=this._register(new Tz(e,t,i)):this.handler=this._register(new qd(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Pu extends Bp{}class ru extends Pu{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new F(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(58);const t=e.get(59);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(83);const i=e.get(129);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 F(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=Cn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='<div class="'+ru.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 h=this._getLineRenderLineNumber(l);h?l===this._activeLineNumber?a[d]='<div class="active-line-number '+ru.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+h+"</div>":a[d]=o+h+"</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]}}ru.CLASS_NAME="line-numbers";st((s,e)=>{const t=s.getColor(ZO);t&&e.addRule(`.monaco-editor .line-numbers { color: ${t}; }`);const i=s.getColor(A6);i&&e.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${i}; }`)});class Gd extends ws{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Ke(document.createElement("div")),this._domNode.setClassName(Gd.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Ke(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Gd.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(129);return this._canUseLayerHinting=!t.get(28),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)}}Gd.CLASS_NAME="glyph-margin";Gd.OUTER_CLASS_NAME="margin";const Nd="monaco-mouse-cursor-text";class ak{constructor(e,t,i){this._visibleTextAreaBrand=void 0,this.top=e,this.left=t,this.width=i}setWidth(e){return new ak(this.top,this.left,e)}}const hf=rn;class Rz extends ws{constructor(e,t,i){super(e),this._primaryCursorPosition=new F(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(129);this._setAccessibilityOptions(n),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=n.get(43),this._lineHeight=n.get(58),this._emptySelectionClipboard=n.get(32),this._copyWithSyntaxHighlighting=n.get(21),this._visibleTextArea=null,this._selections=[new ne(1,1,1,1)],this._modelSelections=[new ne(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Ke(document.createElement("textarea")),fr.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Nd}`),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(111))),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(30)&&n.get(80)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=Ke(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,Ai),h=this._context.model.getEOL(),c=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),u=Array.isArray(d)?d:null,f=Array.isArray(d)?d.join(h):d;let g,m=null;if(l&&(Ty.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&f.length<65536)){const _=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);_&&(g=_.html,m=_.mode)}return{isFromEmptySelection:c,multicursorText:u,text:f,html:g,mode:m}},getScreenReaderContent:l=>{if(this._accessibilitySupport===1){if(Me){const d=this._selections[0];if(d.isEmpty()){const h=d.getStartPosition();let c=this._getWordBeforePosition(h);if(c.length===0&&(c=this._getCharacterBeforePosition(h)),c.length>0)return new ci(c,c.length,c.length,h,h)}}return ci.EMPTY}if(yf){const d=this._selections[0];if(d.isEmpty()){const h=d.getStartPosition(),[c,u]=this._getAndroidWordAtPosition(h);if(c.length>0)return new ci(c,u,u,h,h)}return ci.EMPTY}return wc.fromEditorSelection(l,r,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(l,d,h)=>this._context.model.deduceModelPositionRelativeToViewPosition(l,d,h)};this._textAreaInput=this._register(new Iz(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,h=null,c=null;l.metadata&&(d=this._emptySelectionClipboard&&!!l.metadata.isFromEmptySelection,h=typeof l.metadata.multicursorText<"u"?l.metadata.multicursorText:null,c=l.metadata.mode),this._viewController.paste(l.text,d,h,c)})),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,h=this._selections[0].startColumn+l.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new S(d,h,d,h),0,1);const c=this._viewHelper.visibleRangeForPositionRelativeToEditor(d,h);c&&(this._visibleTextArea=new ak(this._context.viewLayout.getVerticalOffsetForLineNumber(d),c.left,hf?0:1),this._render()),this.textArea.setClassName(`inputarea ${Nd} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(l=>{this._visibleTextArea&&(this._visibleTextArea=this._visibleTextArea.setWidth(Mz(l.data,this._fontInfo)),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${Nd}`),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=vs(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 h=i.charCodeAt(r-2);n.get(h)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const h=i.charCodeAt(l-1);n.get(h)!==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=vs(this._context.configuration.options.get(115));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(!Si(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.",Cn?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Do.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(43),this._lineHeight=t.get(58),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(111))),(e.hasChanged(30)||e.hasChanged(80))&&(t.get(30)&&t.get(80)?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 F(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(Me){this._renderInsideEditor(this._primaryCursorPosition,t,e,hf?0:1,this._lineHeight);return}this._renderInsideEditor(this._primaryCursorPosition,t,e,hf?0:1,hf?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const r=this.textArea,a=this.textAreaCover;Ui.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(Ui.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),hf){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(49)?t.setClassName("monaco-editor-background textAreaCover "+Gd.OUTER_CLASS_NAME):i.get(59).renderType!==0?t.setClassName("monaco-editor-background textAreaCover "+ru.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function Mz(s,e){const i=document.createElement("canvas").getContext("2d");i.font=Oz(e);const n=i.measureText(s);return rn?n.width+2:n.width}function Oz(s){return Pz("normal",s.fontWeight,s.fontSize,s.lineHeight,s.fontFamily)}function Pz(s,e,t,i,n){return`${s} normal ${e} ${t}px / ${i}px ${n}`}class sd{static columnSelect(e,t,i,n,o,r){let a=Math.abs(o-i)+1,l=i>o,d=n>r,h=n<r,c=[];for(let u=0;u<a;u++){let f=i+(l?-u:u),g=ct.columnFromVisibleColumn2(e,t,f,n),m=ct.columnFromVisibleColumn2(e,t,f,r),_=ct.visibleColumnFromColumn2(e,t,new F(f,g)),C=ct.visibleColumnFromColumn2(e,t,new F(f,m));h&&(_>r||C<n)||d&&(C>n||_<r)||c.push(new vi(new S(f,g,f,g),0,new F(f,m),0))}if(c.length===0)for(let u=0;u<a;u++){const f=i+(l?-u:u),g=t.getLineMaxColumn(f);c.push(new vi(new S(f,g,f,g),0,new F(f,g),0))}return{viewStates:c,reversed:l,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:r}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,sd.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),h=ct.visibleColumnFromColumn2(e,t,new F(l,d));n=Math.max(n,h)}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 xi{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 ne(n.endLineNumber,n.endColumn,n.endLineNumber,n.endColumn)}}class Fz{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 ne(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)}}class Am{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 ne(n.startLineNumber,n.startColumn,n.startLineNumber,n.startColumn)}}class M_{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 ne(n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset,n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset)}}class lk{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 k0{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Xe{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-E3(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new F(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=Pg.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=n)return new F(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Xe.leftPositionAtomicSoftTabs(t,i,e.tabSize):Xe.leftPosition(t,i);return new k0(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(Xe.clipPositionColumn(l,t),0),h=Xe.left(e,t,d);r=h.lineNumber,a=h.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new F(e.lineNumber,Xe.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+gb(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new F(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const r=e.getLineContent(t),a=Pg.atomicPosition(r,i-1,n,1);if(a!==-1)return new F(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Xe.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Xe.rightPosition(t,i.lineNumber,i.column);return new k0(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(Xe.clipPositionColumn(l,t),1),h=Xe.right(e,t,d);r=h.lineNumber,a=h.column}return i.move(n,r,a,0)}static vertical(e,t,i,n,o,r,a){const l=ct.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),h=i===1&&n===1,c=i===d&&n===t.getLineMaxColumn(i),u=r<i?h:c;return i=r,i<1?(i=1,a?n=t.getLineMinColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):i>d?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=ct.columnFromVisibleColumn2(e,t,i,l),u?o=0:o=l-ct.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new k0(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a)}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=Xe.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=Xe.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=Xe.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new vi(new S(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new F(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i-r,a)}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=Xe.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=Xe.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=Xe.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new vi(new S(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new F(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 Zd{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 h=d;if(h.isEmpty()){let c=d.getPosition(),u=Xe.right(t,i,c);h=new S(u.lineNumber,u.column,c.lineNumber,c.column)}if(h.isEmpty()){o[a]=null;continue}h.startLineNumber!==h.endLineNumber&&(r=!0),o[a]=new xi(h,"")}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 h=r[l],c=h.getPosition();if(!h.isEmpty())return!1;const u=o.getLineContent(c.lineNumber);if(c.column<2||c.column>=u.length+1)return!1;const f=u.charAt(c.column-2),g=n.get(f);if(!g)return!1;if(uc(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(c.column-1);let _=!1;for(const C of g)C.open===f&&C.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let C=!1;for(let b=0,v=a.length;b<v;b++){const w=a[b];if(c.lineNumber===w.startLineNumber&&c.column===w.startColumn){C=!0;break}}if(!C)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 S(a.lineNumber,a.column-1,a.lineNumber,a.column+1);n[o]=new xi(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 h=Zd.getDeleteRange(n[l],i,t);if(h.isEmpty()){r[l]=null;continue}h.startLineNumber!==h.endLineNumber&&(a=!0),r[l]=new xi(h,"")}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=an(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const l=ct.visibleColumnFromColumn2(i,t,n),d=ct.prevIndentTabStop(l,i.indentSize),h=ct.columnFromVisibleColumn2(i,t,n.lineNumber,d);return new S(n.lineNumber,h,n.lineNumber,n.column)}}return S.fromPositions(Zd.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=B3(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 F(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){let n=[],o=null;i.sort((r,a)=>F.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.isEmpty())if(e.emptySelectionClipboard){let d=l.getPosition(),h,c,u,f;d.lineNumber<t.getLineCount()?(h=d.lineNumber,c=1,u=d.lineNumber+1,f=1):d.lineNumber>1&&(o==null?void 0:o.endLineNumber)!==d.lineNumber?(h=d.lineNumber-1,c=t.getLineMaxColumn(d.lineNumber-1),u=d.lineNumber,f=t.getLineMaxColumn(d.lineNumber)):(h=d.lineNumber,c=1,u=d.lineNumber,f=t.getLineMaxColumn(d.lineNumber));let g=new S(h,c,u,f);o=g,g.isEmpty()?n[r]=null:n[r]=new xi(g,"")}else n[r]=null;else n[r]=new xi(l,"")}return new Dn(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class je{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=je._findPreviousWordOnLine(e,t,new F(o,r));if(n===0)return new F(o,a?a.start+1:1);if(n===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=je._findPreviousWordOnLine(e,t,new F(o,a.start+1))),new F(o,a?a.start+1:1);if(n===3){for(;a&&a.wordType===2;)a=je._findPreviousWordOnLine(e,t,new F(o,a.start+1));return new F(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=je._findPreviousWordOnLine(e,t,new F(o,a.start+1))),new F(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 F(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 F(i,r);if(Ha(a)&&jo(l))return new F(i,r);if(jo(a)&&jo(l)&&r+1<n){const d=o.charCodeAt(r);if(Ha(d))return new F(i,r)}}return new F(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=je._findNextWordOnLine(e,t,new F(o,r));if(n===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=je._findNextWordOnLine(e,t,new F(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=je._findNextWordOnLine(e,t,new F(o,l.end+1));l?r=l.start+1:r=t.getLineMaxColumn(o)}else l&&!a&&r>=l.start+1&&(l=je._findNextWordOnLine(e,t,new F(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new F(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new F(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 F(i,r);if(Ha(a)&&jo(l))return new F(i,r);if(jo(a)&&jo(l)&&r+1<n){const d=o.charCodeAt(r);if(Ha(d))return new F(i,r)}}return new F(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=sr(i,n);return o+1<n?new S(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(Zd.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const c=e.selection.getPosition();return new S(c.lineNumber,c.column-1,c.lineNumber,c.column+1)}const a=new F(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,d=a.column;if(l===1&&d===1)return null;if(r){let c=this._deleteWordLeftWhitespace(n,a);if(c)return c}let h=je._findPreviousWordOnLine(i,n,a);return t===0?h?d=h.start+1:d>1?d=1:(l--,d=n.getLineMaxColumn(l)):(h&&d<=h.end+1&&(h=je._findPreviousWordOnLine(i,n,new F(l,h.start+1))),h?d=h.end+1:d>1?d=1:(l--,d=n.getLineMaxColumn(l))),new S(l,d,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new F(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 S(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 S(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new S(i.lineNumber,1,i.lineNumber+1,1):new S(i.lineNumber,1,i.lineNumber,1);const r=c=>c.start+1<=i.column&&i.column<=c.end+1,a=(c,u)=>(c=Math.min(c,i.column),u=Math.max(u,i.column),new S(i.lineNumber,c,i.lineNumber,u)),l=c=>{let u=c.start+1,f=c.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=je._findPreviousWordOnLine(e,t,i);if(d&&r(d))return l(d);const h=je._findNextWordOnLine(e,t,i);return h&&r(h)?l(h):d&&h?a(d.end+1,h.start+1):d?a(d.start+1,d.end+1):h?a(h.start+1,h.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=je._moveWordPartLeft(e,i);return new S(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 S(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 F(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,d=a.column;const h=n.getLineCount(),c=n.getLineMaxColumn(l);if(l===h&&d===c)return null;if(r){let f=this._deleteWordRightWhitespace(n,a);if(f)return f}let u=je._findNextWordOnLine(i,n,a);return t===2?u?d=u.end+1:d<c||l===h?d=c:(l++,u=je._findNextWordOnLine(i,n,new F(l,1)),u?d=u.start+1:d=n.getLineMaxColumn(l)):(u&&d>=u.start+1&&(u=je._findNextWordOnLine(i,n,new F(l,u.end+1))),u?d=u.start+1:d<c||l===h?d=c:(l++,u=je._findNextWordOnLine(i,n,new F(l,1)),u?d=u.start+1:d=n.getLineMaxColumn(l))),new S(l,d,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=je._moveWordPartRight(e,i);return new S(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new S(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=vs(t),o=je._findPreviousWordOnLine(n,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return je._createWordAtPosition(e,i.lineNumber,o);const r=je._findNextWordOnLine(n,e,i);return r&&r.wordType===1&&r.start<=i.column-1&&i.column-1<=r.end?je._createWordAtPosition(e,i.lineNumber,r):null}static word(e,t,i,n,o){const r=vs(e.wordSeparators);let a=je._findPreviousWordOnLine(r,t,o),l=je._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 vi(new S(o.lineNumber,f,o.lineNumber,g),0,new F(o.lineNumber,g),0)}let d,h;a&&a.wordType===1&&a.start<o.column-1&&o.column-1<a.end?(d=a.start+1,h=a.end+1):l&&l.wordType===1&&l.start<o.column-1&&o.column-1<l.end?(d=l.start+1,h=l.end+1):(d=o.column,h=o.column);let c=o.lineNumber,u;if(i.selectionStart.containsPosition(o))u=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){u=d;let f=new F(c,u);i.selectionStart.containsPosition(f)&&(u=i.selectionStart.endColumn)}else{u=h;let f=new F(c,u);i.selectionStart.containsPosition(f)&&(u=i.selectionStart.startColumn)}return i.move(!0,c,u,0)}}class Ev extends je{static deleteWordPartLeft(e){const t=Rm([je.deleteWordLeft(e,0),je.deleteWordLeft(e,2),je._deleteWordPartLeft(e.model,e.selection)]);return t.sort(S.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=Rm([je.deleteWordRight(e,0),je.deleteWordRight(e,2),je._deleteWordPartRight(e.model,e.selection)]);return t.sort(S.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const n=Rm([je.moveWordLeft(e,t,i,0),je.moveWordLeft(e,t,i,2),je._moveWordPartLeft(t,i)]);return n.sort(F.compare),n[2]}static moveWordPartRight(e,t,i){const n=Rm([je.moveWordRight(e,t,i,0),je.moveWordRight(e,t,i,2),je._moveWordPartRight(t,i)]);return n.sort(F.compare),n[0]}}function Rm(s){return s.filter(e=>!!e)}class Ci{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 Re(l.modelState,l.viewState),i?n[o++]=Re.fromModelState(Xe.translateDown(e.cursorConfig,e.model,l.modelState)):n[o++]=Re.fromViewState(Xe.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 Re(l.modelState,l.viewState),i?n[o++]=Re.fromModelState(Xe.translateUp(e.cursorConfig,e.model,l.modelState)):n[o++]=Re.fromViewState(Xe.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 Re.fromViewState(Xe.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Re.fromModelState(Xe.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),h=r-o.column===d-l.column;return a||h?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Re.fromViewState(Xe.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Re.fromModelState(Xe.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,h;d===l?h=e.model.getLineMaxColumn(l):(d++,h=1),i[n]=Re.fromModelState(new vi(new S(a,1,a,1),0,new F(d,h),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]=Re.fromModelState(Xe.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]=Re.fromModelState(Xe.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 Re.fromModelState(new vi(new S(1,1,1,1),0,new F(i,n),0))}static line(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new F(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i||!t.modelState.hasSelection()){const d=e.model.getLineCount();let h=r.lineNumber+1,c=1;return h>d&&(h=d,c=e.model.getLineMaxColumn(h)),Re.fromModelState(new vi(new S(r.lineNumber,1,h,c),0,new F(h,c),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<l)return Re.fromViewState(t.viewState.move(t.modelState.hasSelection(),a.lineNumber,1,0));if(r.lineNumber>l){const d=e.getLineCount();let h=a.lineNumber+1,c=1;return h>d&&(h=d,c=e.getLineMaxColumn(h)),Re.fromViewState(t.viewState.move(t.modelState.hasSelection(),h,c,0))}else{const d=t.modelState.selectionStart.getEndPosition();return Re.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 Re.fromModelState(je.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Re(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Re.fromViewState(new vi(new S(i,n,i,n),0,new F(i,n),0))}static moveTo(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new F(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Re.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=>Re.fromViewState(Xe.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Re.fromModelState(Xe.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>Re.fromViewState(Xe.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Re.fromModelState(Xe.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,h=t.length;d<h;d++){const c=t[d];l[d]=this.findPositionInViewportIfOutside(e,c,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 Re(t.modelState,t.viewState);{let r;o>i.endLineNumber-1?r=i.endLineNumber-1:o<i.startLineNumber?r=i.startLineNumber:r=o;const a=Xe.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,r,!1);return Re.fromViewState(t.viewState.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns))}}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=>Re.fromViewState(Xe.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]=Re.fromViewState(Xe.moveLeft(e.cursorConfig,e,a.viewState,i,d))}return n}static _moveRight(e,t,i,n){return t.map(o=>Re.fromViewState(Xe.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]=Re.fromViewState(Xe.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]=Re.fromViewState(Xe.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]=Re.fromModelState(Xe.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]=Re.fromViewState(Xe.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]=Re.fromModelState(Xe.moveUp(e.cursorConfig,e.model,l.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return Re.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return Re.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 tC;(function(s){const e=function(i){if(!bn(i))return!1;let n=i;return!(!Gs(n.to)||!sn(n.select)&&!cM(n.select)||!sn(n.by)&&!Gs(n.by)||!sn(n.value)&&!Wd(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:
  48. * 'to': A mandatory logical position value providing where to move the cursor.
  49. \`\`\`
  50. 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
  51. 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
  52. 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
  53. 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
  54. \`\`\`
  55. * 'by': Unit to move. Default is computed based on 'to' value.
  56. \`\`\`
  57. 'line', 'wrappedLine', 'character', 'halfLine'
  58. \`\`\`
  59. * 'value': Number of units to move. Default is '1'.
  60. * 'select': If 'true' makes the selection. Default is 'false'.
  61. `,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})(tC||(tC={}));const I0=Object.create(null);function Hl(s,e){if(e<=0)return"";I0[s]||(I0[s]=["",s]);const t=I0[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}class $n{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=ct.visibleColumnFromColumn(e,t,i);if(o){const a=Hl(" ",n),d=ct.prevIndentTabStop(r,n)/n;return Hl(a,d)}else{const a=" ",d=ct.prevRenderTabStop(r,i)/i;return Hl(a,d)}}static shiftIndent(e,t,i,n,o){const r=ct.visibleColumnFromColumn(e,t,i);if(o){const a=Hl(" ",n),d=ct.nextIndentTabStop(r,n)/n;return Hl(a,d)}else{const a=" ",d=ct.nextRenderTabStop(r,i)/i;return Hl(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,h=0;for(let c=i;c<=n;c++,d=h){h=0;let u=e.getLineContent(c),f=an(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),c>1&&ct.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.isCheapToTokenize(c-1)){let _=Qe.getEnterAction(this._opts.autoIndent,e,new S(c-1,e.getLineMaxColumn(c-1),c-1,e.getLineMaxColumn(c-1)));if(_){if(h=d,_.appendText)for(let C=0,b=_.appendText.length;C<b&&h<r&&_.appendText.charCodeAt(C)===32;C++)h++;_.removeText&&(h=Math.max(0,h-_.removeText));for(let C=0;C<h&&!(f===0||u.charCodeAt(f-1)!==32);C++)f--}}if(this._opts.isUnshift&&f===0)continue;let g;this._opts.isUnshift?g=$n.unshiftIndent(u,f+1,o,r,a):g=$n.shiftIndent(u,f+1,o,r,a),this._addEditOperation(t,new S(c,1,c,f+1),g),c===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?Hl(" ",r):" ";for(let h=i;h<=n;h++){const c=e.getLineContent(h);let u=an(c);if(!(this._opts.isUnshift&&(c.length===0||u===0))&&!(!l&&!this._opts.isUnshift&&c.length===0)&&(u===-1&&(u=c.length),!(this._opts.isUnshift&&u===0)))if(this._opts.isUnshift){u=Math.min(u,r);for(let f=0;f<u;f++)if(c.charCodeAt(f)===9){u=f+1;break}this._addEditOperation(t,new S(h,1,h,u+1),"")}else this._addEditOperation(t,new S(h,1,h,1),d),h===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 ne(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 ne(i.startLineNumber,n,i.endLineNumber,i.endColumn):new ne(i.endLineNumber,i.endColumn,i.startLineNumber,n)}return i}}class Bz{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new S(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new S(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 ne(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class It{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 $n(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 $n(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,$n.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,$n.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 xi(i[r],n[r]);return new Dn(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 h=d.getPosition();if(o&&!d.isEmpty()&&(o=!1),o&&n.indexOf(`
  62. `)!==n.length-1&&(o=!1),o){let c=new S(h.lineNumber,1,h.lineNumber,1);r[a]=new lk(c,n,d,!0)}else r[a]=new xi(d,n)}return new Dn(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=cr(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(S.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=Qe.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 h=t.getLineContent(a);if(sr(h)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=Qe.getEnterAction(e.autoIndent,t,new S(a,l,a,l));d&&(o=d.indentation+d.appendText)}return n&&(n===Gt.Indent&&(o=It.shiftIndent(e,o)),n===Gt.Outdent&&(o=It.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=ct.visibleColumnFromColumn2(e,t,r),l=e.indentSize,d=l-a%l;for(let h=0;h<d;h++)o+=" "}else o=" ";return new xi(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 h=e.normalizeIndentation(d);if(!l.startsWith(h)){n[o]=new xi(new S(a.startLineNumber,1,a.startLineNumber,l.length+1),h,!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 $n(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(h=>this._compositionType(i,h,o,r,a,l));return new Dn(4,d,{shouldPushStackElementBefore:Mm(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),h=new S(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(h)===i&&r===0?null:new M_(h,i,0,r)}static _typeCommand(e,t,i){return i?new Am(e,t,!0):new xi(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return It._typeCommand(n,`
  63. `,i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){let l=t.getLineContent(n.startLineNumber),d=ht(l).substring(0,n.startColumn-1);return It._typeCommand(n,`
  64. `+e.normalizeIndentation(d),i)}const o=Qe.getEnterAction(e.autoIndent,t,n);if(o){if(o.indentAction===Gt.None)return It._typeCommand(n,`
  65. `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Gt.Indent)return It._typeCommand(n,`
  66. `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Gt.IndentOutdent){const l=e.normalizeIndentation(o.indentation),d=e.normalizeIndentation(o.indentation+o.appendText),h=`
  67. `+d+`
  68. `+l;return i?new Am(n,h,!0):new M_(n,h,-1,d.length-l.length,!0)}else if(o.indentAction===Gt.Outdent){const l=It.unshiftIndent(e,o.indentation);return It._typeCommand(n,`
  69. `+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=ht(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=Qe.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:d=>It.unshiftIndent(e,d),shiftIndent:d=>It.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)});if(l){let d=ct.visibleColumnFromColumn2(e,t,n.getEndPosition());const h=n.endColumn,c=t.getLineContent(n.endLineNumber),u=an(c);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 Am(n,`
  70. `+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return h<=u+1&&(e.insertSpaces||(d=Math.ceil(d/e.indentSize)),f=Math.min(d+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new M_(n,`
  71. `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return It._typeCommand(n,`
  72. `+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=Qe.getIndentationAtPosition(t,i.startLineNumber,i.startColumn),r=Qe.getIndentActionForType(e.autoIndent,t,i,n,{shiftIndent:a=>It.shiftIndent(e,a),unshiftIndent:a=>It.unshiftIndent(e,a)});if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?It._typeCommand(new S(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):It._typeCommand(new S(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(),h=t.getLineContent(d.lineNumber);if(h.charAt(d.column-1)!==o)return!1;const u=uc(o);if((d.column>2?h.charCodeAt(d.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,_=n.length;m<_;m++){const C=n[m];if(d.lineNumber===C.startLineNumber&&d.column===C.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 h=n[a].getPosition(),c=new S(h.lineNumber,h.column,h.lineNumber,h.column+1);r[a]=new xi(c,o)}return new Dn(4,r,{shouldPushStackElementBefore:Mm(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 S(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=uc(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 h=!0;const c=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(),_=t.getLineContent(m.lineNumber),C=_.substring(m.column-1);if(C.startsWith(d)||(h=!1),_.length>m.column-1){const w=_.charAt(m.column-1);if(!It._isBeforeClosingBrace(e,C)&&!c(w))return null}if(!t.isCheapToTokenize(m.lineNumber))return null;if(l.open.length===1&&(n==="'"||n==='"')&&a!=="always"){const w=vs(e.wordSeparators);if(o&&m.column>1&&w.get(_.charCodeAt(m.column-2))===0||!o&&m.column>2&&w.get(_.charCodeAt(m.column-3))===0)return null}t.forceTokenization(m.lineNumber);const b=t.getLineTokens(m.lineNumber);let v=!1;try{v=Qe.shouldAutoClosePair(l,b,o?m.column:m.column-1)}catch(w){Le(w)}if(!v)return null}return h?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,h=n.length;d<h;d++){const c=n[d];l[d]=new dP(c,o,r,a)}return new Dn(4,l,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return uc(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,n){if(!It._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=uc(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 h=l.startLineNumber;h<=l.endLineNumber;h++){const c=t.getLineContent(h),u=h===l.startLineNumber?l.startColumn-1:0,f=h===l.endLineNumber?l.endColumn-1:c.length,g=c.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 h=t.getValueInRange(l);if(uc(h))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],h=t.surroundingPairs[o];r[a]=new Bz(d,o,h)}return new Dn(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=Qe.onElectricCharacter(o,a,r.column)}catch(d){return Le(d),null}if(!l)return null;if(l.matchOpenBracket){let d=(a.getLineContent()+o).lastIndexOf(l.matchOpenBracket)+1,h=i.findMatchingBracketUp(l.matchOpenBracket,{lineNumber:r.lineNumber,column:d});if(h){if(h.startLineNumber===r.lineNumber)return null;let c=i.getLineContent(h.startLineNumber),u=ht(c),f=t.normalizeIndentation(u),g=i.getLineContent(r.lineNumber),m=i.getLineFirstNonWhitespaceColumn(r.lineNumber)||r.column,_=g.substring(m-1,r.column-1),C=f+_+o,b=new S(r.lineNumber,1,r.lineNumber,r.column);const v=new xi(b,C);return new Dn(E0(C,e),[v],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,r){if(!n||ne.selectionsArrEqual(n,o))return null;let a=null;for(const d of o){if(!d.isEmpty())return null;const h=d.getPosition(),c=i.getValueInRange(new S(h.lineNumber,h.column-1,h.lineNumber,h.column));if(a===null)a=c;else if(a!==c)return null}if(!a)return null;if(this._isAutoClosingOvertype(t,i,o,r,a)){const d=o.map(h=>new xi(new S(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Dn(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===`
  73. `){let h=[];for(let c=0,u=o.length;c<u;c++)h[c]=It._enter(i,n,!1,o[c]);return new Dn(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){let h=[],c=!1;for(let u=0,f=o.length;u<f;u++)if(h[u]=this._runAutoIndentType(i,n,o[u],a),!h[u]){c=!0;break}if(!c)return new Dn(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(i,n,o,r,a))return this._runAutoClosingOvertype(t,i,n,o,a);if(!e){const h=this._getAutoClosingPairClose(i,n,o,a,!0);if(h)return this._runAutoClosingOpenCharType(t,i,n,o,a,!0,h)}if(this._isSurroundSelectionType(i,n,o,a))return this._runSurroundSelectionType(t,i,n,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const h=this._typeInterceptorElectricChar(t,i,n,o[0],a);if(h)return h}let l=[];for(let h=0,c=o.length;h<c;h++)l[h]=new xi(o[h],a);const d=E0(a,t);return new Dn(d,l,{shouldPushStackElementBefore:Mm(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 xi(n[l],o);const a=E0(o,e);return new Dn(a,r,{shouldPushStackElementBefore:Mm(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 Am(new S(1,1,1,1),`
  74. `);else{a--;let l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new S(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 S(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 dP extends M_{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 S(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new S(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}function E0(s,e){return s===" "?e===5||e===6?6:5:4}function Mm(s,e){return xN(s)&&!xN(e)?!0:s===5?!1:DN(s)!==DN(e)}function DN(s){return s===6||s===5?"space":s}function xN(s){return s===4||s===5||s===6}var E;(function(s){s.editorSimpleInput=new re("editorSimpleInput",!1,!0),s.editorTextFocus=new re("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),s.focus=new re("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),s.textInputFocus=new re("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),s.readOnly=new re("editorReadonly",!1,p("editorReadonly","Whether the editor is read only")),s.inDiffEditor=new re("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),s.columnSelection=new re("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),s.writable=s.readOnly.toNegated(),s.hasNonEmptySelection=new re("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),s.hasOnlyEmptySelection=s.hasNonEmptySelection.toNegated(),s.hasMultipleSelections=new re("editorHasMultipleSelections",!1,p("editorHasMultipleSelections","Whether the editor has multiple selections")),s.hasSingleSelection=s.hasMultipleSelections.toNegated(),s.tabMovesFocus=new re("editorTabMovesFocus",!1,p("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),s.tabDoesNotMoveFocus=s.tabMovesFocus.toNegated(),s.isInWalkThroughSnippet=new re("isInEmbeddedEditor",!1,!0),s.canUndo=new re("canUndo",!1,!0),s.canRedo=new re("canRedo",!1,!0),s.hoverVisible=new re("editorHoverVisible",!1,p("editorHoverVisible","Whether the editor hover is visible")),s.inCompositeEditor=new re("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 re("editorLangId","",p("editorLangId","The language identifier of the editor")),s.hasCompletionItemProvider=new re("editorHasCompletionItemProvider",!1,p("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),s.hasCodeActionsProvider=new re("editorHasCodeActionsProvider",!1,p("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),s.hasCodeLensProvider=new re("editorHasCodeLensProvider",!1,p("editorHasCodeLensProvider","Whether the editor has a code lens provider")),s.hasDefinitionProvider=new re("editorHasDefinitionProvider",!1,p("editorHasDefinitionProvider","Whether the editor has a definition provider")),s.hasDeclarationProvider=new re("editorHasDeclarationProvider",!1,p("editorHasDeclarationProvider","Whether the editor has a declaration provider")),s.hasImplementationProvider=new re("editorHasImplementationProvider",!1,p("editorHasImplementationProvider","Whether the editor has an implementation provider")),s.hasTypeDefinitionProvider=new re("editorHasTypeDefinitionProvider",!1,p("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),s.hasHoverProvider=new re("editorHasHoverProvider",!1,p("editorHasHoverProvider","Whether the editor has a hover provider")),s.hasDocumentHighlightProvider=new re("editorHasDocumentHighlightProvider",!1,p("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),s.hasDocumentSymbolProvider=new re("editorHasDocumentSymbolProvider",!1,p("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),s.hasReferenceProvider=new re("editorHasReferenceProvider",!1,p("editorHasReferenceProvider","Whether the editor has a reference provider")),s.hasRenameProvider=new re("editorHasRenameProvider",!1,p("editorHasRenameProvider","Whether the editor has a rename provider")),s.hasSignatureHelpProvider=new re("editorHasSignatureHelpProvider",!1,p("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),s.hasInlayHintsProvider=new re("editorHasInlayHintsProvider",!1,p("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),s.hasDocumentFormattingProvider=new re("editorHasDocumentFormattingProvider",!1,p("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),s.hasDocumentSelectionFormattingProvider=new re("editorHasDocumentSelectionFormattingProvider",!1,p("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),s.hasMultipleDocumentFormattingProvider=new re("editorHasMultipleDocumentFormattingProvider",!1,p("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),s.hasMultipleDocumentSelectionFormattingProvider=new re("editorHasMultipleDocumentSelectionFormattingProvider",!1,p("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(E||(E={}));const Ye=0;class Kt extends Mi{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var iC;(function(s){const e=function(i){if(!bn(i))return!1;const n=i;return!(!Gs(n.to)||!sn(n.by)&&!Gs(n.by)||!sn(n.value)&&!Wd(n.value)||!sn(n.revealCursor)&&!cM(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})(iC||(iC={}));var Sc;(function(s){const e=function(t){if(!bn(t))return!1;const i=t;return!(!Wd(i.lineNumber)&&!Gs(i.lineNumber)||!sn(i.at)&&!Gs(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"}})(Sc||(Sc={}));class Ay{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(tt).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(tt).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 li;(function(s){class e extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,[Ci.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,v.position,v.viewPosition)]),b.revealPrimaryCursor(v.source,!0)}}s.MoveTo=J(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=J(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Kt{runCoreEditorCommand(b,v){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),v);b.setCursorStates(v.source,3,w.viewStates.map(y=>Re.fromViewState(y))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(v.source):b.revealBottomMostCursor(v.source)}}s.ColumnSelect=J(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(C,b,v,w){const y=C.model.validatePosition(w.position),k=C.coordinatesConverter.validateViewPosition(new F(w.viewPosition.lineNumber,w.viewPosition.column),y);let L=w.doColumnSelect?v.fromViewLineNumber:k.lineNumber,D=w.doColumnSelect?v.fromViewVisualColumn:w.mouseColumn-1;return sd.columnSelect(C.cursorConfig,C,L,D,k.lineNumber,w.mouseColumn-1)}}),s.CursorColumnSelectLeft=J(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(C,b,v,w){return sd.columnSelectLeft(C.cursorConfig,C,v)}}),s.CursorColumnSelectRight=J(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(C,b,v,w){return sd.columnSelectRight(C.cursorConfig,C,v)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,v,w,y){return sd.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectUp=J(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3600,linux:{primary:0}}})),s.CursorColumnSelectPageUp=J(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,v,w,y){return sd.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectDown=J(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3602,linux:{primary:0}}})),s.CursorColumnSelectPageDown=J(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Kt{constructor(){super({id:"cursorMove",precondition:void 0,description:tC.description})}runCoreEditorCommand(b,v){const w=tC.parse(v);w&&this._runCursorMove(b,v.source,w)}_runCursorMove(b,v,w){b.model.pushStackElement(),b.setCursorStates(v,3,o._move(b,b.getCursorStates(),w)),b.revealPrimaryCursor(v,!0)}static _move(b,v,w){const y=w.select,k=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Ci.simpleMove(b,v,w.direction,y,k,w.unit);case 11:case 13:case 12:case 14:return Ci.viewportMove(b,v,w.direction,y,k);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=J(new o);class r extends Kt{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,v){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(v.source,3,Ci.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealPrimaryCursor(v.source,!0)}}s.CursorLeft=J(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),s.CursorLeftSelect=J(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1039}})),s.CursorRight=J(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),s.CursorRightSelect=J(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1041}})),s.CursorUp=J(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),s.CursorUpSelect=J(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),s.CursorPageUp=J(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:11}})),s.CursorPageUpSelect=J(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1035}})),s.CursorDown=J(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),s.CursorDownSelect=J(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),s.CursorPageDown=J(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:12}})),s.CursorPageDownSelect=J(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1036}})),s.CreateCursor=J(new class extends Kt{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(C,b){let v;b.wholeLine?v=Ci.line(C,C.getPrimaryCursorState(),!1,b.position,b.viewPosition):v=Ci.moveTo(C,C.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=C.getCursorStates();if(w.length>1){const y=v.modelState?v.modelState.position:null,k=v.viewState?v.viewState.position:null;for(let L=0,D=w.length;L<D;L++){const N=w[L];if(!(y&&!N.modelState.selection.containsPosition(y))&&!(k&&!N.viewState.selection.containsPosition(k))){w.splice(L,1),C.model.pushStackElement(),C.setCursorStates(b.source,3,w);return}}}w.push(v),C.model.pushStackElement(),C.setCursorStates(b.source,3,w)}}),s.LastCursorMoveToSelect=J(new class extends Kt{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(C,b){const v=C.getLastAddedCursorIndex(),w=C.getCursorStates(),y=w.slice(0);y[v]=Ci.moveTo(C,w[v],!0,b.position,b.viewPosition),C.model.pushStackElement(),C.setCursorStates(b.source,3,y)}});class a extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,Ci.moveToBeginningOfLine(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(v.source,!0)}}s.CursorHome=J(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),s.CursorHomeSelect=J(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,this._exec(b.getCursorStates())),b.revealPrimaryCursor(v.source,!0)}_exec(b){const v=[];for(let w=0,y=b.length;w<y;w++){const k=b[w],L=k.modelState.position.lineNumber;v[w]=Re.fromModelState(k.modelState.move(this._inSelectionMode,L,1,0))}return v}}s.CursorLineStart=J(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:0,mac:{primary:287}}})),s.CursorLineStartSelect=J(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,Ci.moveToEndOfLine(b,b.getCursorStates(),this._inSelectionMode,v.sticky||!1)),b.revealPrimaryCursor(v.source,!0)}}s.CursorEnd=J(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Ye,kbExpr:E.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=J(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Ye,kbExpr:E.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 h extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,this._exec(b,b.getCursorStates())),b.revealPrimaryCursor(v.source,!0)}_exec(b,v){const w=[];for(let y=0,k=v.length;y<k;y++){const L=v[y],D=L.modelState.position.lineNumber,N=b.model.getLineMaxColumn(D);w[y]=Re.fromModelState(L.modelState.move(this._inSelectionMode,D,N,0))}return w}}s.CursorLineEnd=J(new h({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:0,mac:{primary:291}}})),s.CursorLineEndSelect=J(new h({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:0,mac:{primary:1315}}}));class c extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,Ci.moveToBeginningOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(v.source,!0)}}s.CursorTop=J(new c({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2062,mac:{primary:2064}}})),s.CursorTopSelect=J(new c({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,Ci.moveToEndOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(v.source,!0)}}s.CursorBottom=J(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2061,mac:{primary:2066}}})),s.CursorBottomSelect=J(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:3085,mac:{primary:3090}}}));class f extends Kt{constructor(){super({id:"editorScroll",precondition:void 0,description:iC.description})}runCoreEditorCommand(b,v){const w=iC.parse(v);w&&this._runEditorScroll(b,v.source,w)}_runEditorScroll(b,v,w){const y=this._computeDesiredScrollTop(b,w);if(w.revealCursor){const k=b.getCompletelyVisibleViewRangeAtScrollTop(y);b.setCursorStates(v,3,[Ci.findPositionInViewportIfOutside(b,b.getPrimaryCursorState(),k,w.select)])}b.setScrollTop(y,0)}_computeDesiredScrollTop(b,v){if(v.unit===1){const k=b.getCompletelyVisibleViewRange(),L=b.coordinatesConverter.convertViewRangeToModelRange(k);let D;v.direction===1?D=Math.max(1,L.startLineNumber-v.value):D=Math.min(b.model.getLineCount(),L.startLineNumber+v.value);const N=b.coordinatesConverter.convertModelPositionToViewPosition(new F(D,1));return b.getVerticalOffsetForLineNumber(N.lineNumber)}let w;v.unit===3?w=b.cursorConfig.pageSize*v.value:v.unit===4?w=Math.round(b.cursorConfig.pageSize/2)*v.value:w=v.value;const y=(v.direction===1?-1:1)*w;return b.getScrollTop()+y*b.cursorConfig.lineHeight}}s.EditorScrollImpl=f,s.EditorScroll=J(new f),s.ScrollLineUp=J(new class extends Kt{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(C,b){s.EditorScroll._runEditorScroll(C,b.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),s.ScrollPageUp=J(new class extends Kt{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(C,b){s.EditorScroll._runEditorScroll(C,b.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),s.ScrollLineDown=J(new class extends Kt{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(C,b){s.EditorScroll._runEditorScroll(C,b.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),s.ScrollPageDown=J(new class extends Kt{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(C,b){s.EditorScroll._runEditorScroll(C,b.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class g extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,[Ci.word(b,b.getPrimaryCursorState(),this._inSelectionMode,v.position)]),b.revealPrimaryCursor(v.source,!0)}}s.WordSelect=J(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),s.WordSelectDrag=J(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),s.LastCursorWordSelect=J(new class extends Kt{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(C,b){const v=C.getLastAddedCursorIndex(),w=C.getCursorStates(),y=w.slice(0),k=w[v];y[v]=Ci.word(C,k,k.modelState.hasSelection(),b.position),C.model.pushStackElement(),C.setCursorStates(b.source,3,y)}});class m extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates(v.source,3,[Ci.line(b,b.getPrimaryCursorState(),this._inSelectionMode,v.position,v.viewPosition)]),b.revealPrimaryCursor(v.source,!1)}}s.LineSelect=J(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),s.LineSelectDrag=J(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,v){const w=b.getLastAddedCursorIndex(),y=b.getCursorStates(),k=y.slice(0);k[w]=Ci.line(b,y[w],this._inSelectionMode,v.position,v.viewPosition),b.model.pushStackElement(),b.setCursorStates(v.source,3,k)}}s.LastCursorLineSelect=J(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),s.LastCursorLineSelectDrag=J(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),s.ExpandLineSelection=J(new class extends Kt{constructor(){super({id:"expandLineSelection",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:2090}})}runCoreEditorCommand(C,b){C.model.pushStackElement(),C.setCursorStates(b.source,3,Ci.expandLineSelection(C,C.getCursorStates())),C.revealPrimaryCursor(b.source,!0)}}),s.CancelSelection=J(new class extends Kt{constructor(){super({id:"cancelSelection",precondition:E.hasNonEmptySelection,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(C,b){C.model.pushStackElement(),C.setCursorStates(b.source,3,[Ci.cancelSelection(C,C.getPrimaryCursorState())]),C.revealPrimaryCursor(b.source,!0)}}),s.RemoveSecondaryCursors=J(new class extends Kt{constructor(){super({id:"removeSecondaryCursors",precondition:E.hasMultipleSelections,kbOpts:{weight:Ye+1,kbExpr:E.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(C,b){C.model.pushStackElement(),C.setCursorStates(b.source,3,[C.getPrimaryCursorState()]),C.revealPrimaryCursor(b.source,!0),$b(p("removedCursor","Removed secondary cursors"))}}),s.RevealLine=J(new class extends Kt{constructor(){super({id:"revealLine",precondition:void 0,description:Sc.description})}runCoreEditorCommand(C,b){const v=b,w=v.lineNumber||0;let y=typeof w=="number"?w+1:parseInt(w)+1;y<1&&(y=1);const k=C.model.getLineCount();y>k&&(y=k);const L=new S(y,1,y,C.model.getLineMaxColumn(y));let D=0;if(v.at)switch(v.at){case Sc.RawAtArgument.Top:D=3;break;case Sc.RawAtArgument.Center:D=1;break;case Sc.RawAtArgument.Bottom:D=4;break}const N=C.coordinatesConverter.convertModelRangeToViewRange(L);C.revealRange(b.source,!1,N,D,0)}}),s.SelectAll=new class extends Ay{constructor(){super(y8)}runDOMCommand(){rn&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(C,b,v){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,v)}runCoreEditorCommand(C,b){C.model.pushStackElement(),C.setCursorStates("keyboard",3,[Ci.selectAll(C,C.getPrimaryCursorState())])}},s.SetSelection=J(new class extends Kt{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(C,b){C.model.pushStackElement(),C.setCursorStates(b.source,3,[Re.fromModelSelection(b.selection)])}})})(li||(li={}));const Wz=te.and(E.textInputFocus,E.columnSelection);function Fu(s,e){cn.registerKeybindingRule({id:s,primary:e,when:Wz,weight:Ye+1})}Fu(li.CursorColumnSelectLeft.id,1039);Fu(li.CursorColumnSelectRight.id,1041);Fu(li.CursorColumnSelectUp.id,1040);Fu(li.CursorColumnSelectPageUp.id,1035);Fu(li.CursorColumnSelectDown.id,1042);Fu(li.CursorColumnSelectPageDown.id,1036);function kN(s){return s.register(),s}var zc;(function(s){class e extends Mi{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=J(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:E.writable,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,It.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=J(new class extends e{constructor(){super({id:"outdent",precondition:E.writable,kbOpts:{weight:Ye,kbExpr:te.and(E.editorTextFocus,E.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,It.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=J(new class extends e{constructor(){super({id:"tab",precondition:E.writable,kbOpts:{weight:Ye,kbExpr:te.and(E.editorTextFocus,E.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,It.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=J(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Zd.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=J(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Ye,kbExpr:E.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Zd.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 Ay{constructor(){super(Tx)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().undo()}},s.Redo=new class extends Ay{constructor(){super(Ax)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().redo()}}})(zc||(zc={}));class IN extends wv{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(tt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Dh(s,e){kN(new IN("default:"+s,s)),kN(new IN(s,s,e))}Dh("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Dh("replacePreviousChar");Dh("compositionType");Dh("compositionStart");Dh("compositionEnd");Dh("paste");Dh("cut");class Vz{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){li.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new F(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(69)){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(69)){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=Cn&&t.get(95),n=t.get(18);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){li.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){li.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),li.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),li.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){li.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){li.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){li.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){li.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){li.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){li.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){li.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){li.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){li.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 Nv{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 Nv.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new Hz(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class Hz{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 to.toString(this)}}var N0;class hP{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 c=0;c<i;c++)r[c]=this._createLine();const a=e-this._rendLineNumberStart,l=this._lines.slice(0,a),d=this._lines.slice(a,this._lines.length-i),h=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=l.concat(r).concat(d),h}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 h=l;h<=d;h++){const c=h-this._rendLineNumberStart;this._lines[c].onTokensChanged(),n=!0}}return n}}class cP{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new hP(()=>this._host.createVisibleLine())}_createDomNode(){const e=Ke(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(129)}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 Yr(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 Yr{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){Yr._ttPolicy&&(i=Yr._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");Yr._ttPolicy&&(t=Yr._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=Yr._sb,o=e.linesLength,r=e.lines,a=e.rendLineNumberStart,l=[];{n.reset();let d=!1;for(let h=0;h<o;h++){const c=r[h];l[h]=!1,!(c.getDomNode()||!c.renderLine(h+a,i[h],this.viewportData,n))&&(l[h]=!0,d=!0)}d&&this._finishRenderingNewLines(e,t,n.build(),l)}{n.reset();let d=!1;const h=[];for(let c=0;c<o;c++){const u=r[c];h[c]=!1,!(l[c]||!u.renderLine(c+a,i[c],this.viewportData,n))&&(h[c]=!0,d=!0)}d&&this._finishRenderingInvalidLines(e,n.build(),h)}}}Yr._ttPolicy=(N0=window.trustedTypes)===null||N0===void 0?void 0:N0.createPolicy("editorViewLayer",{createHTML:s=>s});Yr._sb=Vd(1e5);class uP extends ws{constructor(e){super(e),this._visibleLines=new cP(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 zz(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 zz{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(58),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Ke(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(58)}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 Uz extends uP{constructor(e){super(e);const i=this._context.configuration.options.get(129);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);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 $z extends uP{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Ui.applyFontInfo(this.domNode,t.get(43))}onConfigurationChanged(e){const t=this._context.configuration.options;Ui.applyFontInfo(this.domNode,t.get(43));const i=t.get(129);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 cf{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class jz extends ws{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Ke(document.createElement("div")),fr.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Ke(document.createElement("div")),fr.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 Kz(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 Kz=class{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Ke(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(129);this._fixedOverflowWidgets=n.get(36),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(58),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(58),e.hasChanged(129)){const i=t.get(129);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,h=r-n,c=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:c,aboveTop:h,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-na.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=Ii(this._viewDomNode.domNode),d=l.top+r-na.scrollY,h=l.top+a-na.scrollY,c=qC(document.body),[u,f]=this._layoutHorizontalSegmentInPage(c,l,e.left-o.scrollLeft+this._contentLeft,i),[g,m]=this._layoutHorizontalSegmentInPage(c,l,t.left-o.scrollLeft+this._contentLeft,i),_=22,C=22,b=d>=_,v=h+n<=c.height-C;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,_),aboveLeft:f,fitsBelow:v,belowTop:h,belowLeft:m}:{fitsAbove:b,aboveTop:r,aboveLeft:u,fitsBelow:v,belowTop:a,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new cf(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 c of t)c.lineNumber<i.lineNumber&&(i=c),c.lineNumber>n.lineNumber&&(n=c);let o=1073741824;for(const c of i.ranges)c.left<o&&(o=c.left);let r=1073741824;for(const c of n.ranges)c.left<r&&(r=c.left);const a=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop,l=new cf(a,o),d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.scrollTop,h=new cf(d,r);return[l,h]}_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=T0(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 cf(n.aboveTop,n.aboveLeft),position:1}}else if(r===2){if(!n)return null;if(o===2||n.fitsBelow)return{coordinate:new cf(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"&&T0(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"&&T0(this._actual.afterRender,this._actual,this._renderData.position)}};function T0(s,e,...t){try{return s.call(e,...t)}catch{return null}}let Ry=!0;class fP extends Pu{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ne(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=Ry?this._selections.slice(0,1):this._selections,i=t.map(o=>o.positionLineNumber);i.sort((o,r)=>o-r),zs(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(129);return this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),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 qz extends fP{_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 Gz extends fP{_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)}}st((s,e)=>{Ry=!1;const t=s.getColor(x6);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(mN)){const i=s.getColor(mN);i&&(Ry=!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 Zz extends Pu{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).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(58),this._typicalHalfwidthCharacterWidth=t.get(43).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 h=t[l];h.options.className&&(i[n++]=h)}i=i.sort((l,d)=>{if(l.options.zIndex<d.options.zIndex)return-1;if(l.options.zIndex>d.options.zIndex)return 1;const h=l.options.className,c=d.options.className;return h<c?-1:h>c?1:S.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 h='<div class="cdr '+d.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',c=Math.max(d.range.startLineNumber,o),u=Math.min(d.range.endLineNumber,r);for(let f=c;f<=u;f++){const g=f-o;i[g]+=h}}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null;for(let d=0,h=t.length;d<h;d++){const c=t[d];if(c.options.isWholeLine)continue;const u=c.options.className,f=!!c.options.showIfCollapsed;let g=c.range;if(f&&g.endColumn===1&&g.endLineNumber!==g.startLineNumber&&(g=new S(g.startLineNumber,g.startColumn,g.endLineNumber-1,this._context.model.getLineMaxColumn(g.endLineNumber-1))),r===u&&a===f&&S.areIntersectingOrTouching(l,g)){l=S.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,h=l.length;d<h;d++){const c=l[d];if(c.outsideRenderedLine)continue;const u=c.lineNumber-r;if(n&&c.ranges.length===1){const f=c.ranges[0];f.width===0&&(c.ranges[0]=new Sv(f.left,this._typicalHalfwidthCharacterWidth))}for(let f=0,g=c.ranges.length;f<g;f++){const m=c.ranges[f],_='<div class="cdr '+i+'" style="left:'+String(m.left)+"px;width:"+String(m.width)+"px;height:"+o+'px;"></div>';a[u]+=_}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class ss extends H{onclick(e,t){this._register(q(e,ue.CLICK,i=>t(new cs(i))))}onmousedown(e,t){this._register(q(e,ue.MOUSE_DOWN,i=>t(new cs(i))))}onmouseover(e,t){this._register(q(e,ue.MOUSE_OVER,i=>t(new cs(i))))}onnonbubblingmouseout(e,t){this._register(ZD(e,i=>t(new cs(i))))}onkeydown(e,t){this._register(q(e,ue.KEY_DOWN,i=>t(new Ot(i))))}onkeyup(e,t){this._register(q(e,ue.KEY_UP,i=>t(new Ot(i))))}oninput(e,t){this._register(q(e,ue.INPUT,t))}onblur(e,t){this._register(q(e,ue.BLUR,t))}onfocus(e,t){this._register(q(e,ue.FOCUS,t))}ignoreGesture(e){lt.ignoreTarget(e)}}const au=11;class Yz extends ss{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=au+"px",this.domNode.style.height=au+"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 Lh),this.onmousedown(this.bgDomNode,t=>this._arrowMouseDown(t)),this.onmousedown(this.domNode,t=>this._arrowMouseDown(t)),this._mousedownRepeatTimer=this._register(new Ap),this._mousedownScheduleRepeatTimer=this._register(new hn)}_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,Ou,i=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Xz extends H{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 hn)}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 Qz=140;class gP extends ss{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 Xz(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new Lh),this._shouldRender=!0,this.domNode=Ke(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 Yz(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Ke(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=Ii(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,Ou,r=>{const a=this._sliderOrthogonalMousePosition(r),l=Math.abs(a-n);if(Ai&&l>Qz){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const h=this._sliderMousePosition(r)-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(h))},()=>{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 Jz=20;class Wg{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 Wg(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(Jz,Math.floor(i*a/n))),h=(a-d)/(n-i),c=o*h;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(d),computedSliderRatio:h,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){const e=Wg._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 eU=Zs("scrollbar-button-left",ie.triangleLeft),tU=Zs("scrollbar-button-right",ie.triangleRight);class iU extends gP{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Wg(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-au)/2,a=(t.horizontalScrollbarSize-au)/2;this._createArrow({className:"scra",icon:eU,top:a,left:r,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new qc(null,1,0))}),this._createArrow({className:"scra",icon:tU,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new qc(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 nU=Zs("scrollbar-button-up",ie.triangleUp),sU=Zs("scrollbar-button-down",ie.triangleDown);class oU extends gP{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Wg(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-au)/2,a=(t.verticalScrollbarSize-au)/2;this._createArrow({className:"scra",icon:nU,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new qc(null,0,1))}),this._createArrow({className:"scra",icon:sU,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new qc(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 nC{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 nC(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 nC(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 Tv extends H{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 nC(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 Vg(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=Vg.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 EN{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function A0(s,e){const t=e-s;return function(i){return s+t*lU(i)}}function rU(s,e,t){return function(i){return i<t?s(i/t):e((i-t)/(1-t))}}class Vg{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),rU(A0(e,o),A0(r,t),.33)}return A0(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 EN(i,n,!1)}return new EN(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return Vg.start(e,t,i)}static start(e,t,i){i=i+10;const n=Date.now()-10;return new Vg(e,t,n,i)}}function aU(s){return Math.pow(s,3)}function lU(s){return 1-aU(1-s)}const dU=500,NN=50;class hU{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class My{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 hU(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}}My.INSTANCE=new My;class pP extends ss{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=cU(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 oU(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new iU(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=Ke(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ke(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ke(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 hn),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=qe(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,Me&&(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=qe(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new qc(n))};this._mouseWheelToDispose.push(q(this._listenOnDomNode,ue.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){const t=My.INSTANCE;{const o=window.devicePixelRatio/j5();Ai||Cn?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=!Me&&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 h=NN*o,c=l.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(d,c)}if(r){const h=NN*r,c=l.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));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(),dU)}}class dk extends pP{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Tv(0,n=>hr(n));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class hk extends pP{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 Up extends dk{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 cU(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,Me&&(e.className+=" mac"),e}class uU extends ws{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(91),a=o.get(66),l=o.get(34),d=o.get(94),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+qb(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 hk(t.domNode,h,this._context.viewLayout.getScrollable())),fr.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Ke(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const c=(u,f,g)=>{const m={};{const _=u.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,u.scrollTop=0)}if(g){const _=u.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,u.scrollLeft=0)}this._context.model.setScrollPosition(m,1)};this._register(q(i.domNode,"scroll",u=>c(i.domNode,!0,!0))),this._register(q(t.domNode,"scroll",u=>c(t.domNode,!0,!1))),this._register(q(n.domNode,"scroll",u=>c(n.domNode,!0,!1))),this._register(q(this.scrollbarDomNode.domNode,"scroll",u=>c(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(129);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(64).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(91)||e.hasChanged(66)||e.hasChanged(34)){const t=this._context.configuration.options,i=t.get(91),n=t.get(66),o=t.get(34),r=t.get(94),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(129)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+qb(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}st((s,e)=>{const t=s.getColor(zp);t&&e.addRule(`
  75. .monaco-scrollable-element > .shadow.top {
  76. box-shadow: ${t} 0 6px 6px -6px inset;
  77. }
  78. .monaco-scrollable-element > .shadow.left {
  79. box-shadow: ${t} 6px 0 6px -6px inset;
  80. }
  81. .monaco-scrollable-element > .shadow.top.left {
  82. box-shadow: ${t} 6px 6px 6px -6px inset;
  83. }
  84. `);const i=s.getColor(Jf);i&&e.addRule(`
  85. .monaco-scrollable-element > .scrollbar > .slider {
  86. background: ${i};
  87. }
  88. `);const n=s.getColor(eg);n&&e.addRule(`
  89. .monaco-scrollable-element > .scrollbar > .slider:hover {
  90. background: ${n};
  91. }
  92. `);const o=s.getColor(tg);o&&e.addRule(`
  93. .monaco-scrollable-element > .scrollbar > .slider.active {
  94. background: ${o};
  95. }
  96. `)});class sC{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class ck extends Pu{_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],h=d.className;let c=Math.max(d.startLineNumber,e)-e;const u=Math.min(d.endLineNumber,t)-e;o===h?(c=Math.max(r+1,c),r=Math.max(r,u)):(o=h,r=u);for(let f=c;f<=r;f++)n[f].push(o)}return n}}class fU extends ck{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._glyphMargin=t.get(49),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(129);return this._lineHeight=t.get(58),this._glyphMargin=t.get(49),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 sC(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 h=t;h<=i;h++){const c=h-t,u=n[c];u.length===0?d[c]="":d[c]='<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 gU extends Pu{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(130),n=t.get(43);this._lineHeight=t.get(58),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),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(130),n=t.get(43);return this._lineHeight=t.get(58),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const n=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(n)?!1:(this._primaryPosition=n,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,o;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const r=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.scrollWidth,d=this._lineHeight,h=this._primaryPosition,c=this.getGuidesByLine(r,a,h),u=[];for(let f=r;f<=a;f++){const g=f-r,m=c[g];let _="";const C=(i=(t=e.visibleRangeForPosition(new F(f,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(const b of m){const v=C+(b.visibleColumn-1)*this._spaceWidth;if(v>l||this._maxIndentLeft>0&&v>this._maxIndentLeft)break;const w=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",y=b.horizontalLine?((o=(n=e.visibleRangeForPosition(new F(f,b.horizontalLine.endColumn)))===null||n===void 0?void 0:n.left)!==null&&o!==void 0?o:v+this._spaceWidth)-v:this._spaceWidth;_+=`<div class="core-guide ${b.className} ${w}" style="left:${v}px;height:${d}px;width:${y}px"></div>`}u[g]=_}this._renderResult=u}getGuidesByLine(e,t,i){const n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.model.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Sd.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Sd.EnabledForActive:Sd.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.model.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&i){const c=this._context.model.getActiveIndentGuide(i.lineNumber,e,t);r=c.startLineNumber,a=c.endLineNumber,l=c.indent}const{indentSize:d}=this._context.model.getTextModelOptions(),h=[];for(let c=e;c<=t;c++){const u=new Array;h.push(u);const f=n?n[c-e]:[],g=new Hf(f),m=o?o[c-e]:[];for(let _=1;_<=m;_++){const C=(_-1)*d+1,b=f.length===0&&r<=c&&c<=a&&_===l;u.push(...g.takeWhile(w=>w.visibleColumn<C)||[]);const v=g.peek();(!v||v.visibleColumn!==C||v.horizontalLine)&&u.push(new mc(C,b?"core-guide-indent-active":"core-guide-indent",null))}u.push(...g.takeWhile(_=>!0)||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function Om(s){if(!(s&&s.isTransparent()))return s}st((s,e)=>{const t=s.getColor(xv);t&&e.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${t} inset; }`);const i=s.getColor(kv)||t;i&&e.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=[{bracketColor:JO,guideColor:K6,guideColorActive:Q6},{bracketColor:eP,guideColor:q6,guideColorActive:J6},{bracketColor:tP,guideColor:G6,guideColorActive:ez},{bracketColor:iP,guideColor:Z6,guideColorActive:tz},{bracketColor:nP,guideColor:Y6,guideColorActive:iz},{bracketColor:sP,guideColor:X6,guideColorActive:nz}],o=new rP;let r=n.map(a=>{var l,d;const h=s.getColor(a.bracketColor),c=s.getColor(a.guideColor),u=s.getColor(a.guideColorActive),f=Om((l=Om(c))!==null&&l!==void 0?l:h==null?void 0:h.transparent(.3)),g=Om((d=Om(u))!==null&&d!==void 0?d:h);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(nW);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${o.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${o.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${o.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${o.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}});class pU{constructor(){this._currentVisibleRange=new S(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class mU{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 _U{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 Av extends ws{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new cP(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(43),r=n.get(130);this._lineHeight=n.get(58),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=n.get(88),this._cursorSurroundingLines=n.get(25),this._cursorSurroundingLinesStyle=n.get(26),this._canUseLayerHinting=!n.get(28),this._viewLineOptions=new qE(i,this._context.theme.type),fr.write(this.domNode,7),this.domNode.setClassName(`view-lines ${Nd}`),Ui.applyFontInfo(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new Lt(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Lt(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new pU,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Xo(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(130)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(43),n=t.get(130);return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(88),this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),Ui.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(129)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new qE(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 mU(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 _U(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 F(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 F(n,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===Xo.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=S.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],r=0;const a=new KE(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new F(n.startLineNumber,1)).lineNumber);const d=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let c=n.startLineNumber;c<=n.endLineNumber;c++){if(c<d||c>h)continue;const u=c===n.startLineNumber?n.startColumn:1,f=c===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(c),g=this._visibleLines.getVisibleLine(c).getVisibleRangesForRange(c,u,f,a);if(g){if(t&&c<i){const m=l;l=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new F(c+1,1)).lineNumber,m!==l&&(g.ranges[g.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[r++]=new P8(g.outsideRenderedLine,c,Sv.from(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(e,t,i,new KE(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new F8(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(),Cn&&!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,h,c;if(n&&n.length>0){let g=n[0].startLineNumber,m=n[0].endLineNumber;for(let _=1,C=n.length;_<C;_++){const b=n[_];g=Math.min(g,b.startLineNumber),m=Math.max(m,b.endLineNumber)}d=!1,h=this._context.viewLayout.getVerticalOffsetForLineNumber(g),c=this._context.viewLayout.getVerticalOffsetForLineNumber(m)+this._lineHeight}else if(i)d=!0,h=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),c=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);h-=g*this._lineHeight,c+=Math.max(0,g-1)*this._lineHeight}(o===0||o===4)&&(c+=this._lineHeight);let f;if(c-h>a){if(!d)return-1;f=h}else if(o===5||o===6)if(o===6&&r<=h&&c<=l)f=r;else{const g=Math.max(5*this._lineHeight,a*.2),m=h-g,_=c-a;f=Math.max(_,m)}else if(o===1||o===2)if(o===2&&r<=h&&c<=l)f=r;else{const g=(h+c)/2;f=Math.max(0,g-a/2)}else f=this._computeMinimumScrolling(r,l,h,c,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,Math.round(d.left)),r=Math.max(r,Math.round(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 h of d.ranges)o=Math.min(o,Math.round(h.left)),r=Math.max(r,Math.round(h.left+h.width))}return o=Math.max(0,o-Av.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}}Av.HORIZONTAL_EXTRA_PX=30;class bU extends ck{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(129);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(129);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 sC(a.range.startLineNumber,a.range.endLineNumber,l));const d=a.options.firstLineDecorationClassName;d&&(i[n++]=new sC(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 h=d-t,c=n[h];let u="";for(let f=0,g=c.length;f<g;f++)u+='<div class="cldr '+c[f]+a;l[h]=u}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class CU extends ck{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 sC(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 h=0,c=l.length;h<c;h++)d+='<div class="cmdr '+l[h]+'" style=""></div>';o[a]=d}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class us{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=us._clamp(e),this.g=us._clamp(t),this.b=us._clamp(i),this.a=us._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}}us.Empty=new us(0,0,0,0);class $p extends H{constructor(){super(),this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Rt.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}static getInstance(){return this._INSTANCE||(this._INSTANCE=new $p),this._INSTANCE}_updateColorMap(){const e=Rt.getColorMap();if(!e){this._colors=[us.Empty],this._backgroundIsLight=!0;return}this._colors=[us.Empty];for(let i=1;i<e.length;i++){const n=e[i].rgba;this._colors[i]=new us(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}}$p._INSTANCE=null;const vU=(()=>{const s=[];for(let e=32;e<=126;e++)s.push(e);return s.push(65533),s})(),wU=(s,e)=>(s-=32,s<0||s>96?e<=2?(s+96)%96:95:s);class Hg{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Hg.soften(e,12/15),this.charDataLight=Hg.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]=Eb(e[n]*t);return i}renderChar(e,t,i,n,o,r,a,l,d,h,c){const u=1*this.scale,f=2*this.scale,g=c?1:f;if(t+u>e.width||i+g>e.height){console.warn("bad render request outside image data");return}const m=h?this.charDataLight:this.charDataNormal,_=wU(n,d),C=e.width*4,b=a.r,v=a.g,w=a.b,y=o.r-b,k=o.g-v,L=o.b-w,D=Math.max(r,l),N=e.data;let B=_*u*f,O=i*C+t*4;for(let $=0;$<g;$++){let K=O;for(let le=0;le<u;le++){const de=m[B++]/255*(r/255);N[K++]=b+y*de,N[K++]=v+k*de,N[K++]=w+L*de,N[K++]=D}O+=C}}blockRenderChar(e,t,i,n,o,r,a,l){const d=1*this.scale,h=2*this.scale,c=l?1:h;if(t+d>e.width||i+c>e.height){console.warn("bad render request outside image data");return}const u=e.width*4,f=.5*(o/255),g=r.r,m=r.g,_=r.b,C=n.r-g,b=n.g-m,v=n.b-_,w=g+C*f,y=m+b*f,k=_+v*f,L=Math.max(o,a),D=e.data;let N=i*u+t*4;for(let B=0;B<c;B++){let O=N;for(let $=0;$<d;$++)D[O++]=w,D[O++]=y,D[O++]=k,D[O++]=L;N+=u}}}const TN={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},AN=s=>{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t<s.length;t+=2)e[t>>1]=TN[s[t]]<<4|TN[s[t+1]]&15;return e},RN={1:ha(()=>AN("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:ha(()=>AN("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class ng{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return RN[e]?i=new Hg(RN[e](),e):i=ng.createFromSampleData(ng.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 vU)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=ng._downsample(e,t);return new Hg(n,t)}static _downsampleChar(e,t,i,n,o){const r=1*o,a=2*o;let l=n,d=0;for(let h=0;h<a;h++){const c=h/a*16,u=(h+1)/a*16;for(let f=0;f<r;f++){const g=f/r*10,m=(f+1)/r*10;let _=0,C=0;for(let v=c;v<u;v++){const w=t+Math.floor(v)*3840,y=1-(v-Math.floor(v));for(let k=g;k<m;k++){const L=1-(k-Math.floor(k)),D=w+Math.floor(k)*4,N=L*y;C+=N,_+=e[D]*e[D+3]/255*N}}const b=_/C;d=Math.max(d,b),i[l++]=Eb(b)}}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 h=0;h<n;h++)o[h]*=d}return o}}const SU=140,yU=2;class zg{constructor(e,t,i){const n=e.options,o=n.get(127),r=n.get(129),a=r.minimap,l=n.get(43),d=n.get(64);this.renderMinimap=a.renderMinimap,this.size=d.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(93),this.showSlider=d.showSlider,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(58),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=ha(()=>ng.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=zg._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=zg._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(m6);return i?new us(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(_6);return t?us._clamp(Math.round(255*t.rgba.a)):255}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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class sg{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,h,c){const u=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){const y=l*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),k=Math.max(1,Math.floor(o*o/y)),L=Math.max(0,e.minimapHeight-k),D=L/(h-o),N=d*D,B=L>0,O=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new sg(d,h,B,D,N,k,1,Math.min(a,O))}let _;if(r&&i!==a){const y=i-t+1;_=Math.floor(y*f/u)}else{const y=o/m;_=Math.floor(y*f/u)}let C;e.scrollBeyondLastLine?C=(a-1)*f/u:C=Math.max(0,a*f/u-_),C=Math.min(e.minimapHeight-_,C);const b=C/(h-o),v=d*b;let w=0;if(e.scrollBeyondLastLine&&(w=o/m-1),g>=a+w){const k=a,L=C>0;return new sg(d,h,L,b,v,_,1,k)}else{let y=Math.max(1,Math.floor(t-v*u/f));c&&c.scrollHeight===h&&(c.scrollTop>d&&(y=Math.min(y,c.startLineNumber)),c.scrollTop<d&&(y=Math.max(y,c.startLineNumber)));const k=Math.min(a,y+g-1),L=(d-n)/m,D=(t-y+L)*f/u;return new sg(d,h,!0,b,D,_,y,k)}}}class oC{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}oC.INVALID=new oC(-1);class MN{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new hP(()=>oC.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 uk{constructor(e,t,i,n){this._backgroundFillData=uk._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=i.a,l=new Uint8ClampedArray(e*t*4);let d=0;for(let h=0;h<t;h++)for(let c=0;c<e;c++)l[d]=n,l[d+1]=o,l[d+2]=r,l[d+3]=a,d+=4;return l}}class Ug{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}=Ec.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 v=[];if(v[0]=1,a>1){for(let w=0,y=a-1;w<y;w++)v[w]=Math.round(w*l+d);v[a-1]=t}return[new Ug(l,v),[]]}const h=i.minimapLines,c=h.length;let u=[],f=0,g=0,m=1;const _=10;let C=[],b=null;for(let v=0;v<a;v++){const w=Math.max(m,Math.round(v*l)),y=Math.max(w,Math.round((v+1)*l));for(;f<c&&h[f]<w;){if(C.length<_){const L=f+1+g;b&&b.type==="deleted"&&b._oldIndex===f-1?b.deleteToLineNumber++:(b={type:"deleted",_oldIndex:f,deleteFromLineNumber:L,deleteToLineNumber:L},C.push(b)),g--}f++}let k;if(f<c&&h[f]<=y)k=h[f],f++;else if(v===0?k=1:v+1===a?k=t:k=Math.round(v*l+d),C.length<_){const L=f+1+g;b&&b.type==="inserted"&&b._i===v-1?b.insertToLineNumber++:(b={type:"inserted",_i:v,insertFromLineNumber:L,insertToLineNumber:L},C.push(b)),g++}u[v]=k,m=k}if(C.length<_)for(;f<c;){const v=f+1+g;b&&b.type==="deleted"&&b._oldIndex===f-1?b.deleteToLineNumber++:(b={type:"deleted",_oldIndex:f,deleteFromLineNumber:v,deleteToLineNumber:v},C.push(b)),g--,f++}else C=[{type:"flush"}];return[new Ug(l,u),C]}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 LU extends ws{constructor(e){super(e),this.tokensColorTracker=$p.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new zg(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=Ug.compute(this.options,this._context.model.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new rC(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new zg(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]=Ug.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)}getLineMaxColumn(e){return this._samplingState?this._context.model.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.model.getLineMaxColumn(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 ne(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 S(o,1,r,this._context.model.getLineMaxColumn(r))}else i=new S(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 UM(new S(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 S(e,1,e,1),1,0)}setScrollTop(e){this._context.model.setScrollPosition({scrollTop:e},1)}}class rC extends H{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(fN),this._domNode=Ke(document.createElement("div")),fr.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=Ke(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Ke(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Ke(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Ke(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=Ke(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._mouseDownListener=ii(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=Ii(this._slider.domNode),h=d.top+d.height/2;this._startSliderDragging(i.buttons,i.posx,h,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 Lh,this._sliderMouseDownListener=ii(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=lt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=q(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=q(this._domNode.domNode,vt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=ii(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(Ai&&d>SU){this._model.setScrollTop(o.scrollTop);return}const h=a-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(h))};n!==i&&r(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,Ou,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 uk(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(fN),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=sg.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),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),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();t.sort(S.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{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 h=new ON(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(d,t,h,e,r),this._renderDecorationsLineHighlights(d,i,h,e,r);const c=new ON(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(d,t,c,e,r,l,a,n),this._renderDecorationsHighlights(d,i,c,e,r,l,a,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const d=Math.max(n.startLineNumber,l.startLineNumber),h=Math.min(n.endLineNumber,l.endLineNumber);if(d>h)continue;for(let f=d;f<=h;f++)i.set(f,!0);const c=(d-n.startLineNumber)*o,u=(h-n.startLineNumber)*o+o;a>=c||(a>r&&e.fillRect(Ta,r,e.canvas.width,a-r),r=c),a=u}a>r&&e.fillRect(Ta,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],d=l.options.minimap;if(!d||d.position!==fs.Inline)continue;const h=Math.max(n.startLineNumber,l.range.startLineNumber),c=Math.min(n.endLineNumber,l.range.endLineNumber);if(h>c)continue;const u=d.getColor(this._theme);if(!u||u.isTransparent())continue;let f=r.get(u.toString());f||(f=u.transparent(.5).toString(),r.set(u.toString(),f)),e.fillStyle=f;for(let g=h;g<=c;g++){if(i.has(g))continue;i.set(g,!0);const m=(h-n.startLineNumber)*o;e.fillRect(Ta,m,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const d of t){const h=Math.max(n.startLineNumber,d.startLineNumber),c=Math.min(n.endLineNumber,d.endLineNumber);if(!(h>c))for(let u=h;u<=c;u++)this.renderDecorationOnLine(e,i,d,this._selectionColor,n,u,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,l){for(const d of t){const h=d.options.minimap;if(!h)continue;const c=Math.max(n.startLineNumber,d.range.startLineNumber),u=Math.min(n.endLineNumber,d.range.endLineNumber);if(c>u)continue;const f=h.getColor(this._theme);if(!(!f||f.isTransparent()))for(let g=c;g<=u;g++)switch(h.position){case fs.Inline:this.renderDecorationOnLine(e,i,d.range,f,n,g,o,o,r,a,l);continue;case fs.Gutter:const m=(g-n.startLineNumber)*o;this.renderDecoration(e,f,2,m,yU,o);continue}}}renderDecorationOnLine(e,t,i,n,o,r,a,l,d,h,c){const u=(r-o.startLineNumber)*l;if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,m=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),C=this.getXOffsetForPosition(t,r,m,d,h,c),b=this.getXOffsetForPosition(t,r,_,d,h,c);this.renderDecoration(e,n,C,u,b-C,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return Ta;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const d=this._model.getLineContent(t);l=[Ta];let h=Ta;for(let c=1;c<d.length+1;c++){const u=d.charCodeAt(c-1),f=u===9?n*o:go(u)?2*o:o,g=h+f;if(g>=r){l[c]=r;break}l[c]=g,h=g}e.set(t,l)}return i-1<l.length?l[i-1]:r}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 de=this._lastRenderData._get();return new MN(e,de.imageData,de.lines)}const o=this._getBuffer();if(!o)return null;let[r,a,l]=rC._renderUntouchedLines(o,t,i,n,this._lastRenderData);const d=this._model.getMinimapLinesRenderingData(t,i,l),h=this._model.getOptions().tabSize,c=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),_=this._model.options.renderMinimap,C=this._model.options.charRenderer(),b=this._model.options.fontScale,v=this._model.options.minimapCharWidth,y=(_===1?2:3)*b,k=n>y?Math.floor((n-y)/2):0,L=u.a/255,D=new us(Math.round((u.r-c.r)*L+c.r),Math.round((u.g-c.g)*L+c.g),Math.round((u.b-c.b)*L+c.b),255);let N=0;const B=[];for(let de=0,_e=i-t+1;de<_e;de++)l[de]&&rC._renderLine(o,D,u.a,m,_,v,g,f,C,N,k,h,d[de],b,n),B[de]=new oC(N),N+=n;const O=r===-1?0:r,K=(a===-1?o.height:a)-O;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,O,o.width,K),new MN(e,o,B)}static _renderUntouchedLines(e,t,i,n,o){const r=[];if(!o){for(let D=0,N=i-t+1;D<N;D++)r[D]=!0;return[-1,-1,r]}const a=o._get(),l=a.imageData.data,d=a.rendLineNumberStart,h=a.lines,c=h.length,u=e.width,f=e.data,g=(i-t+1)*n*u*4;let m=-1,_=-1,C=-1,b=-1,v=-1,w=-1,y=0;for(let D=t;D<=i;D++){const N=D-t,B=D-d,O=B>=0&&B<c?h[B].dy:-1;if(O===-1){r[N]=!0,y+=n;continue}const $=O*u*4,K=(O+n)*u*4,le=y*u*4,de=(y+n)*u*4;b===$&&w===le?(b=K,w=de):(C!==-1&&(f.set(l.subarray(C,b),v),m===-1&&C===0&&C===v&&(m=b),_===-1&&b===g&&C===v&&(_=C)),C=$,b=K,v=le,w=de),r[N]=!1,y+=n}C!==-1&&(f.set(l.subarray(C,b),v),m===-1&&C===0&&C===v&&(m=b),_===-1&&b===g&&C===v&&(_=C));const k=m===-1?-1:m/(u*4),L=_===-1?-1:_/(u*4);return[k,L,r]}static _renderLine(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m){const _=f.content,C=f.tokens,b=e.width-r,v=m===1;let w=Ta,y=0,k=0;for(let L=0,D=C.getCount();L<D;L++){const N=C.getEndOffset(L),B=C.getForeground(L),O=a.getColor(B);for(;y<N;y++){if(w>b)return;const $=_.charCodeAt(y);if($===9){const K=u-(y+k)%u;k+=K-1,w+=K*r}else if($===32)w+=r;else{const K=go($)?2:1;for(let le=0;le<K;le++)if(o===2?d.blockRenderChar(e,w,h+c,O,l,t,i,v):d.renderChar(e,w,h+c,$,O,l,t,i,g,n,v),w+=r,w>b)return}}}}}class ON{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;n<o;n++)this._values[n]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}st((s,e)=>{const t=s.getColor(b6);t&&e.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${t}; }`);const i=s.getColor(C6);i&&e.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${i}; }`);const n=s.getColor(v6);n&&e.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${n}; }`);const o=s.getColor(zp);o&&e.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${o} -6px 0 6px -6px inset; }`)});class DU extends ws{constructor(e){super(e);const i=this._context.configuration.options.get(129);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=Ke(document.createElement("div")),fr.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(129);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=Ke(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 xU{constructor(e,t){const i=e.options;this.lineHeight=i.get(58),this.pixelRatio=i.get(127),this.overviewRulerLanes=i.get(73),this.renderBorder=i.get(72);const n=t.getColor(P6);this.borderColor=n?n.toString():null,this.hideCursor=i.get(51);const o=t.getColor(GO);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const r=i.get(64),a=r.enabled,l=r.side,d=a?t.getColor(F6)||Rt.getDefaultBackground():null;d===null||l==="left"?this.backgroundColor=null:this.backgroundColor=W.Format.CSS.formatHex(d);const c=i.get(129).overviewRuler;this.top=c.top,this.right=c.right,this.domWidth=c.width,this.domHeight=c.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,h=l+o+a;return[[0,l,d,l,h,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 kU extends ws{constructor(e){super(e),this._domNode=Ke(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=Rt.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new xU(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(F.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,h=this._domNode.domNode.getContext("2d");this._settings.backgroundColor===null?h.clearRect(0,0,e,t):(h.fillStyle=this._settings.backgroundColor,h.fillRect(0,0,e,t));const c=this._settings.x,u=this._settings.w;a.sort($M.cmp);for(const f of a){const g=f.color,m=f.data;h.fillStyle=g;let _=0,C=0,b=0;for(let v=0,w=m.length/3;v<w;v++){const y=m[3*v],k=m[3*v+1],L=m[3*v+2];let D=n.getVerticalOffsetForLineNumber(k)*r|0,N=(n.getVerticalOffsetForLineNumber(L)+i)*r|0;if(N-D<l){let O=(D+N)/2|0;O<d?O=d:O+d>t&&(O=t-d),D=O-d,N=O+d}D>b+1||y!==_?(v!==0&&h.fillRect(c[_],C,u[_],b-C),_=y,C=D,b=N):N>b&&(b=N)}h.fillRect(c[_],C,u[_],b-C)}if(!this._settings.hideCursor&&this._settings.cursorColor){const f=2*this._settings.pixelRatio|0,g=f/2|0,m=this._settings.x[7],_=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let C=-100,b=-100;for(let v=0,w=this._cursorPositions.length;v<w;v++){const y=this._cursorPositions[v];let k=n.getVerticalOffsetForLineNumber(y.lineNumber)*r|0;k<g?k=g:k+g>t&&(k=t-g);const L=k-g,D=L+f;L>b+1?(v!==0&&h.fillRect(m,C,_,b-C),C=L,b=D):D>b&&(b=D)}h.fillRect(m,C,_,b-C)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,t),h.stroke(),h.moveTo(0,0),h.lineTo(e,0),h.stroke())}}class PN{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 $g{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 IU{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($g.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 h=this._zones[l];if(!e){const b=h.getColorZones();if(b){a.push(b);continue}}const c=Math.floor(o*this._getVerticalOffsetForLine(h.startLineNumber)),u=Math.floor(o*(this._getVerticalOffsetForLine(h.endLineNumber)+t));let f=Math.floor((c+u)/2),g=u-f;g<r&&(g=r),f-g<0&&(f=g),f+g>i&&(f=i-g);const m=h.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const C=new PN(f-g,f+g,_);h.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(PN.compare),a}}class EU extends Bp{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Ke(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new IU(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(58)),this._zoneManager.setPixelRatio(i.get(127)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(58)&&(this._zoneManager.setLineHeight(t.get(58)),this._render()),e.hasChanged(127)&&(this._zoneManager.setPixelRatio(t.get(127)),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,h=l.from,c=l.to;d!==o?(e.fillRect(0,r,n,a-r),o=d,e.fillStyle=i[o],r=h,a=c):a>=h?a=Math.max(a,c):(e.fillRect(0,r,n,a-r),r=h,a=c)}e.fillRect(0,r,n,a-r)}}class NU extends ws{constructor(e){super(e),this.domNode=Ke(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(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).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=Ke(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)}}}st((s,e)=>{const t=s.getColor(R6);t&&e.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${t} inset; }`)});class TU extends ws{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(91);this._useShadows=i.useShadows,this._domNode=Ke(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(129);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(91);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":"")}}st((s,e)=>{const t=s.getColor(zp);t&&e.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${t} 0 6px 6px -6px inset; }`)});class AU{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class RU{constructor(e,t){this.lineNumber=e,this.ranges=t}}function MU(s){return new AU(s)}function OU(s){return new RU(s.lineNumber,s.ranges.map(MU))}class Ft extends Pu{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).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(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).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],h=d.left,c=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;Pm(h-g)<n?u.top=2:h>g&&(u.top=1),Pm(c-m)<n?f.top=2:g<c&&c<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;Pm(h-g)<n?u.bottom=2:g<h&&h<m&&(u.bottom=1),Pm(c-m)<n?f.bottom=2:c<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(OU);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 h=0,c=n.length;h<c;h++){const u=n[h],f=u.lineNumber,g=f-t,m=i&&(f===d||f===l)?a:r,_=i&&f===l?1:0;let C="",b="";for(let v=0,w=u.ranges.length;v<w;v++){const y=u.ranges[v];if(o){const L=y.startStyle,D=y.endStyle;if(L.top===1||L.bottom===1){C+=this._createSelectionPiece(_,m,Ft.SELECTION_CLASS_NAME,y.left-Ft.ROUNDED_PIECE_WIDTH,Ft.ROUNDED_PIECE_WIDTH);let N=Ft.EDITOR_BACKGROUND_CLASS_NAME;L.top===1&&(N+=" "+Ft.SELECTION_TOP_RIGHT),L.bottom===1&&(N+=" "+Ft.SELECTION_BOTTOM_RIGHT),C+=this._createSelectionPiece(_,m,N,y.left-Ft.ROUNDED_PIECE_WIDTH,Ft.ROUNDED_PIECE_WIDTH)}if(D.top===1||D.bottom===1){C+=this._createSelectionPiece(_,m,Ft.SELECTION_CLASS_NAME,y.left+y.width,Ft.ROUNDED_PIECE_WIDTH);let N=Ft.EDITOR_BACKGROUND_CLASS_NAME;D.top===1&&(N+=" "+Ft.SELECTION_TOP_LEFT),D.bottom===1&&(N+=" "+Ft.SELECTION_BOTTOM_LEFT),C+=this._createSelectionPiece(_,m,N,y.left+y.width,Ft.ROUNDED_PIECE_WIDTH)}}let k=Ft.SELECTION_CLASS_NAME;if(o){const L=y.startStyle,D=y.endStyle;L.top===0&&(k+=" "+Ft.SELECTION_TOP_LEFT),L.bottom===0&&(k+=" "+Ft.SELECTION_BOTTOM_LEFT),D.top===0&&(k+=" "+Ft.SELECTION_TOP_RIGHT),D.bottom===0&&(k+=" "+Ft.SELECTION_BOTTOM_RIGHT)}b+=this._createSelectionPiece(_,m,k,y.left,y.width)}e[g][0]+=C,e[g][1]+=b}}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]}}Ft.SELECTION_CLASS_NAME="selected-text";Ft.SELECTION_TOP_LEFT="top-left-radius";Ft.SELECTION_BOTTOM_LEFT="bottom-left-radius";Ft.SELECTION_TOP_RIGHT="top-right-radius";Ft.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Ft.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Ft.ROUNDED_PIECE_WIDTH=10;st((s,e)=>{const t=s.getColor(tl);t&&e.addRule(`.monaco-editor .focused .selected-text { background-color: ${t}; }`);const i=s.getColor(Qx);i&&e.addRule(`.monaco-editor .selected-text { background-color: ${i}; }`);const n=s.getColor(w9);n&&!n.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function Pm(s){return s<0?-s:s}class FN{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 BN{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(43);this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Ke(document.createElement("div")),this._domNode.setClassName(`cursor ${Nd}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Ui.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new F(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(43);return this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),Ui.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===wi.Line||this._cursorStyle===wi.LineThin){const u=e.visibleRangeForPosition(this._position);if(!u||u.outsideRenderedLine)return null;let f;if(this._cursorStyle===wi.Line){if(f=XI(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2){const _=this._context.model.getLineContent(this._position.lineNumber),C=gb(_,this._position.column-1);t=_.substr(this._position.column-1,C)}}else f=XI(1);let g=u.left;f>=2&&g>=1&&(g-=1);const m=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new FN(m,g,f,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=gb(i,this._position.column-1),o=e.linesVisibleRangesForRange(new S(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===wi.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 h=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,c=this._lineHeight;return(this._cursorStyle===wi.Underline||this._cursorStyle===wi.UnderlineThin)&&(h+=this._lineHeight-2,c=2),new FN(h,a.left,l,c,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 ${Nd} ${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 jg extends ws{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new BN(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Ke(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 hn,this._cursorFlatBlinkInterval=new Ap,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(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),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 BN(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()},jg.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},jg.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case wi.Line:e+=" cursor-line-style";break;case wi.Block:e+=" cursor-block-style";break;case wi.Underline:e+=" cursor-underline-style";break;case wi.LineThin:e+=" cursor-line-thin-style";break;case wi.BlockOutline:e+=" cursor-block-outline-style";break;case wi.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}}jg.BLINK_INTERVAL=500;st((s,e)=>{const t=s.getColor(GO);if(t){let i=s.getColor(T6);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 R0=()=>{throw new Error("Invalid change accessor")};class PU extends ws{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Ke(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=Ke(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],h=this._computeWhitespaceProps(d.delegate);d.isInHiddenArea=h.isInHiddenArea;const c=t.get(l);c&&(c.afterLineNumber!==h.afterViewLineNumber||c.height!==h.heightInPx)&&(n.changeOneWhitespace(l,h.afterViewLineNumber,h.heightInPx),this._safeCallOnComputedHeight(d.delegate,h.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(58)&&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{isInHiddenArea:!1,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 F(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{isInHiddenArea:!o,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)}};FU(e,n),n.addZone=R0,n.removeZone=R0,n.layoutZone=R0}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Ke(t.domNode),marginDomNode:t.marginDomNode?Ke(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 i.isInHiddenArea=n.isInHiddenArea,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){Le(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Le(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=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 h=0,c=0,u="none";i.hasOwnProperty(l)?(h=i[l].verticalOffset-e.bigNumbersDelta,c=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(h),d.domNode.setHeight(c),d.domNode.setDisplay(u),d.marginDomNode&&(d.marginDomNode.setTop(h),d.marginDomNode.setHeight(c),d.marginDomNode.setDisplay(u))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function FU(s,e){try{return s(e)}catch(t){Le(t)}}class BU{constructor(e){this._theme=e}get type(){return this._theme.type}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class WU{constructor(e,t,i){this.configuration=e,this.theme=new BU(t),this.model=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.model.addViewEventHandler(e)}removeEventHandler(e){this.model.removeViewEventHandler(e)}}class VU{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 S(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 HU extends Bp{constructor(e,t,i,n,o,r){super(),this._selections=[new ne(1,1,1,1)],this._renderAnimationFrame=null;const a=new Vz(t,n,o,e);this._context=new WU(t,i.getColorTheme(),n),this._configPixelRatio=this._context.configuration.options.get(127),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 Rz(this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Ke(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Ke(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Ke(document.createElement("div")),fr.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new uU(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Av(this._context,this._linesContent),this._viewZones=new PU(this._context),this._viewParts.push(this._viewZones);const l=new kU(this._context);this._viewParts.push(l);const d=new TU(this._context);this._viewParts.push(d);const h=new Uz(this._context);this._viewParts.push(h),h.addDynamicOverlay(new qz(this._context)),h.addDynamicOverlay(new Ft(this._context)),h.addDynamicOverlay(new gU(this._context)),h.addDynamicOverlay(new Zz(this._context));const c=new $z(this._context);this._viewParts.push(c),c.addDynamicOverlay(new Gz(this._context)),c.addDynamicOverlay(new fU(this._context)),c.addDynamicOverlay(new CU(this._context)),c.addDynamicOverlay(new bU(this._context)),c.addDynamicOverlay(new ru(this._context));const u=new Gd(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(c.getDomNode()),this._viewParts.push(u),this._contentWidgets=new jz(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new jg(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new DU(this._context),this._viewParts.push(this._overlayWidgets);const f=new NU(this._context);this._viewParts.push(f);const g=new LU(this._context);if(this._viewParts.push(g),l){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(l.getDomNode(),m.insertBefore)}this._linesContent.appendChild(h.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 Az(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 vz(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 F(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new F(e,t)))}}_applyLayout(){const t=this._context.configuration.options.get(129);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(126)+" "+qb(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(127),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=KR(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){zU(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!qD(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 VU(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 O8(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(lb()-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 F(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Nv.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new EU(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 S(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 zU(s){try{return s()}catch(e){Le(e)}}class aC{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new vi(new S(1,1,1,1),0,new F(1,1),0),new vi(new S(1,1,1,1),0,new F(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 Re(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.getDirection()===0?new ne(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new ne(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)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,r),l=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(l)?t:new vi(S.fromPositions(a,l),t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=aC._validateViewState(e.viewModel,i)),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 vi(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 vi(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 vi(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new F(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new F(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new S(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new vi(r,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class WN{constructor(e){this.context=e,this.primaryCursor=new aC(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(Re.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 aC(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,h=n.index<o.index?i+1:i,c=t[h].index,u=t[d].index,f=t[h].selection,g=t[d].selection;if(!f.equalsSelection(g)){const m=f.plusRange(g),_=f.selectionStartLineNumber===f.startLineNumber&&f.selectionStartColumn===f.startColumn,C=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let b;c===this.lastAddedCursorIndex?(b=_,this.lastAddedCursorIndex=u):b=C;let v;b?v=new ne(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):v=new ne(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[d].selection=v;const w=Re.fromModelSelection(v);e[u].setState(this.context,w.modelState,w.viewState)}for(const m of t)m.index>c&&m.index--;e.splice(c,1),t.splice(h,1),this._removeSecondaryCursor(c-1),i--}}}}class UU{constructor(){this.type=0}}class $U{constructor(){this.type=1}}class jU{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class KU{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class Qh{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class Fm{constructor(){this.type=5}}class qU{constructor(e){this.type=6,this.isFocused=e}}class GU{constructor(){this.type=7}}class Bm{constructor(){this.type=8}}class mP{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class Oy{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Py{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class O_{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 ZU{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 YU{constructor(){this.type=14}}class XU{constructor(e){this.type=15,this.ranges=e}}class QU{constructor(){this.type=16}}let JU=class{constructor(){this.type=17}};class e$ extends H{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._emitOutgoingEvents()}_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)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let 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 t$),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._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class t${constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class fk{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 fk(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class gk{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 gk(this.oldHasFocus,e.hasFocus)}}class pk{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 pk(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class VN{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class lC{constructor(e,t,i,n,o,r,a){this.kind=6,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 lC._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}merge(e){return e.kind!==6?this:new lC(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class i${constructor(){this.kind=5}isNoOp(){return!1}merge(e){return this}}class M0{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 HN{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(S.compareRangesUsingStarts),e.sort(S.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class lu extends H{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new SN(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new WN(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=qe(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new SN(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){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>lu.MAX_CURSOR_COUNT&&(n=n.slice(0,lu.MAX_CURSOR_COUNT),o=!0);const r=new M0(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 S(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 S(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 O_(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,h=l;r.selectionStart&&r.selectionStart.lineNumber&&(d=r.selectionStart.lineNumber),r.selectionStart&&r.selectionStart.column&&(h=r.selectionStart.column),i.push({selectionStartLineNumber:d,selectionStartColumn:h,positionLineNumber:a,positionColumn:l})}this.setStates(e,"restoreState",0,Re.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!0,1)}onModelContentChanged(e,t){if(t instanceof IO){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{if(this._knownModelVersionId=t.versionId,this._isHandling)return;const i=t.containsEvent(1);if(this._prevEditOperationType=0,i)this._cursors.dispose(),this._cursors=new WN(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&t.resultingSelection&&t.resultingSelection.length>0){const n=Re.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,Re.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:ct.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:ct.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Re.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 HN(this._model,o,r))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=n$.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 dP&&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 M0(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new KU(l,a)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((d,h)=>!d.modelState.equals(n.cursorState[h].modelState))){const d=n?n.cursorState.map(c=>c.modelState.selection):null,h=n?n.modelVersionId:0;e.emitOutgoingEvent(new lC(d,a,h,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(`
  97. `)>=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,h=o.text.length-r[2].length-1,c=o.text.lastIndexOf(d,h-1);if(c===-1)return null;t.push([c,h])}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 c=0,u=o.length;c<u;c++){const[f,g]=o[c],m=d[c],_=m.range.startLineNumber,C=m.range.startColumn-1+f,b=m.range.startColumn-1+g;r.push(new S(_,b+1,_,b+2)),a.push(new S(_,C+1,_,b+2))}const h=n(d);return h&&(this._isHandling=!0),h});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 M0(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Le(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 HN.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{t==="keyboard"&&(this._executeEditOperation(It.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=gb(t,o),a=t.substr(o,r);this._executeEditOperation(It.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=r}}else this._executeEditOperation(It.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 ne(d.lineNumber,d.column+o,d.lineNumber,d.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(It.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(It.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Zd.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Dn(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Dn(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}lu.MAX_CURSOR_COUNT=1e4;class n${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,h=n.length;d<h;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 h=[];for(let f=0;f<e.selectionsBefore.length;f++)h[f]=[];for(const f of d)f.identifier&&h[f.identifier.major].push(f);const c=(f,g)=>f.identifier.minor-g.identifier.minor;let u=[];for(let f=0;f<e.selectionsBefore.length;f++)h[f].length>0?(h[f].sort(c),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>h[f],getTrackedSelection:g=>{const m=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new ne(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new ne(_.endLineNumber,_.endColumn,_.startLineNumber,_.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,h)=>h-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=(c,u,f=!1)=>{S.isEmpty(c)&&u===""||n.push({identifier:{major:t,minor:o++},range:c,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const h={addEditOperation:r,addTrackedEditOperation:(c,u,f)=>{a=!0,r(c,u,f)},trackSelection:(c,u)=>{const f=ne.liftSelection(c);let g;if(f.isEmpty())if(typeof u=="boolean")u?g=2:g=3;else{const C=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===C?g=2:g=3}else g=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,h)}catch(c){return Le(c),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-S.compareRangesUsingEnds(i.range,n.range));let t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(S.getStartPosition(n.range).isBefore(S.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 _P{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 zN={getInitialState:()=>Op,tokenize2:(s,e,t,i)=>cx(0,s,t,i)};function bP(s,e,t=zN){return o$(s,e,t||zN)}function s$(s,e,t,i,n,o,r){let a="<div>",l=i,d=0,h=!0;for(let c=0,u=e.getCount();c<u;c++){const f=e.getEndOffset(c);if(f<=i)continue;let g="";for(;l<f&&l<n;l++){const m=s.charCodeAt(l);switch(m){case 9:let _=o-(l+d)%o;for(d+=_-1;_>0;)r&&h?(g+="&#160;",h=!1):(g+=" ",h=!0),_--;break;case 60:g+="&lt;",h=!1;break;case 62:g+="&gt;",h=!1;break;case 38:g+="&amp;",h=!1;break;case 0:g+="&#00;",h=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",h=!1;break;case 13:g+="&#8203",h=!1;break;case 32:r&&h?(g+="&#160;",h=!1):(g+=" ",h=!0);break;default:g+=String.fromCharCode(m),h=!1}}if(a+=`<span style="${e.getInlineStyle(c,t)}">${g}</span>`,f>n||l>=n)break}return a+="</div>",a}function o$(s,e,t){let i='<div class="monaco-tokenized-source">';const n=cr(s);let o=t.getInitialState();for(let r=0,a=n.length;r<a;r++){const l=n[r];r>0&&(i+="<br/>");const d=t.tokenize2(l,!0,o,0);yi.convertToEndOffset(d.tokens,l.length);const c=new yi(d.tokens,l,e).inflate();let u=0;for(let f=0,g=c.getCount();f<g;f++){const m=c.getClassName(f),_=c.getEndOffset(f);i+=`<span class="${m}">${QD(l.substring(u,_))}</span>`,u=_}o=d.endState}return i+="</div>",i}class r${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 a${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 Kg{constructor(e,t,i,n){this._instanceId=rM(++Kg.INSTANCE_COUNT),this._pendingChanges=new r$,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 a$(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 h of l)if(!n.has(h.id)){if(o.has(h.id)){const c=o.get(h.id);h.afterLineNumber=c.newAfterLineNumber,h.height=c.newHeight}d.push(h)}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=Kg.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,h;a===-1?(a=l,h=r+1,d=0):(h=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);let c=o,u=c;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,u-=g);const m=[],_=e+(t-e)/2;let C=-1;for(let y=n;y<=r;y++){if(C===-1){const k=c,L=c+i;(k<=_&&_<L||k>_)&&(C=y)}for(c+=i,m[y-n]=u,u+=i;h===y;)u+=d,c+=d,a++,a>=l?h=r+1:(h=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);if(c>=t){r=y;break}}C===-1&&(C=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let v=n,w=r;return v<w&&o<e&&v++,v<w&&b+i>t&&w--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:C,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:w}}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}}Kg.INSTANCE_COUNT=0;const l$=125;class Ef{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 d$ extends H{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new M),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new Ef(0,0,0,0),this._scrollable=this._register(new Tv(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 fk(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 h$ extends H{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(129),r=n.get(74);this._linesLayout=new Kg(t,n.get(58),r.top,r.bottom),this._scrollable=this._register(new d$(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new Ef(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(102)?l$:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(58)&&this._linesLayout.setLineHeight(t.get(58)),e.hasChanged(74)){const i=t.get(74);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(129)){const i=t.get(129),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new Ef(n,r.contentWidth,o,this._getContentHeight(n,o,a)))}else this._updateHeight();e.hasChanged(102)&&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(91);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(93)?o+=Math.max(0,t-n.get(58)-n.get(74).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 Ef(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new ME(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new ME(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(130),n=t.get(43);if(i.isViewportWrapping){const o=t.get(129),r=t.get(64);return e>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?e+o.verticalScrollbarWidth:e}else{const o=t.get(92)*n.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+o,r)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new Ef(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 c${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,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class u${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=xg(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 OM(t,e-i)}}class f${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 c$(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new Hf(wo.fromDecorations(n));for(let m=0;m<o;m++){const _=a.takeWhile(C=>C.lineNumber===m+1);r.addRequest(i[m],_,t?t[m]:null)}const l=r.finalize();let d=[],h=this.hiddenAreasIds.map(m=>this.model.getDecorationRange(m)).sort(S.compareRangesUsingStarts),c=1,u=0,f=-1,g=f+1<h.length?u+1:o+2;for(let m=0;m<o;m++){let _=m+1;_===g&&(f++,c=h[f].startLineNumber,u=h[f].endLineNumber,g=f+1<h.length?u+1:o+2);let C=_>=c&&_<=u,b=P0(l[m],!C);d[m]=b.getViewLineCount(),this.lines[m]=b}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new u$(d)}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(S.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 S(n,1,o,1)),n=l.startLineNumber,o=l.endLineNumber):l.endLineNumber>o&&(o=l.endLineNumber)}return i.push(new S(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(c=>this.model.getDecorationRange(c)).sort(S.compareRangesUsingStarts);if(t.length===i.length){let c=!1;for(let u=0;u<t.length;u++)if(!t[u].equalsRange(i[u])){c=!0;break}if(!c)return!1}let n=[];for(const c of t)n.push({range:c,options:Ee.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,h=!1;for(let c=0;c<this.lines.length;c++){let u=c+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[c].isVisible()&&(this.lines[c]=this.lines[c].setVisible(!1),f=!0):(h=!0,this.lines[c].isVisible()||(this.lines[c]=this.lines[c].setVisible(!0),f=!0)),f){let g=this.lines[c].getViewLineCount();this.prefixSumComputer.changeValue(c,g)}}return h||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 h=null;if(d){h=[];for(let c=0,u=this.lines.length;c<u;c++)h[c]=this.lines[c].getLineBreakData()}return this._constructLines(!1,h),!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 Oy(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 h=0,c=n.length;h<c;h++){let u=P0(n[h],!o);l.push(u);let f=u.getViewLineCount();a+=f,d[h]=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 Py(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=P0(i,r);this.lines[n]=a;let l=this.lines[n].getViewLineCount(),d=!1,h=0,c=-1,u=0,f=-1,g=0,m=-1;o>l?(h=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=h+l-1,g=c+1,m=g+(o-l)-1,d=!0):o<l?(h=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=h+o-1,u=c+1,f=u+(l-o)-1,d=!0):(h=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=h+l-1),this.prefixSumComputer.changeValue(n,l);const _=h<=c?new mP(h,c):null,C=u<=f?new Py(u,f):null,b=g<=m?new Oy(g,m):null;return[d,_,C,b]}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}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,n=t.remainder;return new UN(i+1,n)}getMinColumnOfViewLine(e){return this.lines[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new F(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new F(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=n.modelLineNumber;l++){const d=this.lines[l-1];if(d.isVisible()){let h=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,c=l===n.modelLineNumber?n.modelLineWrappedLineIdx+1:d.getViewLineCount();for(let u=h;u<c;u++)a.push(new UN(l,u))}if(!d.isVisible()&&r){const h=new F(l-1,this.model.getLineMaxColumn(l-1)+1),c=S.fromPositions(r,h);o.push(new $N(c,a)),a=[],r=null}else d.isVisible()&&!r&&(r=new F(l,1))}if(r){const l=S.fromPositions(r,this.getModelEndPositionOfViewLine(n));o.push(new $N(l,a))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,r=[];for(const a of this.getViewLineInfosGroupedByModelRanges(e,t)){const l=a.modelRange.startLineNumber,d=this.model.getLinesBracketGuides(l,a.modelRange.endLineNumber,o,n);for(const h of a.viewLines)if(h.isWrappedLineContinuation&&this.getMinColumnOfViewLine(h)===1)r.push([]);else{let c=d[h.modelLineNumber-l];c=c.map(u=>u.horizontalLine?new mc(u.visibleColumn,u.className,new X1(u.horizontalLine.top,this.convertModelPositionToViewPosition(h.modelLineNumber,u.horizontalLine.endColumn).column)):u),r.push(c)}}return r}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 h=null;for(let g=l;g<=d;g++){const m=this.lines[g];if(m.isVisible()){let _=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),C=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=C-_+1,v=0;b>1&&m.getViewLineMinColumn(this.model,g+1,C)===1&&(v=_===0?1:2),r.push(b),a.push(v),h===null&&(h=new F(g+1,0))}else h!==null&&(o=o.concat(this.model.getLinesIndentGuides(h.lineNumber,g)),h=null)}h!==null&&(o=o.concat(this.model.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const c=t-e+1;let u=new Array(c),f=0;for(let g=0,m=o.length;g<m;g++){let _=o[g],C=Math.min(c-f,r[g]),b=a[g],v;b===2?v=0:b===1?v=1:v=C;for(let w=0;w<C;w++)w===v&&(_=0),u[f++]=_}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,h=this.model.getLineCount();d<h;d++){let c=this.lines[d];if(!c.isVisible())continue;let u=d===r?a:0,f=c.getViewLineCount()-u,g=!1;o+f>t&&(g=!0,f=t-o+1);let m=u+f;if(c.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 h=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new F(o+1,h)).equals(i)?new F(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 S(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 F(n+1,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new S(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const n=this.model.validatePosition(new F(e,t)),o=n.lineNumber,r=n.column;let a=o-1,l=!1;for(;a>0&&!this.lines[a].isVisible();)a--,l=!0;if(a===0&&!this.lines[a].isVisible())return new F(1,1);const d=1+(a===0?0:this.prefixSumComputer.getAccumulatedValue(a-1));let h;return l?h=this.lines[a].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(a+1),i):h=this.lines[o-1].getViewPositionOfModelPosition(d,r,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return S.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new S(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(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))}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 S(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 F(f+1,f===a?n.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(f);r=r.concat(this.model.getDecorationsInRange(new S(d.lineNumber,d.column,f,m),t,i)),d=null}d!==null&&(r=r.concat(this.model.getDecorationsInRange(new S(d.lineNumber,d.column,o.lineNumber,o.column),t,i)),d=null),r.sort((f,g)=>{const m=S.compareRangesUsingStarts(f.range,g.range);return m===0?f.id<g.id?-1:f.id>g.id?1:0:m});let h=[],c=0,u=null;for(const f of r){const g=f.id;u!==g&&(u=g,h[c++]=f)}return h}getInjectedTextAt(e){const t=this._toValidViewLineNumber(e.lineNumber),i=this.prefixSumComputer.getIndexOf(t-1),n=i.index,o=i.remainder;return this.lines[n].getInjectedTextAt(o,e.column)}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 UN{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class $N{constructor(e,t){this.modelRange=e,this.viewLines=t}}class dC{constructor(){}isVisible(){return!0}setVisible(e){return e?this:hC.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 wx(o,!1,1,o.length+1,0,n.inflate(),null)}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 F(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i,n,o){return n}getInjectedTextAt(e,t){return null}}dC.INSTANCE=new dC;class hC{constructor(){}isVisible(){return!1}setVisible(e){return e?dC.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")}getInjectedTextAt(e,t){throw new Error("Not supported")}}hC.INSTANCE=new hC;class g${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");const n=i>0?this._lineBreakData.breakOffsets[i-1]:0,o=i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1];let r;if(this._lineBreakData.injectionOffsets!==null){const a=this._lineBreakData.injectionOffsets.map((l,d)=>new wo(0,0,l+1,this._lineBreakData.injectionOptions[d],0));r=wo.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=jN(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.injectionOptions;let l,d,h;if(r){const m=e.getLineTokens(t).withInserted(r.map((v,w)=>({offset:v,text:a[w].content,tokenMetadata:yi.defaultTokenMetadata}))),_=i>0?n.breakOffsets[i-1]:0,C=n.breakOffsets[i];l=m.getLineContent().substring(_,C),d=m.sliceAndInflate(_,C,o),h=new Array;let b=0;for(let v=0;v<r.length;v++){const w=a[v].content.length,y=r[v]+b,k=r[v]+b+w;if(y>C)break;if(_<k){const L=a[v];if(L.inlineClassName){const D=i>0?n.wrappedTextIndentLength:0,N=D+Math.max(y-_,0),B=D+Math.min(k-_,C);N!==B&&h.push(new LH(N,B,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}b+=w}}else{const m=this.getInputStartOffsetOfOutputLineIndex(i),_=this.getInputEndOffsetOfOutputLineIndex(e,t,i),C=e.getLineTokens(t);l=e.getValueInRange({startLineNumber:t,startColumn:m+1,endLineNumber:t,endColumn:_+1}),d=C.sliceAndInflate(m,_,o),h=null}i>0&&(l=jN(n.wrappedTextIndentLength)+l);const c=i>0?n.wrappedTextIndentLength+1:1,u=l.length+1,f=i+1<this.getViewLineCount(),g=i===0?0:n.breakOffsetsVisibleColumn[i-1];return new wx(l,f,c,u,g,d,h)}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,i=2){if(!this._isVisible)throw new Error("Not supported");let n=this._lineBreakData.getOutputPositionOfInputOffset(t-1,i),o=n.outputLineIndex,r=n.outputOffset+1;return o>0&&(r+=this._lineBreakData.wrappedTextIndentLength),new F(e+o,r)}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(this._lineBreakData.injectionOffsets!==null){const r=n.lineNumber-i,a=this._lineBreakData.outputPositionToOffsetInUnwrappedLine(i,n.column-1),l=this._lineBreakData.normalizeOffsetAroundInjections(a,o);if(l!==a)return this._lineBreakData.getOutputPositionOfOffsetInUnwrappedLine(l,o).toPosition(r,this._lineBreakData.wrappedTextIndentLength)}if(o===0){if(i>0&&n.column===this._getViewLineMinColumn(i))return new F(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 F(n.lineNumber+1,this._getViewLineMinColumn(i+1))}return n}getInjectedTextAt(e,t){return this._lineBreakData.getInjectedText(e,t-1)}}let O0=[""];function jN(s){if(s>=O0.length)for(let e=1;e<=s;e++)O0[e]=p$(e);return O0[s]}function p$(s){return new Array(s+1).join(" ")}function P0(s,e){return s===null?e?dC.INSTANCE:hC.INSTANCE:new g$(s,e)}class m${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}getViewLineNumberOfModelPosition(e,t){return e}}class _${constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new m$(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 Oy(t,i)}onModelLinesInserted(e,t,i,n){return new Py(t,i)}onModelLineChanged(e,t,i){return[!1,new mP(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}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 wx(i,!1,1,i.length+1,0,t.inflate(),null)}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}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)}getInjectedTextAt(e){return null}}class b${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 F(n.startLineNumber,1),0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new F(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);r=new S(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new UM(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,WD(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 h=t[l],c=h.options,u=this._getOrCreateViewModelDecoration(h),f=u.range;if(o[r++]=u,c.inlineClassName){let g=new Uf(f,c.inlineClassName,c.inlineClassNameAffectsLetterSpacing?3:0),m=Math.max(i,f.startLineNumber),_=Math.min(n,f.endLineNumber);for(let C=m;C<=_;C++)a[C-i].push(g)}if(c.beforeContentClassName&&i<=f.startLineNumber&&f.startLineNumber<=n){let g=new Uf(new S(f.startLineNumber,f.startColumn,f.startLineNumber,f.startColumn),c.beforeContentClassName,1);a[f.startLineNumber-i].push(g)}if(c.afterContentClassName&&i<=f.endLineNumber&&f.endLineNumber<=n){let g=new Uf(new S(f.endLineNumber,f.endColumn,f.endLineNumber,f.endColumn),c.afterContentClassName,2);a[f.endLineNumber-i].push(g)}}return{decorations:o,inlineDecorations:a}}}const C$={ModesRegistry:"editor.modesRegistry"};class v${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 Td=new v$;Xt.add(C$.ModesRegistry,Td);const Bu="plaintext",w$=".txt";Td.registerLanguage({id:Bu,extensions:[w$],aliases:[p("plainText.alias","Plain Text"),"text"],mimetypes:[Os.text]});Qe.register(Bu,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0);class S$ extends H{constructor(e,t,i,n,o,r){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new e$,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Rs(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new Lt(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new Lt(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new _$(this.model);else{const a=this._configuration.options,l=a.get(43),d=a.get(123),h=a.get(130),c=a.get(122);this._lines=new f$(this._editorId,this.model,n,o,l,this.model.getOptions().tabSize,d,h.wrappingColumn,c)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new lu(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new h$(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(a=>{a.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new ZU(a)),this._eventDispatcher.emitOutgoingEvent(new pk(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 b$(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($p.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new QU)})),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=new S(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const n of i)this.model.tokenizeViewport(n.startLineNumber,n.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new qU(e)),this._eventDispatcher.emitOutgoingEvent(new gk(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new UU)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new $U)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new YU)}_onConfigurationChanged(e,t){let i=null;if(this._viewportStartLine!==-1){let h=new F(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(h)}let n=!1;const o=this._configuration.options,r=o.get(43),a=o.get(123),l=o.get(130),d=o.get(122);if(this._lines.setWrappingSettings(r,a,l.wrappingColumn,d)&&(e.emitViewEvent(new Fm),e.emitViewEvent(new Bm),e.emitViewEvent(new Qh(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.getCurrentScrollTop()!==0&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(80)&&(this._decorations.reset(),e.emitViewEvent(new Qh(null))),e.emitViewEvent(new jU(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const h=this.coordinatesConverter.convertModelPositionToViewPosition(i),c=this.viewLayout.getVerticalOffsetForLineNumber(h.lineNumber);this.viewLayout.setScrollPosition({scrollTop:c+this._viewportStartLineDelta},1)}Rs.shouldRecreate(t)&&(this.cursorConfig=new Rs(this.model.getLanguageId(),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 Ld?e.versionId:null,a=this._lines.createLineBreaksComputer();for(const h of o)switch(h.changeType){case 4:{for(let c=0;c<h.detail.length;c++){const u=h.detail[c];let f=h.injectedTexts[c];f&&(f=f.filter(g=>!g.ownerId||g.ownerId===this._editorId)),a.addRequest(u,f,null)}break}case 2:{let c=null;h.injectedText&&(c=h.injectedText.filter(u=>!u.ownerId||u.ownerId===this._editorId)),a.addRequest(h.detail,c,null);break}}const l=a.finalize();let d=0;for(const h of o)switch(h.changeType){case 1:{this._lines.onModelFlushed(),t.emitViewEvent(new Fm),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break}case 3:{const c=this._lines.onModelLinesDeleted(r,h.fromLineNumber,h.toLineNumber);c!==null&&(t.emitViewEvent(c),this.viewLayout.onLinesDeleted(c.fromLineNumber,c.toLineNumber)),i=!0;break}case 4:{const c=l.slice(d,d+h.detail.length);d+=h.detail.length;const u=this._lines.onModelLinesInserted(r,h.fromLineNumber,h.toLineNumber,c);u!==null&&(t.emitViewEvent(u),this.viewLayout.onLinesInserted(u.fromLineNumber,u.toLineNumber)),i=!0;break}case 2:{const c=l[d];d++;const[u,f,g,m]=this._lines.onModelLineChanged(r,h.lineNumber,c);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 Bm),t.emitViewEvent(new Qh(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)}}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 F(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new F(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:r,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new XU(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule()})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new GU),this.cursorConfig=new Rs(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Rs(this.model.getLanguageId(),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 Fm),t.emitViewEvent(new Bm),t.emitViewEvent(new Qh(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Rs(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Qh(e))}))}setHiddenAreas(e){let t=!1;try{const i=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(i.emitViewEvent(new Fm),i.emitViewEvent(new Bm),i.emitViewEvent(new Qh(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new VN)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(129),t=this._configuration.options.get(58),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 S(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 h=0,c=i.length;h<c;h++){const u=i[h].startLineNumber,f=i[h].endLineNumber;f<r||u>l||(r<u&&(n[o++]=new S(r,a,u-1,this.model.getLineMaxColumn(u-1))),r=f+1,a=1)}return(r<l||r===l&&a<d)&&(n[o++]=new S(r,a,l,d)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new S(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new S(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 F(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 F(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new S(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)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}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=an(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=sr(this.getLineContent(e));return t===-1?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}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 r.inlineDecorations&&(l=[...l,...r.inlineDecorations.map(d=>d.toInlineDecoration(t))]),new Jn(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 yH(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,WD(this._configuration.options)),i=new y$;for(const n of t){const o=n.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),h=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(l,o.zIndex,d,h,a)}return i.asArray}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
  98. `:this.model.getEOL();e=e.slice(0),e.sort(S.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(h=>h.startLineNumber);let d="";for(let h=0;h<l.length;h++)h>0&&l[h-1]===l[h]||(d+=this.model.getLineContent(l[h])+n);return d}if(o&&t){let l=[],d=0;for(const h of e){const c=h.startLineNumber;h.isEmpty()?c!==d&&l.push(this.model.getLineContent(c)):l.push(this.model.getValueInRange(h,i?2:0)),d=c}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.getLanguageId();if(i===Bu||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const h=n.startLineNumber;n=new S(h,this.model.getLineMinColumn(h),h,this.model.getLineMaxColumn(h))}const o=this._configuration.options.get(43),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Hi.fontFamily;let d;return l?d=Hi.fontFamily:(d=o.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${Hi.fontFamily}`),{mode:i,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 h=this.model.getLineTokens(d),c=h.getLineContent(),u=d===i?n-1:0,f=d===o?r-1:c.length;c===""?l+="<br>":l+=s$(c,h.inflate(),t,u,f,a,Ai)}return l}_getColorMap(){let e=Rt.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=W.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 i$);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 S(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new O_(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new S(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new O_(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new O_(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 JU),this._eventDispatcher.emitOutgoingEvent(new VN))}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 y${constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],d=a[a.length-1];if(l===o&&d+1>=i){n>d&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new $M(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class qg{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 On=Je("accessibilityService"),jp=new re("accessibilityModeEnabled",!1);class L$ extends Ru{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 Fy=[],By=[];class mk{constructor(e,t){this.classifier=new L$(e,t)}static create(e){return new mk(e.get(118),e.get(117))}createLineBreaksComputer(e,t,i,n){t=t|0,i=+i;const o=[],r=[],a=[];return{addRequest:(l,d,h)=>{o.push(l),r.push(d),a.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let d=[];for(let h=0,c=o.length;h<c;h++){const u=r[h],f=a[h];f&&!f.injectionOptions&&!u?d[h]=D$(this.classifier,f,o[h],t,i,l,n):d[h]=x$(this.classifier,o[h],u,t,i,l,n)}return Fy.length=0,By.length=0,d}}}}function D$(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,h=CP(t,i,n,o,r),c=n-h;let u=Fy,f=By,g=0,m=0,_=0,C=n;const b=l.length;let v=0;if(v>=0){let w=Math.abs(d[v]-C);for(;v+1<b;){const y=Math.abs(d[v+1]-C);if(y>=w)break;w=y,v++}}for(;v<b;){let w=v<0?0:l[v],y=v<0?0:d[v];m>w&&(w=m,y=_);let k=0,L=0,D=0,N=0;if(y<=C){let O=y,$=w===0?0:t.charCodeAt(w-1),K=w===0?0:s.get($),le=!0;for(let de=w;de<a;de++){const _e=de,De=t.charCodeAt(de);let we,Se;if(Si(De)?(de++,we=0,Se=2):(we=s.get(De),Se=og(De,O,i,o)),_e>m&&Wy($,K,De,we)&&(k=_e,L=O),O+=Se,O>C){_e>m?(D=_e,N=O-Se):(D=de+1,N=O),O-L>c&&(k=0),le=!1;break}$=De,K=we}if(le){g>0&&(u[g]=l[l.length-1],f[g]=d[l.length-1],g++);break}}if(k===0){let O=y,$=t.charCodeAt(w),K=s.get($),le=!1;for(let de=w-1;de>=m;de--){const _e=de+1,De=t.charCodeAt(de);if(De===9){le=!0;break}let we,Se;if(Yc(De)?(de--,we=0,Se=2):(we=s.get(De),Se=go(De)?o:1),O<=C){if(D===0&&(D=_e,N=O),O<=C-c)break;if(Wy(De,we,$,K)){k=_e,L=O;break}}O-=Se,$=De,K=we}if(k!==0){const de=c-(N-L);if(de<=i){const _e=t.charCodeAt(D);let De;Si(_e)?De=2:De=og(_e,N,i,o),de-De<0&&(k=0)}}if(le){v--;continue}}if(k===0&&(k=D,L=N),k<=m){const O=t.charCodeAt(m);Si(O)?(k=m+2,L=_+2):(k=m+1,L=_+og(O,_,i,o))}for(m=k,u[g]=k,_=L,f[g]=L,g++,C=L+c;v<0||v<b&&d[v]<L;)v++;let B=Math.abs(d[v]-C);for(;v+1<b;){const O=Math.abs(d[v+1]-C);if(O>=B)break;B=O,v++}}return g===0?null:(u.length=g,f.length=g,Fy=e.breakOffsets,By=e.breakOffsetsVisibleColumn,e.breakOffsets=u,e.breakOffsetsVisibleColumn=f,e.wrappedTextIndentLength=h,e)}function x$(s,e,t,i,n,o,r){const a=wo.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(L=>L.options),d=t.map(L=>L.column-1)):(l=null,d=null),n===-1)return l?new zf([a.length],[],0,d,l):null;const h=a.length;if(h<=1)return l?new zf([a.length],[],0,d,l):null;const c=CP(a,i,n,o,r),u=n-c;let f=[],g=[],m=0,_=0,C=0,b=n,v=a.charCodeAt(0),w=s.get(v),y=og(v,0,i,o),k=1;Si(v)&&(y+=1,v=a.charCodeAt(1),w=s.get(v),k++);for(let L=k;L<h;L++){const D=L,N=a.charCodeAt(L);let B,O;Si(N)?(L++,B=0,O=2):(B=s.get(N),O=og(N,y,i,o)),Wy(v,w,N,B)&&(_=D,C=y),y+=O,y>b&&((_===0||y-C>u)&&(_=D,C=y-O),f[m]=_,g[m]=C,m++,b=C+u,_=0),v=N,w=B}return m===0&&(!t||t.length===0)?null:(f[m]=h,g[m]=y,new zf(f,g,c,d,l))}function og(s,e,t,i){return s===9?t-e%t:go(s)||s<32?i:1}function KN(s,e){return e-s%e}function Wy(s,e,t,i){return t!==32&&(e===2||e===3&&i!==2||i===1||i===3&&e!==1)}function CP(s,e,t,i,n){let o=0;if(n!==0){const r=an(s);if(r!==-1){for(let l=0;l<r;l++){const d=s.charCodeAt(l)===9?KN(o,e):1;o+=d}const a=n===3?2:n===2?1:0;for(let l=0;l<a;l++){const d=KN(o,e);o+=d}o+i>t&&(o=0)}}return o}var F0;const B0=(F0=window.trustedTypes)===null||F0===void 0?void 0:F0.createPolicy("domLineBreaksComputer",{createHTML:s=>s});class _k{static create(){return new _k}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:()=>k$(o,e,t,i,n,r)}}}function k$(s,e,t,i,n,o){var r;function a(D){const N=o[D];if(N){const B=wo.applyInjectedText(s[D],N),O=N.map(K=>K.options),$=N.map(K=>K.column-1);return new zf([B.length],[],0,$,O)}else return null}if(i===-1){const D=[];for(let N=0,B=s.length;N<B;N++)D[N]=a(N);return D}const l=Math.round(i*e.typicalHalfwidthCharacterWidth),h=Math.round(t*(n===3?2:n===2?1:0)),c=Math.ceil(e.spaceWidth*h),u=document.createElement("div");Ui.applyFontInfoSlow(u,e);const f=Vd(1e4),g=[],m=[],_=[],C=[],b=[];for(let D=0;D<s.length;D++){const N=wo.applyInjectedText(s[D],o[D]);let B=0,O=0,$=l;if(n!==0)if(B=an(N),B===-1)B=0;else{for(let _e=0;_e<B;_e++){const De=N.charCodeAt(_e)===9?t-O%t:1;O+=De}const de=Math.ceil(e.spaceWidth*O);de+e.typicalFullwidthCharacterWidth>l?(B=0,O=0):$=l-de}const K=N.substr(B),le=I$(K,O,t,$,f,c);g[D]=B,m[D]=O,_[D]=K,C[D]=le[0],b[D]=le[1]}const v=f.build(),w=(r=B0==null?void 0:B0.createHTML(v))!==null&&r!==void 0?r:v;u.innerHTML=w,u.style.position="absolute",u.style.top="10000",u.style.wordWrap="break-word",document.body.appendChild(u);let y=document.createRange();const k=Array.prototype.slice.call(u.children,0);let L=[];for(let D=0;D<s.length;D++){const N=k[D],B=E$(y,N,_[D],C[D]);if(B===null){L[D]=a(D);continue}const O=g[D],$=m[D]+h,K=b[D],le=[];for(let we=0,Se=B.length;we<Se;we++)le[we]=K[B[we]];if(O!==0)for(let we=0,Se=B.length;we<Se;we++)B[we]+=O;let de,_e;const De=o[D];De?(de=De.map(we=>we.options),_e=De.map(we=>we.column-1)):(de=null,_e=null),L[D]=new zf(B,le,$,_e,de)}return document.body.removeChild(u),L}function I$(s,e,t,i,n,o){if(o!==0){let u=String(o);n.appendASCIIString('<div style="text-indent: -'),n.appendASCIIString(u),n.appendASCIIString("px; padding-left: "),n.appendASCIIString(u),n.appendASCIIString("px; box-sizing: border-box; width:")}else n.appendASCIIString('<div style="width:');n.appendASCIIString(String(i)),n.appendASCIIString('px;">');const r=s.length;let a=e,l=0,d=[],h=[],c=0<r?s.charCodeAt(0):0;n.appendASCIIString("<span>");for(let u=0;u<r;u++){u!==0&&u%16384===0&&n.appendASCIIString("</span><span>"),d[u]=l,h[u]=a;const f=c;c=u+1<r?s.charCodeAt(u+1):0;let g=1,m=1;switch(f){case 9:g=t-a%t,m=g;for(let _=1;_<=g;_++)_<g?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:go(f)&&m++,f<32?n.write1(9216+f):n.write1(f)}l+=g,a+=m}return n.appendASCIIString("</span>"),d[s.length]=l,h[s.length]=a,n.appendASCIIString("</div>"),[d,h]}function E$(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{Vy(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 Vy(s,e,t,i,n,o,r,a){if(i===o||(n=n||W0(s,e,t[i],t[i+1]),r=r||W0(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=W0(s,e,t[l],t[l+1]);Vy(s,e,t,i,n,l,d,a),Vy(s,e,t,l,d,o,r,a)}function W0(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 N$=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},zl=function(s,e){return function(t,i){e(t,i,s)}};let T$=0,A$=class{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){qe(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Gg=class P_ extends H{constructor(e,t,i,n,o,r,a,l,d,h){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 qN),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new qN),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,this._onDidChangeHiddenAreas=this._register(new M),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event;const c=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=c.overflowWidgetsDomNode,delete c.overflowWidgetsDomNode,this._id=++T$,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(c,h)),this._register(this._configuration.onDidChange(f=>{this._onDidChangeConfiguration.fire(f);const g=this._configuration.options;if(f.hasChanged(129)){const m=g.get(129);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 R$(this,this._contextKeyService)),this._register(new M$(this,this._contextKeyService)),this._instantiationService=n.createChild(new qg([ve,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new O$(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={};let u;Array.isArray(i.contributions)?u=i.contributions:u=Bc.getEditorContributions();for(const f of u){if(this._contributions[f.id]){Le(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){Le(g)}}Bc.getEditorActions().forEach(f=>{if(this._actions[f.id]){Le(new Error(`Cannot have two actions with the same id ${f.id}`));return}const g=new _P(f.id,f.label,f.alias,Kn(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 Ui(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Mp.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?je.getWordAtPosition(this._modelData.model,this._configuration.options.get(115),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===`
  99. `?i=1:e&&e.lineEnding&&e.lineEnding===`\r
  100. `&&(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?P_._getVerticalOffsetForPosition(this._modelData,e,1):-1}getTopForPosition(e,t){return this._modelData?P_._getVerticalOffsetForPosition(this._modelData,e,t):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map(t=>S.lift(t)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return ct.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(!F.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(!S.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 S(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(!F.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new S(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=ne.isISelection(e),i=S.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 ne(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 S(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(!S.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(S.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(!ne.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],h=this._contributions[d];typeof h.restoreViewState=="function"&&h.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,Le);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 S(r.lineNumber,r.column,a.lineNumber,a.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Bc.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,Le)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(80))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,WD(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(129)}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(129),o=P_._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(58)}}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){Ui.applyFontInfoSlow(e,this._configuration.options.get(43))}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new S$(this._id,this._configuration,e,_k.create(),mk.create(this._configuration.options),r=>hr(r));t.push(e.onDidChangeDecorations(r=>this._onDidChangeModelDecorations.fire(r))),t.push(e.onDidChangeLanguage(r=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),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._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{r.reachedMaxCursorCount&&this._notificationService.warn(p("cursors.maximum","The number of cursors has been limited to {0}.",lu.MAX_CURSOR_COUNT));const a=[];for(let h=0,c=r.selections.length;h<c;h++)a[h]=r.selections[h].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 A$(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 Nv(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 HU(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}};Gg=N$([zl(3,Ge),zl(4,tt),zl(5,Yt),zl(6,ve),zl(7,Dt),zl(8,ni),zl(9,On)],Gg);class qN extends H{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 R$ extends H{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=E.editorSimpleInput.bindTo(t),this._editorFocus=E.focus.bindTo(t),this._textInputFocus=E.textInputFocus.bindTo(t),this._editorTextFocus=E.editorTextFocus.bindTo(t),this._editorTabMovesFocus=E.tabMovesFocus.bindTo(t),this._editorReadonly=E.readOnly.bindTo(t),this._inDiffEditor=E.inDiffEditor.bindTo(t),this._editorColumnSelection=E.columnSelection.bindTo(t),this._hasMultipleSelections=E.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=E.hasNonEmptySelection.bindTo(t),this._canUndo=E.canUndo.bindTo(t),this._canRedo=E.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(128)),this._editorReadonly.set(e.get(80)),this._inDiffEditor.set(e.get(53)),this._editorColumnSelection.set(e.get(18))}_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 M$ extends H{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=E.languageId.bindTo(t),this._hasCompletionItemProvider=E.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=E.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=E.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=E.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=E.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=E.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=E.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=E.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=E.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=E.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=E.hasReferenceProvider.bindTo(t),this._hasRenameProvider=E.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=E.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=E.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=E.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=E.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=E.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=E.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=E.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(ro.onDidChange(i)),this._register(ar.onDidChange(i)),this._register(Zr.onDidChange(i)),this._register(Sg.onDidChange(i)),this._register(yb.onDidChange(i)),this._register(Lb.onDidChange(i)),this._register(Db.onDidChange(i)),this._register(wg.onDidChange(i)),this._register(Xc.onDidChange(i)),this._register(Vs.onDidChange(i)),this._register(vb.onDidChange(i)),this._register(wb.onDidChange(i)),this._register(Wf.onDidChange(i)),this._register(ao.onDidChange(i)),this._register(yd.onDidChange(i)),this._register(za.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.getLanguageId()),this._hasCompletionItemProvider.set(ro.has(e)),this._hasCodeActionsProvider.set(ar.has(e)),this._hasCodeLensProvider.set(Zr.has(e)),this._hasDefinitionProvider.set(Sg.has(e)),this._hasDeclarationProvider.set(yb.has(e)),this._hasImplementationProvider.set(Lb.has(e)),this._hasTypeDefinitionProvider.set(Db.has(e)),this._hasHoverProvider.set(wg.has(e)),this._hasDocumentHighlightProvider.set(Xc.has(e)),this._hasDocumentSymbolProvider.set(Vs.has(e)),this._hasReferenceProvider.set(vb.has(e)),this._hasRenameProvider.set(wb.has(e)),this._hasSignatureHelpProvider.set(yd.has(e)),this._hasInlayHintsProvider.set(za.has(e)),this._hasDocumentFormattingProvider.set(Wf.has(e)||ao.has(e)),this._hasDocumentSelectionFormattingProvider.set(ao.has(e)),this._hasMultipleDocumentFormattingProvider.set(Wf.all(e).length+ao.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(ao.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Te.walkThroughSnippet)})}}class O$ extends H{constructor(e){super(),this._onChange=this._register(new M),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Gc(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 P$=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='"),F$=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 V0(s){return P$+encodeURIComponent(s.toString())+F$}const B$=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),W$=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 V$(s){return B$+encodeURIComponent(s.toString())+W$}st((s,e)=>{const t=s.getColor(WO);t&&e.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${t}; }`);const i=s.getColor(ig);i&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${V0(i)}") repeat-x bottom left; }`);const n=s.getColor(a9);n&&e.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${n}; }`);const o=s.getColor(Lv);o&&e.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${o}; }`);const r=s.getColor(sa);r&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${V0(r)}") repeat-x bottom left; }`);const a=s.getColor(l9);a&&e.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=s.getColor(Xx);l&&e.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const d=s.getColor(mo);d&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${V0(d)}") repeat-x bottom left; }`);const h=s.getColor(d9);h&&e.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${h}; }`);const c=s.getColor(c9);c&&e.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${c}; }`);const u=s.getColor(h9);u&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${V$(u)}") no-repeat bottom left; }`);const f=s.getColor(V6);f&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${f.rgba.a}; }`);const g=s.getColor(W6);g&&e.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${g}; }`);const m=s.getColor(el)||"inherit";e.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${m}}`)});class mt{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 GN(s){return s.preventDefault(),s.stopPropagation(),s}var Wu=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 H$=!1;var cC;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(cC||(cC={}));let z$=4;const U$=new M;let $$=300;const j$=new M;class bk{constructor(){this.disposables=new X}get onPointerMove(){return this.disposables.add(new mt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new mt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}Wu([si],bk.prototype,"onPointerMove",null);Wu([si],bk.prototype,"onPointerUp",null);class Ck{constructor(e){this.el=e,this.disposables=new X}get onPointerMove(){return this.disposables.add(new mt(this.el,vt.Change)).event}get onPointerUp(){return this.disposables.add(new mt(this.el,vt.End)).event}dispose(){this.disposables.dispose()}}Wu([si],Ck.prototype,"onPointerMove",null);Wu([si],Ck.prototype,"onPointerUp",null);class uC{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}Wu([si],uC.prototype,"onPointerMove",null);Wu([si],uC.prototype,"onPointerUp",null);class Wi extends H{constructor(e,t,i){super(),this.hoverDelay=$$,this.hoverDelayer=this._register(new ca(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=U(e,Y(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Me&&this.el.classList.add("mac");const n=this._register(new mt(this.el,"mousedown")).event;this._register(n(c=>this.onPointerStart(c,new bk),this));const o=this._register(new mt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new mt(this.el,"mouseenter")).event;this._register(r(()=>Wi.onMouseEnter(this)));const a=this._register(new mt(this.el,"mouseleave")).event;this._register(a(()=>Wi.onMouseLeave(this))),this._register(lt.addTarget(this.el));const l=he.map(this._register(new mt(this.el,vt.Start)).event,c=>{var u;return Object.assign(Object.assign({},c),{target:(u=c.initialTarget)!==null&&u!==void 0?u:null})});this._register(l(c=>this.onPointerStart(c,new Ck(this.el)),this));const d=this._register(new mt(this.el,vt.Tap)).event,h=he.map(he.filter(he.debounce(d,(c,u)=>{var f;return{event:u,count:((f=c==null?void 0:c.count)!==null&&f!==void 0?f:0)+1}},250),({count:c})=>c===2),({event:c})=>{var u;return Object.assign(Object.assign({},c),{target:(u=c.initialTarget)!==null&&u!==void 0?u:null})});this._register(h(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=z$,this._register(U$.event(c=>{this.size=c,this.layout()}))),this._register(j$.event(c=>this.hoverDelay=c)),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",H$),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=U(this.el,Y(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ve(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new mt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Wi.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new mt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Wi.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=U(this.el,Y(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ve(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new mt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Wi.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new mt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Wi.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){rt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new uC(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new uC(t))),!this.state)return;const n=w3("iframe");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=Yn(this.el),h=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Me?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Me?"col-resize":"ew-resize",d.textContent=`* { cursor: ${g} !important; }`},c=new X;h(),i||this.onDidEnablementChange(h,null,c);const u=g=>{rt.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{rt.stop(g,!1),this.el.removeChild(d),this.el.classList.remove("active"),this._onDidEnd.fire(),c.dispose();for(const m of n)m.style.pointerEvents="auto"};t.onPointerMove(u,null,c),t.onPointerUp(f,null,c),c.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&&Wi.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Wi.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Wi.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()}}const vk=Je("IEditorCancelService"),vP=new re("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Il(vk,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=vP.bindTo(n.get(ve)),r=new jn;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 K$ extends ln{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(vk).add(e,this))}dispose(){this._unregister(),super.dispose()}}J(new class extends Mi{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:vP})}runEditorCommand(s,e){s.get(vk).cancel(e)}});let wP=class Hy{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Vi("{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 Hy))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 Hy(e,this.flags))}};class Zg extends K${constructor(e,t,i,n){super(e,n),this._listener=new X,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!S.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!S.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 wk extends ln{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class gl{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 gl(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 SP={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Os.text,TERMINALS:"Terminals"};class q${constructor(e){this.data=e}update(){}getData(){return this.data}}const Wr={CurrentDragAndDropData:void 0};class Ad extends H{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Us&&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 iu)),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(lt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,rn&&this._register(q(e,ue.DRAG_START,n=>{var o;return(o=n.dataTransfer)===null||o===void 0?void 0:o.setData(SP.TEXT,this._action.label)}))),this._register(q(t,vt.Tap,n=>this.onClick(n,!0))),this._register(q(t,ue.MOUSE_DOWN,n=>{i||rt.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Me&&this._register(q(t,ue.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(q(t,ue.CLICK,n=>{rt.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(q(t,ue.DBLCLICK,n=>{rt.stop(n,!0)})),[ue.MOUSE_UP,ue.MOUSE_OUT].forEach(n=>{this._register(q(t,n,o=>{rt.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;rt.stop(e,!0);const n=Un(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 Yg extends Ad{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=U(this.element,Y("a.action-label"))),this.label&&(this._action.id===$s.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&&(U(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({key:"titleLabel",comment:["action title","action keybinding"]},"{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 G$=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class pa extends H{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 iu,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(c=>this._onDidRun.fire(c))),this._register(this._actionRunner.onBeforeRun(c=>this._onBeforeRun.fire(c))),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,h;switch(this._orientation){case 0:d=[15],h=[17];break;case 1:d=[16],h=[18],this.domNode.className+=" vertical";break}this._register(q(this.domNode,ue.KEY_DOWN,c=>{const u=new Ot(c);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():h&&(u.equals(h[0])||u.equals(h[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 Ad&&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(q(this.domNode,ue.KEY_UP,c=>{const u=new Ot(c);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(Gc(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Ac()===this.domNode||!nr(Ac(),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(nr(Ac(),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=Wd(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(q(r,ue.CONTEXT_MENU,l=>{rt.stop(l,!0)}));let a;this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o)),a||(a=new Yg(this.context,o,t)),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Ad&&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(){qe(this.viewItems),this.viewItems=[],this._actionIds=[],Li(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;Bf(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&Bf(n.isEnabled)&&!n.isEnabled()&&(r=!1),r?o.focus(e):this.actionsList.focus({preventScroll:t})}else Bf(o.blur)&&o.blur()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Ad){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return G$(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){qe(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}const Z$={IconContribution:"base.contributions.icons"};class Y${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:`^${En.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(;kt.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}|${kt.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!kt.isThemeIcon(r.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(`
  101. `)}}const Yd=new Y$;Xt.add(Z$.IconContribution,Yd);function Oi(s,e,t,i){return Yd.registerIcon(s,e,t,i)}function X$(){return Yd}function Q$(){for(const s of bb.all)Yd.registerIcon(s.id,s.definition,s.description);bb.onDidRegister(s=>Yd.registerIcon(s.id,s.definition,s.description))}Q$();const yP="vscode://schemas/icons";let LP=Xt.as(sv.JSONContribution);LP.registerSchema(yP,Yd.getIconSchema());const ZN=new Lt(()=>LP.notifySchemaChanged(yP),200);Yd.onDidChange(()=>{ZN.isScheduled()||ZN.schedule()});const J$=Oi("widget-close",ie.close,p("widgetClose","Icon for the close action in widgets."));var ej=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},tj=function(s,e){return function(t,i){e(t,i,s)}},ij=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},H0;const Wm=3;class uf{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 z0{constructor(e){this.entries=e}}const nj=Oi("diff-review-insert",ie.add,p("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),sj=Oi("diff-review-remove",ie.remove,p("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),oj=Oi("diff-review-close",ie.close,p("diffReviewCloseIcon","Icon for 'Close' in diff review."));let fC=class Xl extends H{constructor(e,t){super(),this._modeService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Ke(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Ke(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new pa(this.actionBarContainer.domNode)),this._actionBar.push(new Us("diffreview.close",p("label.close","Close"),"close-diff-review "+kt.asClassName(oj),!0,()=>ij(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=Ke(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Ke(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new Up(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(ii(this.domNode.domNode,"click",i=>{i.preventDefault();let n=GR(i.target,"diff-review-row");n&&this._goToRow(n)})),this._register(ii(this.domNode.domNode,"keydown",i=>{(i.equals(18)||i.equals(2066)||i.equals(530))&&(i.preventDefault(),this._goToRow(this._getNextRow())),(i.equals(16)||i.equals(2064)||i.equals(528))&&(i.preventDefault(),this._goToRow(this._getPrevRow())),(i.equals(9)||i.equals(2057)||i.equals(521)||i.equals(1033))&&(i.preventDefault(),this.hide()),(i.equals(10)||i.equals(3))&&(i.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 F(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 F(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 F(e,1)),this._diffEditor.revealPosition(new F(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?[]:Xl._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,h=e.length;d<h;d++){const c=e[d],u=c.originalStartLineNumber,f=c.originalEndLineNumber,g=c.modifiedStartLineNumber,m=c.modifiedEndLineNumber;let _=[],C=0;{const b=f===0?u:u-1,v=m===0?g:g-1;let w=1,y=1;if(d>0){const D=e[d-1];D.originalEndLineNumber===0?w=D.originalStartLineNumber+1:w=D.originalEndLineNumber+1,D.modifiedEndLineNumber===0?y=D.modifiedStartLineNumber+1:y=D.modifiedEndLineNumber+1}let k=b-Wm+1,L=v-Wm+1;if(k<w){const D=w-k;k=k+D,L=L+D}if(L<y){const D=y-L;k=k+D,L=L+D}_[C++]=new uf(k,b,L,v)}f!==0&&(_[C++]=new uf(u,f,0,0)),m!==0&&(_[C++]=new uf(0,0,g,m));{const b=f===0?u+1:f+1,v=m===0?g+1:m+1;let w=t,y=i;if(d+1<h){const D=e[d+1];D.originalEndLineNumber===0?w=D.originalStartLineNumber:w=D.originalStartLineNumber-1,D.modifiedEndLineNumber===0?y=D.modifiedStartLineNumber:y=D.modifiedStartLineNumber-1}let k=b+Wm-1,L=v+Wm-1;if(k>w){const D=w-k;k=k+D,L=L+D}if(L>y){const D=y-L;k=k+D,L=L+D}_[C++]=new uf(b,k,v,L)}n[o++]=new z0(_)}let r=n[0].entries,a=[],l=0;for(let d=1,h=n.length;d<h;d++){const c=n[d].entries,u=r[r.length-1],f=c[0];if(u.getType()===0&&f.getType()===0&&f.originalLineStart<=u.originalLineEnd){r[r.length-1]=new uf(u.originalLineStart,f.originalLineEnd,u.modifiedLineStart,f.modifiedLineEnd),r=r.concat(c.slice(1));continue}a[l++]=new z0(r),r=c}return a[l++]=new z0(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){Li(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'),Ui.applyFontInfoSlow(d,t.get(43));let h=0,c=0,u=0,f=0;for(let L=0,D=l.length;L<D;L++){const N=l[L],B=N.originalLineStart,O=N.originalLineEnd,$=N.modifiedLineStart,K=N.modifiedLineEnd;B!==0&&(h===0||B<h)&&(h=B),O!==0&&(c===0||O>c)&&(c=O),$!==0&&(u===0||$<u)&&(u=$),K!==0&&(f===0||K>f)&&(f=K)}let g=document.createElement("div");g.className="diff-review-row";let m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const _=c-h+1,C=f-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${h},${_} +${u},${C} @@`)),g.setAttribute("data-line",String(u));const b=L=>L===0?p("no_lines_changed","no lines changed"):L===1?p("one_line_changed","1 line changed"):p("more_lines_changed","{0} lines changed",L),v=b(_),w=b(C);g.setAttribute("aria-label",p({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,h,v,u,w)),g.appendChild(m),g.setAttribute("role","listitem"),d.appendChild(g);const y=t.get(58);let k=u;for(let L=0,D=l.length;L<D;L++){const N=l[L];Xl._renderSection(d,N,k,y,this._width,e,i,o,t,n,r,this._modeService.languageIdCodec),N.modifiedLineStart!==0&&(k=N.modifiedLineEnd)}Li(this._content.domNode),this._content.domNode.appendChild(d),this.scrollbar.scanDomNode()}static _renderSection(e,t,i,n,o,r,a,l,d,h,c,u){const f=t.getType();let g="diff-review-row",m="";const _="diff-review-spacer";let C=null;switch(f){case 1:g="diff-review-row line-insert",m=" char-insert",C=nj;break;case 2:g="diff-review-row line-delete",m=" char-delete",C=sj;break}const b=t.originalLineStart,v=t.originalLineEnd,w=t.modifiedLineStart,y=t.modifiedLineEnd,k=Math.max(y-w,v-b),L=r.get(129),D=L.glyphMarginWidth+L.lineNumbersWidth,N=d.get(129),B=10+N.glyphMarginWidth+N.lineNumbersWidth;for(let O=0;O<=k;O++){const $=b===0?0:b+O,K=w===0?0:w+O,le=document.createElement("div");le.style.minWidth=o+"px",le.className=g,le.setAttribute("role","listitem"),K!==0&&(i=K),le.setAttribute("data-line",String(i));let de=document.createElement("div");de.className="diff-review-cell",de.style.height=`${n}px`,le.appendChild(de);const _e=document.createElement("span");_e.style.width=D+"px",_e.style.minWidth=D+"px",_e.className="diff-review-line-number"+m,$!==0?_e.appendChild(document.createTextNode(String($))):_e.innerText=" ",de.appendChild(_e);const De=document.createElement("span");De.style.width=B+"px",De.style.minWidth=B+"px",De.style.paddingRight="10px",De.className="diff-review-line-number"+m,K!==0?De.appendChild(document.createTextNode(String(K))):De.innerText=" ",de.appendChild(De);const we=document.createElement("span");if(we.className=_,C){const bt=document.createElement("span");bt.className=kt.asClassName(C),bt.innerText="  ",we.appendChild(bt)}else we.innerText="  ";de.appendChild(we);let Se;if(K!==0){let bt=this._renderLine(h,d,c.tabSize,K,u);Xl._ttPolicy&&(bt=Xl._ttPolicy.createHTML(bt)),de.insertAdjacentHTML("beforeend",bt),Se=h.getLineContent(K)}else{let bt=this._renderLine(a,r,l.tabSize,$,u);Xl._ttPolicy&&(bt=Xl._ttPolicy.createHTML(bt)),de.insertAdjacentHTML("beforeend",bt),Se=a.getLineContent($)}Se.length===0&&(Se=p("blankLine","blank"));let Tt="";switch(f){case 0:$===K?Tt=p({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",Se,$):Tt=p("equalLine","{0} original line {1} modified line {2}",Se,$,K);break;case 1:Tt=p("insertLine","+ {0} modified line {1}",Se,K);break;case 2:Tt=p("deleteLine","- {0} original line {1}",Se,$);break}le.setAttribute("aria-label",Tt),e.appendChild(le)}}static _renderLine(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(43),l=yi.createEmpty(r,o),d=Jn.isBasicASCII(r,e.mightContainNonBasicASCII()),h=Jn.containsRTL(r,d,e.mightContainRTL());return rv(new wh(a.isMonospace&&!t.get(29),a.canUseHalfwidthRightwardsArrow,r,!1,d,h,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(104),t.get(87),t.get(82),t.get(44)!==Hn.OFF,null)).html}};fC._ttPolicy=(H0=window.trustedTypes)===null||H0===void 0?void 0:H0.createPolicy("diffReview",{createHTML:s=>s});fC=ej([tj(1,Qi)],fC);st((s,e)=>{const t=s.getColor(ZO);t&&e.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${t}; }`);const i=s.getColor(zp);i&&e.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${i} 0 -6px 6px -6px inset; }`)});class rj extends oe{constructor(){super({id:"editor.action.diffReview.next",label:p("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:te.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=DP(e);i&&i.diffReviewNext()}}class aj extends oe{constructor(){super({id:"editor.action.diffReview.prev",label:p("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:te.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=DP(e);i&&i.diffReviewPrev()}}function DP(s){const e=s.get(tt),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}ee(rj);ee(aj);const Nl=Je("contextViewService"),Tl=Je("contextMenuService");var U0=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class lj extends H{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=ie.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const a=i.getOption(58),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=[],h=n.modifiedEndLineNumber===0;d.push(new Us("diff.clipboard.copyDeletedContent",h?n.originalEndLineNumber>n.modifiedStartLineNumber?p("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):p("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?p("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):p("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>U0(this,void 0,void 0,function*(){const m=new S(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),_=n.originalModel.getValueInRange(m);yield this._clipboardService.writeText(_)})));let c=0,u;n.originalEndLineNumber>n.modifiedStartLineNumber&&(u=new Us("diff.clipboard.copyDeletedLineContent",h?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,()=>U0(this,void 0,void 0,function*(){const m=n.originalModel.getLineContent(n.originalStartLineNumber+c);if(m===""){const _=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(_===0?`
  102. `:`\r
  103. `)}else yield this._clipboardService.writeText(m)})),d.push(u)),i.getOption(80)||d.push(new Us("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>U0(this,void 0,void 0,function*(){const m=new S(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),_=n.originalModel.getValueInRange(m);if(n.modifiedEndLineNumber===0){const C=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new S(n.modifiedStartLineNumber,C,n.modifiedStartLineNumber,C),text:l+_}])}else{const C=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new S(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,C),text:_}])}})));const g=(m,_)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:m,y:_}),getActions:()=>(u&&(u.label=h?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+c):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+c)),d),autoSelectFirstItem:!0})};this._register(ii(this._diffActions,"mousedown",m=>{const{top:_,height:C}=Ii(this._diffActions);let b=Math.floor(a/3);m.preventDefault(),g(m.posx,_+C+b)})),this._register(i.onMouseMove(m=>{m.target.type===8||m.target.type===5?m.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(m=>{m.event.rightButton&&(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._viewZoneId&&(m.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,a),g(m.event.posx,m.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}=Ii(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 Al=Je("clipboardService");class xh{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}xh.None=Object.freeze({report(){}});const Ca=Je("editorProgressService");var dj=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},Ar=function(s,e){return function(t,i){e(t,i,s)}},$0;class YN{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?gl.capture(e):null;e.changeViewZones(r=>{var a;for(const l of this._zones)r.removeZone(l);for(const l of this._inlineDiffMargins)l.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let l=0,d=i.zones.length;l<d;l++){const h=i.zones[l];h.suppressMouseDown=!0;const c=r.addZone(h);this._zones.push(c),this._zonesMap[String(c)]=!0,i.zones[l].diff&&h.marginDomNode&&(h.suppressMouseDown=!1,((a=i.zones[l].diff)===null||a===void 0?void 0:a.originalModel.getValueLength())!==0&&this._inlineDiffMargins.push(new lj(c,h.marginDomNode,e,i.zones[l].diff,this._contextMenuService,this._clipboardService)))}}),o&&o.restore(e),this._decorations=e.deltaDecorations(this._decorations,i.decorations),t&&t.setZones(i.overviewZones)}}let hj=0;const cj=Oi("diff-insert",ie.add,p("diffInsertIcon","Line decoration for inserts in the diff editor.")),xP=Oi("diff-remove",ie.remove,p("diffRemoveIcon","Line decoration for removals in the diff editor.")),XN=($0=window.trustedTypes)===null||$0===void 0?void 0:$0.createPolicy("diffEditorWidget",{createHTML:s=>s});let pl=class Pi extends H{constructor(e,t,i,n,o,r,a,l,d,h,c,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 qg([ve,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=d,this._notificationService=h,this._id=++hj,this._state=0,this._updatingDiffProgress=null,this._domElement=e,t=t||{},this._options=eT(t,{enableSplitViewResizing:!0,renderSideBySide:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),typeof t.isInEmbeddedEditor<"u"?this._contextKeyService.createKey("isInEmbeddedDiffEditor",t.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new Lt(()=>this._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=Pi._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=Ke(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(ii(this._overviewDomElement,"mousedown",g=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(g)})),this._options.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 YN(c,n),this._modifiedEditorState=new YN(c,n),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new mO(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=a.createInstance(fC,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new Xr(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new JN(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(d.onDidColorThemeChange(g=>{this._strategy&&this._strategy.applyColors(g)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=Pi._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)}));const f=Bc.getDiffEditorContributions();for(const g of f)try{this._register(a.createInstance(g.ctor,this))}catch(m){Le(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+=qb(e.type),i}_recreateOverviewRulers(){this._options.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(43)&&this._updateDecorationsRunner.schedule(),o.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeHiddenAreas(()=>{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()+Pi.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(43)&&this._updateDecorationsRunner.schedule(),o.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeHiddenAreas(()=>{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()+Pi.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(Gg,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._options.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 Mp.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(e){const t=eT(e,this._options),i=pj(this._options,t);this._options=t;const n=i.ignoreTrimWhitespace||i.renderIndicators,o=this._isVisible&&(i.maxComputationTime||i.maxFileSize);n?this._beginUpdateDecorations():o&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(e)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(e)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),i.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new Xr(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new JN(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=Pi._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),i.renderOverviewRuler&&(this._options.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._options.renderOverviewRuler||!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const e=this._elementSizeObserver.getHeight(),t=this._getReviewHeight(),i=Pi.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Pi.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:Pi.ONE_OVERVIEW_WIDTH,right:i+Pi.ONE_OVERVIEW_WIDTH,height:e-t}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:Pi.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(),Pi.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,n=this._options.maxFileSize*1024*1024,o=r=>{const a=r.getValueLength();return n===0||a<=n};if(!o(e)||!o(t)){(!Pi._equals(e.uri,this._lastOriginalWarning)||!Pi._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._setState(1),this._editorWorkerService.computeDiff(e.uri,t.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then(r=>{i===this._diffComputationToken&&e===this._originalEditor.getModel()&&t===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=r,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},r=>{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._options.ignoreTrimWhitespace,this._options.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._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:t.wordWrapOverride1="off",e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,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._options.diffWordWrap,t.revealHorizontalRightPadding=Do.revealHorizontalRightPadding.defaultValue+Pi.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=Pi.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=e-Pi.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(Pi.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:n,height:t-i}),this._modifiedEditor.layout({width:e-n-(this._options.renderOverviewRuler?Pi.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._options.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}};pl.ONE_OVERVIEW_WIDTH=15;pl.ENTIRE_DIFF_OVERVIEW_WIDTH=30;pl.UPDATE_DIFF_DECORATIONS_DELAY=200;pl=dj([Ar(3,Al),Ar(4,Ys),Ar(5,ve),Ar(6,Ge),Ar(7,tt),Ar(8,Dt),Ar(9,ni),Ar(10,Tl),Ar(11,Ca)],pl);class kP extends H{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(VO)||Iy).transparent(2),i=(e.getColor(HO)||Ey).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,h)=>d.afterLineNumber-h.afterLineNumber),n=n.sort((d,h)=>d.afterLineNumber-h.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 QN{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 gd{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=Xg(n,o,t,i);return r.endLineNumber-r.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(58),t=this._modifiedEditor.getOption(58),i=this._originalEditor.getOption(130).wrappingColumn!==-1,n=this._modifiedEditor.getOption(130).wrappingColumn!==-1,o=i||n,r=this._originalEditor.getModel(),a=this._originalEditor._getViewModel().coordinatesConverter,l=this._modifiedEditor._getViewModel().coordinatesConverter,d={original:[],modified:[]};let h=0,c=0,u=0,f=0,g=0,m=0;const _=(k,L)=>k.afterLineNumber-L.afterLineNumber,C=(k,L)=>{if(L.domNode===null&&k.length>0){const D=k[k.length-1];if(D.afterLineNumber===L.afterLineNumber&&D.domNode===null){D.heightInLines+=L.heightInLines;return}}k.push(L)},b=new QN(this._modifiedForeignVZ),v=new QN(this._originalForeignVZ);let w=1,y=1;for(let k=0,L=this._lineChanges.length;k<=L;k++){const D=k<L?this._lineChanges[k]:null;D!==null?(u=D.originalStartLineNumber+(D.originalEndLineNumber>0?-1:0),f=D.modifiedStartLineNumber+(D.modifiedEndLineNumber>0?-1:0),c=D.originalEndLineNumber>0?gd._getViewLineCount(this._originalEditor,D.originalStartLineNumber,D.originalEndLineNumber):0,h=D.modifiedEndLineNumber>0?gd._getViewLineCount(this._modifiedEditor,D.modifiedStartLineNumber,D.modifiedEndLineNumber):0,g=Math.max(D.originalStartLineNumber,D.originalEndLineNumber),m=Math.max(D.modifiedStartLineNumber,D.modifiedEndLineNumber)):(u+=1e7+c,f+=1e7+h,g=u,m=f);let N=[],B=[];if(o){let K;D?D.originalEndLineNumber>0?K=D.originalStartLineNumber-w:K=D.modifiedStartLineNumber-y:K=r.getLineCount()-w;for(let le=0;le<K;le++){const de=w+le,_e=y+le,De=a.getModelLineViewLineCount(de),we=l.getModelLineViewLineCount(_e);De<we?N.push({afterLineNumber:de,heightInLines:we-De,domNode:null,marginDomNode:null}):De>we&&B.push({afterLineNumber:_e,heightInLines:De-we,domNode:null,marginDomNode:null})}D&&(w=(D.originalEndLineNumber>0?D.originalEndLineNumber:D.originalStartLineNumber)+1,y=(D.modifiedEndLineNumber>0?D.modifiedEndLineNumber:D.modifiedStartLineNumber)+1)}for(;b.current&&b.current.afterLineNumber<=m;){let K;b.current.afterLineNumber<=f?K=u-f+b.current.afterLineNumber:K=g;let le=null;D&&D.modifiedStartLineNumber<=b.current.afterLineNumber&&b.current.afterLineNumber<=D.modifiedEndLineNumber&&(le=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),N.push({afterLineNumber:K,heightInLines:b.current.height/t,domNode:null,marginDomNode:le}),b.advance()}for(;v.current&&v.current.afterLineNumber<=g;){let K;v.current.afterLineNumber<=u?K=f-u+v.current.afterLineNumber:K=m,B.push({afterLineNumber:K,heightInLines:v.current.height/e,domNode:null}),v.advance()}if(D!==null&&Uc(D)){const K=this._produceOriginalFromDiff(D,c,h);K&&N.push(K)}if(D!==null&&$c(D)){const K=this._produceModifiedFromDiff(D,c,h);K&&B.push(K)}let O=0,$=0;for(N=N.sort(_),B=B.sort(_);O<N.length&&$<B.length;){const K=N[O],le=B[$],de=K.afterLineNumber-u,_e=le.afterLineNumber-f;de<_e?(C(d.original,K),O++):_e<de?(C(d.modified,le),$++):K.shouldNotShrink?(C(d.original,K),O++):le.shouldNotShrink?(C(d.modified,le),$++):K.heightInLines>=le.heightInLines?(K.heightInLines-=le.heightInLines,$++):(le.heightInLines-=K.heightInLines,O++)}for(;O<N.length;)C(d.original,N[O]),O++;for(;$<B.length;)C(d.modified,B[$]),$++}return{original:gd._ensureDomNodes(d.original),modified:gd._ensureDomNodes(d.modified)}}static _ensureDomNodes(e){return e.map(t=>(t.domNode||(t.domNode=IP()),t))}}function Kr(s,e,t,i,n){return{range:new S(s,e,t,i),options:n}}const pn={charDelete:Ee.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:Ee.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:Ee.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:Ee.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:Ee.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:Ee.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+kt.asClassName(cj),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:Ee.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:Ee.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+kt.asClassName(xP),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:Ee.register({description:"diff-editor-line-delete-margin",marginClassName:"line-delete"})};class Xr extends kP{constructor(e,t){super(e),this._disableSash=t===!1,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new Wi(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?pl.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>Xr.MINIMUM_EDITOR_WIDTH*2?(n<Xr.MINIMUM_EDITOR_WIDTH&&(n=Xr.MINIMUM_EDITOR_WIDTH),n>i-Xr.MINIMUM_EDITOR_WIDTH&&(n=i-Xr.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?pl.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 uj(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($c(d)){r.decorations.push({range:new S(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:i?pn.lineDeleteWithSign:pn.lineDelete}),(!Uc(d)||!d.charChanges)&&r.decorations.push(Kr(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824,pn.charDeleteWholeLine));const h=Xg(a,l,d.originalStartLineNumber,d.originalEndLineNumber);if(r.overviewZones.push(new $g(h.startLineNumber,h.endLineNumber,o)),d.charChanges){for(const c of d.charChanges)if($c(c))if(t)for(let u=c.originalStartLineNumber;u<=c.originalEndLineNumber;u++){let f,g;u===c.originalStartLineNumber?f=c.originalStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===c.originalEndLineNumber?g=c.originalEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(Kr(u,f,u,g,pn.charDelete))}else r.decorations.push(Kr(c.originalStartLineNumber,c.originalStartColumn,c.originalEndLineNumber,c.originalEndColumn,pn.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(Uc(d)){r.decorations.push({range:new S(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824),options:i?pn.lineInsertWithSign:pn.lineInsert}),(!$c(d)||!d.charChanges)&&r.decorations.push(Kr(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824,pn.charInsertWholeLine));const h=Xg(a,l,d.modifiedStartLineNumber,d.modifiedEndLineNumber);if(r.overviewZones.push(new $g(h.startLineNumber,h.endLineNumber,o)),d.charChanges){for(const c of d.charChanges)if(Uc(c))if(t)for(let u=c.modifiedStartLineNumber;u<=c.modifiedEndLineNumber;u++){let f,g;u===c.modifiedStartLineNumber?f=c.modifiedStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===c.modifiedEndLineNumber?g=c.modifiedEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(Kr(u,f,u,g,pn.charInsert))}else r.decorations.push(Kr(c.modifiedStartLineNumber,c.modifiedStartColumn,c.modifiedEndLineNumber,c.modifiedEndColumn,pn.charInsert))}}return r}}Xr.MINIMUM_EDITOR_WIDTH=100;class uj extends gd{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 JN extends kP{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 fj(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($c(d)){o.decorations.push({range:new S(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:pn.lineDeleteMargin});const h=Xg(a,l,d.originalStartLineNumber,d.originalEndLineNumber);o.overviewZones.push(new $g(h.startLineNumber,h.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(Uc(d)){r.decorations.push({range:new S(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824),options:i?pn.lineInsertWithSign:pn.lineInsert});const h=Xg(a,l,d.modifiedStartLineNumber,d.modifiedEndLineNumber);if(r.overviewZones.push(new $g(h.startLineNumber,h.endLineNumber,o)),d.charChanges){for(const c of d.charChanges)if(Uc(c))if(t)for(let u=c.modifiedStartLineNumber;u<=c.modifiedEndLineNumber;u++){let f,g;u===c.modifiedStartLineNumber?f=c.modifiedStartColumn:f=a.getLineFirstNonWhitespaceColumn(u),u===c.modifiedEndLineNumber?g=c.modifiedEndColumn:g=a.getLineLastNonWhitespaceColumn(u),r.decorations.push(Kr(u,f,u,g,pn.charInsert))}else r.decorations.push(Kr(c.modifiedStartLineNumber,c.modifiedStartColumn,c.modifiedEndLineNumber,c.modifiedEndColumn,pn.charInsert))}else r.decorations.push(Kr(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824,pn.charInsertWholeLine))}return r}layout(){return Math.max(5,this._decorationsLeft)}}class fj extends gd{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 ${Nd}`;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(43),o=t.get(29),r=n.typicalHalfwidthCharacterWidth,a=t.get(92),l=this._originalModel.mightContainNonBasicASCII(),d=this._originalModel.mightContainRTL(),h=t.get(58),u=t.get(129).decorationsWidth,f=t.get(104),g=t.get(87),m=t.get(82),_=t.get(44),C=this._lineBreaksComputer.finalize();let b=0;for(let v=0;v<this._pendingLineChange.length;v++){const w=this._pendingLineChange[v],y=this._pendingViewZones[v],k=y.domNode;Ui.applyFontInfoSlow(k,n);const L=y.marginDomNode;Ui.applyFontInfoSlow(L,n);const D=[];if(w.charChanges)for(const _e of w.charChanges)$c(_e)&&D.push(new Uf(new S(_e.originalStartLineNumber,_e.originalStartColumn,_e.originalEndLineNumber,_e.originalEndColumn),"char-delete",0));const N=D.length>0,B=Vd(1e4);let O=0,$=0,K=null;for(let _e=w.originalStartLineNumber;_e<=w.originalEndLineNumber;_e++){const De=_e-w.originalStartLineNumber,we=this._originalModel.getLineTokens(_e),Se=we.getLineContent(),Tt=C[b++],bt=qn.filter(D,_e,1,Se.length+1);if(Tt){let xt=0;for(const dt of Tt.breakOffsets){const Sn=we.sliceAndInflate(xt,dt,0),No=Se.substring(xt,dt);O=Math.max(O,this._renderOriginalLine($++,No,Sn,qn.extractWrapped(bt,xt,dt),N,l,d,n,o,h,u,f,g,m,_,i,B,L)),xt=dt}for(K||(K=[]);K.length<De;)K[K.length]=1;K[De]=Tt.breakOffsets.length,y.heightInLines+=Tt.breakOffsets.length-1;const Pt=document.createElement("div");Pt.className="line-delete",e.original.push({afterLineNumber:_e,afterColumn:0,heightInLines:Tt.breakOffsets.length-1,domNode:IP(),marginDomNode:Pt})}else O=Math.max(O,this._renderOriginalLine($++,Se,we,bt,N,l,d,n,o,h,u,f,g,m,_,i,B,L))}O+=a;const le=B.build(),de=XN?XN.createHTML(le):le;if(k.innerHTML=de,y.minWidthInPx=O*r,K){const _e=w.originalEndLineNumber-w.originalStartLineNumber;for(;K.length<=_e;)K[K.length]=1}y.diff.viewLineCounts=K}e.original.sort((v,w)=>v.afterLineNumber-w.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m,_,C,b){C.appendASCIIString('<div class="view-line'),o||C.appendASCIIString(" char-delete"),C.appendASCIIString('" style="top:'),C.appendASCIIString(String(e*h)),C.appendASCIIString('px;width:1000000px;">');const v=Jn.isBasicASCII(t,r),w=Jn.containsRTL(t,v,a),y=ov(new wh(l.isMonospace&&!d,l.canUseHalfwidthRightwardsArrow,t,!1,v,w,0,i,n,_,0,l.spaceWidth,l.middotWidth,l.wsmiddotWidth,u,f,g,m!==Hn.OFF,null),C);if(C.appendASCIIString("</div>"),this._renderIndicators){const k=document.createElement("div");k.className=`delete-sign ${kt.asClassName(xP)}`,k.setAttribute("style",`position:absolute;top:${e*h}px;width:${c}px;height:${h}px;right:0;`),b.appendChild(k)}return y.characterMapping.getAbsoluteOffset(y.characterMapping.length)}}function gj(s,e){return mn(s,e,["off","on","inherit"])}function Uc(s){return s.modifiedEndLineNumber>0}function $c(s){return s.originalEndLineNumber>0}function IP(){const s=document.createElement("div");return s.className="diagonal-fill",s}function Xg(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 S(t,s.getLineMinColumn(t),i,s.getLineMaxColumn(i)))}function eT(s,e){return{enableSplitViewResizing:pe(s.enableSplitViewResizing,e.enableSplitViewResizing),renderSideBySide:pe(s.renderSideBySide,e.renderSideBySide),maxComputationTime:qS(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:qS(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:pe(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:pe(s.renderIndicators,e.renderIndicators),originalEditable:pe(s.originalEditable,e.originalEditable),diffCodeLens:pe(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:pe(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:gj(s.diffWordWrap,e.diffWordWrap)}}function pj(s,e){return{enableSplitViewResizing:s.enableSplitViewResizing!==e.enableSplitViewResizing,renderSideBySide:s.renderSideBySide!==e.renderSideBySide,maxComputationTime:s.maxComputationTime!==e.maxComputationTime,maxFileSize:s.maxFileSize!==e.maxFileSize,ignoreTrimWhitespace:s.ignoreTrimWhitespace!==e.ignoreTrimWhitespace,renderIndicators:s.renderIndicators!==e.renderIndicators,originalEditable:s.originalEditable!==e.originalEditable,diffCodeLens:s.diffCodeLens!==e.diffCodeLens,renderOverviewRuler:s.renderOverviewRuler!==e.renderOverviewRuler,diffWordWrap:s.diffWordWrap!==e.diffWordWrap}}st((s,e)=>{const t=s.getColor(VO);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(HO);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(P9);n&&e.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${s.type==="hc"?"dashed":"solid"} ${n}; }`);const o=s.getColor(F9);o&&e.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${s.type==="hc"?"dashed":"solid"} ${o}; }`);const r=s.getColor(zp);r&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=s.getColor(B9);a&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=s.getColor(Jf);l&&e.addRule(`
  104. .monaco-diff-editor .diffViewport {
  105. background: ${l};
  106. }
  107. `);const d=s.getColor(eg);d&&e.addRule(`
  108. .monaco-diff-editor .diffViewport:hover {
  109. background: ${d};
  110. }
  111. `);const h=s.getColor(tg);h&&e.addRule(`
  112. .monaco-diff-editor .diffViewport:active {
  113. background: ${h};
  114. }
  115. `);const c=s.getColor(W9);e.addRule(`
  116. .monaco-editor .diagonal-fill {
  117. background-image: linear-gradient(
  118. -45deg,
  119. ${c} 12.5%,
  120. #0000 12.5%, #0000 50%,
  121. ${c} 50%, ${c} 62.5%,
  122. #0000 62.5%, #0000 100%
  123. );
  124. background-size: 8px 8px;
  125. }
  126. `)});const kh=Je("themeService"),Nt=Je("keybindingService");class mj extends H{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 _j=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},bj=function(s,e){return function(t,i){e(t,i,s)}};class Cj{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){ub(e,this._styleSheet)}}class vj{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){ub(e,this._styleSheet)}}let zy=class extends mj{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 vj(Yn())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!GC(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new Cj(this,i,Yn(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 wj(this._themeService,a,l):r=new Sj(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)}};zy=_j([bj(1,Dt)],zy);class wj{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new gC(3,i,e),this._afterContentRules=new gC(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 Sj{constructor(e,t,i,n){this._disposables=new X,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=c=>{const u=new gC(c,n,t);if(this._disposables.add(u),u.hasContent)return u.className},r=c=>{const u=new gC(c,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(0);const a=r(1);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(3),this.afterContentClassName=o(4),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const c=r(5);this.beforeInjectedText={content:n.options.beforeInjectedText.contentText,inlineClassName:c==null?void 0:c.className,inlineClassNameAffectsLetterSpacing:(c==null?void 0:c.hasLetterSpacing)||n.options.beforeInjectedText.affectsLetterSpacing}}if(n.options.afterInjectedText&&n.options.afterInjectedText.contentText){const c=r(6);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:c==null?void 0:c.className,inlineClassNameAffectsLetterSpacing:(c==null?void 0:c.hasLetterSpacing)||n.options.afterInjectedText.affectsLetterSpacing}}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,h=l.dark&&l.dark.overviewRulerColor||l.overviewRulerColor;(typeof d<"u"||typeof h<"u")&&(this.overviewRuler={color:d||h,darkColor:h||d,position:l.overviewRulerLane||Xn.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,before:this.beforeInjectedText,after:this.afterInjectedText}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const ff={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};",verticalAlign:"vertical-align:{0};"};class gC{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=j0.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+j0.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=j0.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;case 5:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case 6:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);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(Vi(ff.contentIconPath,ua(me.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Vi(ff.contentText,n))}this.collectCSSText(e,["verticalAlign","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(Vi(ff.gutterIconPath,ua(me.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(Vi(ff.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(Vi("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(Vi(ff[o],r))}return i.length!==n}resolveValue(e){if(mW(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class j0{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 yj=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},tT=function(s,e){return function(t,i){e(t,i,s)}};let pC=class extends zy{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===Te.http||o===Te.https)return JR(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}};pC=yj([tT(1,ve),tT(2,Dt)],pC);var Sk=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},yt=function(s,e){return function(t,i){e(t,i,s)}};let Lj=0,iT=!1;function Dj(s){if(!s){if(iT)return;iT=!0}_8(s||document.body)}let mC=class extends Gg{constructor(e,t,i,n,o,r,a,l,d,h){const c=Object.assign({},t);c.ariaLabel=c.ariaLabel||zb.editorViewAccessibleLabel,c.ariaLabel=c.ariaLabel+";"+zb.accessibilityHelpMessage,super(e,c,{},i,n,o,r,l,d,h),a instanceof aO?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Dj(c.ariaContainerElement)}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_"+ ++Lj,o=te.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"),H.None;const t=e.id,i=e.label,n=te.and(te.equals("editorId",this.getId()),te.deserialize(e.precondition)),o=e.keybindings,r=te.and(n,te.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,d=(f,...g)=>Promise.resolve(e.run(this,...g)),h=new X,c=this.getId()+":"+t;if(h.add($e.registerCommand(c,d)),a){let f={command:{id:c,title:i},when:n,group:a,order:l};h.add(ps.appendMenuItem(ae.EditorContext,f))}if(Array.isArray(o))for(const f of o)h.add(this._standaloneKeybindingService.addDynamicKeybinding(c,f,d,r));let u=new _P(c,i,i,n,d,this._contextKeyService);return this._actions[t]=u,h.add(Ve(()=>{delete this._actions[t]})),h}_triggerCommand(e,t){if(this._codeEditorService instanceof pC)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};mC=Sk([yt(2,Ge),yt(3,tt),yt(4,Yt),yt(5,ve),yt(6,Nt),yt(7,Dt),yt(8,ni),yt(9,On)],mC);let Uy=class extends mC{constructor(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m){const _=Object.assign({},t);Ub(u,_,!1);const C=h.registerEditorContainer(e);typeof _.theme=="string"&&h.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&h.setAutoDetectHighContrast(!!_.autoDetectHighContrast);let b=_.model;delete _.model,super(e,_,n,o,r,a,l,h,c,f),this._contextViewService=d,this._configurationService=u,this._standaloneThemeService=h,this._register(i),this._register(C);let v;if(typeof b>"u"?(v=EP(g,m,_.value||"",_.language||Os.text,void 0),this._ownsModel=!0):(v=b,this._ownsModel=!1),this._attachModel(v),v){let w={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){Ub(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)}};Uy=Sk([yt(3,Ge),yt(4,tt),yt(5,Yt),yt(6,ve),yt(7,Nt),yt(8,Nl),yt(9,kh),yt(10,ni),yt(11,Vt),yt(12,On),yt(13,ri),yt(14,Qi)],Uy);let $y=class extends pl{constructor(e,t,i,n,o,r,a,l,d,h,c,u,f,g,m){const _=Object.assign({},t);Ub(u,_,!0);const C=h.registerEditorContainer(e);typeof _.theme=="string"&&h.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&h.setAutoDetectHighContrast(!!_.autoDetectHighContrast),super(e,_,{},m,l,o,n,d,h,c,f,g),this._contextViewService=a,this._configurationService=u,this._standaloneThemeService=h,this._register(i),this._register(C),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){Ub(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(mC,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)}};$y=Sk([yt(3,Ge),yt(4,ve),yt(5,Nt),yt(6,Nl),yt(7,Ys),yt(8,tt),yt(9,kh),yt(10,ni),yt(11,Vt),yt(12,Tl),yt(13,Ca),yt(14,Al)],$y);function EP(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(`
  127. `);let r=t;return o!==-1&&(r=t.substring(0,o)),nT(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return nT(s,t,e.create(i),n)}function nT(s,e,t,i){return s.createModel(e,t,i)}const Ul=Object.prototype.hasOwnProperty;class xj{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(dl,0),this._register(Bu,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||dl}}class Qg extends H{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new M),this.onDidChange=this._onDidChange.event,Qg.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new xj,this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Td.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Qg.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Dz();const e=Td.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})}),Xt.as(Ch.Configuration).registerOverrideIdentifiers(Td.getLanguages().map(t=>t.id)),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Ul.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,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)Tm({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)Tm({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)Tm({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);I3(l)||Tm({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){Le(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 Ul.call(this._mimeTypesMap,e)?!0:Ul.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return Ul.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e]:null}extractModeIds(e){return e?e.split(",").map(t=>t.trim()).map(t=>Ul.call(this._mimeTypesMap,t)?this._mimeTypesMap[t]:t).filter(t=>Ul.call(this._languages,t)):[]}validateLanguageId(e){return!e||e===dl?dl:Ul.call(this._languages,e)?e:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=xz(e,t);return this.extractModeIds(i.join(","))}}Qg.instanceCount=0;class sT{constructor(e,t){this._selector=t,this.languageId=this._selector();let i;this._onDidChange=new M({onFirstListenerAdd:()=>{i=e(()=>this._evaluate())},onLastListenerRemove:()=>{i.dispose()}}),this.onDidChange=this._onDidChange.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._onDidChange.fire(this.languageId))}}class Jg extends H{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new M),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onLanguagesMaybeChanged=this._register(new M({leakWarningThreshold:200})),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,Jg.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new Qg(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onLanguagesMaybeChanged.fire()))}dispose(){Jg.instanceCount--,super.dispose()}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 ay(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return ay(t,null)}validateLanguageId(e){return this._registry.validateLanguageId(e)}create(e){return new sT(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new sT(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.validateLanguageId(e||"plaintext")||dl;return this._getOrCreateMode(t),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._encounteredLanguages.has(e)){this._encounteredLanguages.add(e);const t=this.validateLanguageId(e)||dl;this._onDidEncounterLanguage.fire(t)}}}Jg.instanceCount=0;var kj=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},K0=function(s,e){return function(t,i){e(t,i,s)}};let jy=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._modeService=i,this._logService=n,this._hashTable=new qr,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const n=this._modeService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let r;if(o)r=o.metadata,this._logService.getLevel()===ho.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Yi.getForeground(r)}, fontStyle ${Yi.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let d=t;for(let c=0;d>0&&c<this._legend.tokenModifiers.length;c++)d&1&&l.push(this._legend.tokenModifiers[c]),d=d>>1;d>0&&this._logService.getLevel()===ho.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const h=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof h>"u")r=2147483647;else{if(r=0,typeof h.italic<"u"){const c=(h.italic?1:0)<<11;r|=c|1}if(typeof h.bold<"u"){const c=(h.bold?2:0)<<11;r|=c|2}if(typeof h.underline<"u"){const c=(h.underline?4:0)<<11;r|=c|4}if(h.foreground){const c=h.foreground<<14;r|=c|8}r===0&&(r=2147483647)}}else this._logService.getLevel()===ho.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,r),this._logService.getLevel()===ho.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Yi.getForeground(r)}, fontStyle ${Yi.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}};jy=kj([K0(1,Dt),K0(2,Qi),K0(3,Cr)],jy);function NP(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 h=a;let c=Math.min(h+o,n);if(c<n){let v=c;for(;v-1>h&&i[5*v]===0;)v--;if(v-1===h){let w=c;for(;w+1<n&&i[5*w]===0;)w++;c=w}else c=v}let u=new Uint32Array((c-h)*4),f=0,g=0,m=0,_=0,C=0;for(;a<c;){const v=5*a,w=i[v],y=i[v+1],k=l+w|0,L=w===0?d+y|0:y,D=i[v+2],N=i[v+3],B=i[v+4],O=e.getMetadata(N,B,t);O!==2147483647&&(g===0&&(g=k),m===k&&C>L&&(e.warnOverlappingSemanticTokens(k,L+1),_<L?u[f-4+2]=L:f-=4),u[f]=k-g,u[f+1]=L,u[f+2]=L+D,u[f+3]=O,f+=4,m=k,_=L,C=L+D),l=k,d=L,a++}f!==u.length&&(u=u.subarray(0,f));const b=new Zb(g,new Gb(u));r.push(b)}return r}class Ij{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class qr{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=qr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<qr._SIZES.length?2/3*this._currentLength:0),this._elements=[],qr._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=qr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<qr._SIZES.length?2/3*this._currentLength:0),this._elements=[],qr._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 Ij(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}}qr._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];function Ej(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 Nj(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return yR()||Ej(e),YC.wrap(e)}function TP(s){const e=new Uint32Array(Tj(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 Nj(e)}function Tj(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 ml=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function Rv(s){return s&&!!s.data}function AP(s){return s&&Array.isArray(s.edits)}class Aj{constructor(e,t){this.provider=e,this.tokens=t}}function RP(s){return Jc.has(s)}function Rj(s){const e=Jc.orderedGroups(s);return e.length>0?e[0]:[]}function MP(s,e,t,i){return ml(this,void 0,void 0,function*(){const n=Rj(s),o=yield Promise.all(n.map(r=>ml(this,void 0,void 0,function*(){let a;try{a=yield r.provideDocumentSemanticTokens(s,r===e?t:null,i)}catch(l){Di(l),a=null}return(!a||!Rv(a)&&!AP(a))&&(a=null),new Aj(r,a)})));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null})}function Mj(s){const e=Jc.orderedGroups(s);return e.length>0?e[0]:null}class Oj{constructor(e,t){this.provider=e,this.tokens=t}}function Pj(s){return ev.has(s)}function OP(s){const e=ev.orderedGroups(s);return e.length>0?e[0]:[]}function yk(s,e,t){return ml(this,void 0,void 0,function*(){const i=OP(s),n=yield Promise.all(i.map(o=>ml(this,void 0,void 0,function*(){let r;try{r=yield o.provideDocumentRangeSemanticTokens(s,e,t)}catch(a){Di(a),r=null}return(!r||!Rv(r))&&(r=null),new Oj(o,r)})));for(const o of n)if(o.tokens)return o;return n.length>0?n[0]:null})}$e.registerCommand("_provideDocumentSemanticTokensLegend",(s,...e)=>ml(void 0,void 0,void 0,function*(){const[t]=e;ut(t instanceof me);const i=s.get(ri).getModel(t);if(!i)return;const n=Mj(i);return n?n[0].getLegend():s.get(Yt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));$e.registerCommand("_provideDocumentSemanticTokens",(s,...e)=>ml(void 0,void 0,void 0,function*(){const[t]=e;ut(t instanceof me);const i=s.get(ri).getModel(t);if(!i)return;if(!RP(i))return s.get(Yt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const n=yield MP(i,null,null,Oe.None);if(!n)return;const{provider:o,tokens:r}=n;if(!r||!Rv(r))return;const a=TP({id:0,type:"full",data:r.data});return r.resultId&&o.releaseDocumentSemanticTokens(r.resultId),a}));$e.registerCommand("_provideDocumentRangeSemanticTokensLegend",(s,...e)=>ml(void 0,void 0,void 0,function*(){const[t,i]=e;ut(t instanceof me);const n=s.get(ri).getModel(t);if(!n)return;const o=OP(n);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!S.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const r=yield yk(n,S.lift(i),Oe.None);if(r)return r.provider.getLegend()}));$e.registerCommand("_provideDocumentRangeSemanticTokens",(s,...e)=>ml(void 0,void 0,void 0,function*(){const[t,i]=e;ut(t instanceof me),ut(S.isIRange(i));const n=s.get(ri).getModel(t);if(!n)return;const o=yield yk(n,S.lift(i),Oe.None);if(!(!o||!o.tokens))return TP({id:0,type:"full",data:o.tokens.data})}));var Fj=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},$l=function(s,e){return function(t,i){e(t,i,s)}};function ka(s){return s.toString()}function oT(s){const e=new QC,t=s.createSnapshot();let i;for(;i=t.read();)e.update(i);return e.digest()}class Bj{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.languageId)),this.model.setMode(e.languageId)}}const Wj=Cn||Me?1:2;class Vj{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}}let _C=class Nf extends H{constructor(e,t,i,n,o,r,a){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._modeService=r,this._languageConfigurationService=a,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 zj(this._themeService,this._modeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new Hj(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){var i;let n=Gi.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(n=f),n<1&&(n=1)}let o=n;if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let r=Gi.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=Wj;const l=e.eol;l===`\r
  128. `?a=2:l===`
  129. `&&(a=1);let d=Gi.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(d=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let h=Gi.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(h=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let c=Gi.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(c=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=Gi.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:r,detectIndentation:h,defaultEOL:a,trimAutoWhitespace:d,largeFileOptimizations:c,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Ms===3||Ms===2?`
  130. `:`\r
  131. `}_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=Nf._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.getLanguageId(),l=r.model.uri,d=e[a+l],h=this.getCreationOptions(a,l,r.model.isForSimpleWidget);Nf._setModelOptionsForModel(r.model,h,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&po(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(ka(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(ka(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(ka(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,i,n),r=new ts(e,o,t,i,this._undoRedoService,this._modeService,this._languageConfigurationService);if(i&&this._disposedModels.has(ka(i))){const d=this._removeDisposedModel(i),h=this._undoRedoService.getElements(i),c=oT(r)===d.sha1;if(c||d.sharesUndoRedoStack){for(const u of h.past)$r(u)&&u.matchesResource(i)&&u.setModel(r);for(const u of h.future)$r(u)&&u.matchesResource(i)&&u.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,u=>$r(u)&&u.matchesResource(i)),c&&(r._overwriteVersionId(d.versionId),r._overwriteAlternativeVersionId(d.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=ka(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Bj(r,d=>this._onWillDispose(d),(d,h)=>this._onDidChangeLanguage(d,h));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,Bu,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[ka(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=ka(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Te.file||e.scheme===Te.vscodeRemote||e.scheme===Te.userData||e.scheme===Te.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=ka(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,r=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const l=this._undoRedoService.getElements(e.uri);if(l.past.length>0||l.future.length>0){for(const d of l.past)$r(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)$r(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=Nf.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=>$r(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new Vj(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,oT(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.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);Nf._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldModeId:i})}};_C.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;_C=Fj([$l(0,Vt),$l(1,PM),$l(2,Dt),$l(3,Cr),$l(4,Wp),$l(5,Qi),$l(6,Pp)],_C);const Lk="editor.semanticHighlighting";function Ky(s,e,t){var i;const n=(i=t.getValue(Lk,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))===null||i===void 0?void 0:i.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}class Hj extends H{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=l=>{this._watchers[l.uri.toString()]=new pd(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()];Ky(l,t,i)?d||o(l):d&&r(l,d)}};this._register(e.onModelAdded(l=>{Ky(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(Lk)&&a()})),this._register(t.onDidColorThemeChange(a))}}class zj extends H{constructor(e,t,i){super(),this._themeService=e,this._modeService=t,this._logService=i,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 jy(e.getLegend(),this._themeService,this._modeService,this._logService)),this._caches.get(e)}}class Uj{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}class pd extends H{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new Lt(()=>this._fetchDocumentSemanticTokensNow(),pd.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=()=>{qe(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const o of Jc.all(e))typeof o.onDidChange=="function"&&this._documentProvidersChangeListeners.push(o.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};n(),this._register(Jc.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;if(!RP(this._model)){this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1);return}const e=new ln,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=MP(this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e;const o=[],r=this._model.onDidChangeContent(a=>{o.push(a)});n.then(a=>{if(this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!a)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:l,tokens:d}=a,h=this._semanticStyling.get(l);this._setDocumentSemanticTokens(l,d||null,h,o)}},a=>{a&&(br(a)||typeof a.message=="string"&&a.message.indexOf("busy")!==-1)||Le(a),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),o.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(AP(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 h=l.length,c=d.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u],g=h-(f.start+f.deleteCount);g>0&&(pd._copy(l,h-g,d,c-g,g),c-=g),f.data&&(pd._copy(f.data,0,d,c-f.data.length,f.data.length),c-=f.data.length),h=f.start}h>0&&pd._copy(l,0,d,0,h),t={resultId:t.resultId,data:d}}}if(Rv(t)){this._currentDocumentResponse=new Uj(e,t.resultId,t.data);const a=NP(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const h of l.changes)d.applyEdit(h.range,h.text);this._model.setSemanticTokens(a,!0)}else this._model.setSemanticTokens(null,!0);r()}}pd.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class $j{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 jj(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 h=0,c=d.length;h<c;h++)switch(d[h]){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 $j(o.token||"",i,r,a,l)}return e}function Kj(s,e){s.sort((h,c)=>{let u=Xj(h.token,c.token);return u!==0?u:h.index-c.index});let t=0,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){let h=s.shift();h.fontStyle!==-1&&(t=h.fontStyle),h.foreground!==null&&(i=h.foreground),h.background!==null&&(n=h.background)}let o=new Gj;for(let h of e)o.getId(h);let r=o.getId(i),a=o.getId(n),l=new Dk(t,r,a),d=new xk(l);for(let h=0,c=s.length;h<c;h++){let u=s[h];d.insert(u.token,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new PP(o,d)}const qj=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Gj{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(qj);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]=W.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class PP{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(jj(e),t)}static createFromParsedTokenTheme(e,t){return Kj(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=Yj(t);i=(n.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const Zj=/\b(comment|string|regex|regexp)\b/;function Yj(s){let e=s.match(Zj);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 Xj(s,e){return s<e?-1:s>e?1:0}class Dk{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 Dk(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 xk{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 xk(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}}function Qj(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(`
  132. `)}const Jj={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:{[ms]:"#FFFFFE",[el]:"#000000",[Qx]:"#E5EBF1",[xv]:"#D3D3D3",[kv]:"#939393",[Jx]:"#ADD6FF4D"}},eK={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:{[ms]:"#1E1E1E",[el]:"#D4D4D4",[Qx]:"#3A3D41",[xv]:"#404040",[kv]:"#707070",[Jx]:"#ADD6FF26"}},tK={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:{[ms]:"#000000",[el]:"#FFFFFF",[xv]:"#FFFFFF",[kv]:"#FFFFFF"}};function iK(){const s=new M,e=X$();return e.onDidChange(()=>s.fire()),{onDidChange:s.event,getCSS(){const t={},i=o=>{let r=o.defaults;for(;kt.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: ${QI(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=>`${ua(l.location)} format('${l.format}')`).join(", ");n.push(`@font-face { src: ${a}; font-family: ${QI(o)}; font-display: block; }`)}return n.join(`
  133. `)}}}const md="vs",bC="vs-dark",jc="hc-black",nK=Xt.as(AO.ColorContribution),sK=Xt.as(dO.ThemingContribution);class FP{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(F_(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,W.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=qy(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,W.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=nK.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case md:return gs.LIGHT;case jc:return gs.HIGH_CONTRAST;default:return gs.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let o=qy(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=PP.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Yi.getForeground(o),a=Yi.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4)}}}function F_(s){return s===md||s===bC||s===jc}function qy(s){switch(s){case md:return Jj;case bC:return eK;case jc:return tK}}function q0(s){let e=qy(s);return new FP(s,e)}class oK extends H{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(md,q0(md)),this._knownThemes.set(bC,q0(bC)),this._knownThemes.set(jc,q0(jc));const e=iK();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
  134. ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(md),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),y3("(forced-colors: active)",()=>{this._updateActualTheme()})}registerEditorContainer(e){return GC(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Yn(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),H.None}_registerShadowDomContainer(e){const t=Yn(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(!F_(t.base)&&!F_(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new FP(e,t)),F_(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(md),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(jc):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)}};sK.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(Qj(n)),this._themeCSS=e.join(`
  135. `),this._updateCSS(),Rt.setColorMap(n),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
  136. ${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}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)}};const rg="data-keybinding-context";let kk=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 du extends kk{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}du.INSTANCE=new du;class ep extends kk{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Mc.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===6){const o=Array.from(Ue.map(this._values,([r])=>r));this._values.clear(),i.fire(new aT(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Ue.map(l,([d])=>d)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new aT(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(ep._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(ep._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)}}ep._keyPrefix="config.";class lK{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 rT{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class aT{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class dK{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class BP{constructor(e){this._onDidChangeContext=new ob({merge:t=>new dK(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 lK(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 hK(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return Fc.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 rT(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new rT(e))}getContext(e){return this._isDisposed?du.INSTANCE:this.getContextValuesContainer(cK(e))}}let Gy=class extends BP{constructor(e){super(0),this._contexts=new Map,this._toDispose=new X,this._lastContextId=0;const t=new ep(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?du.INSTANCE:this._contexts.get(e)||du.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 kk(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Gy=rK([aK(0,Vt)],Gy);class hK extends BP{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new dn,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(rg)){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(rg,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(rg),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?du.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 cK(s){for(;s;){if(s.hasAttribute(rg)){const e=s.getAttribute(rg);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}$e.registerCommand(JH,function(s,e,t){s.get(ve).createKey(String(e),t)});$e.registerCommand({id:"getContextKeyInfo",handler(){return[...re.all()].sort((s,e)=>s.key.localeCompare(e.key))},description:{description:p("getContextKeyInfo","A command that returns information about context keys"),args:[]}});$e.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(let t of re.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))});function lT(s){let e=s.definition;for(;e instanceof ie;)e=e.definition;return`.codicon-${s.id}:before { content: '${e.fontCharacter}'; }`}var Bi;(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})(Bi||(Bi={}));var $a;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})($a||($a={}));function yc(s,e,t){const i=t.mode===$a.ALIGN?t.offset:t.offset+t.size,n=t.mode===$a.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 hu extends H{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=H.None,this.toDisposeOnSetContainer=H.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Y(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,_n(this.view),this.setContainer(e,t),this._register(Ve(()=>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=uK,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Y("slot"))}else this.container.appendChild(this.view);const n=new X;hu.BUBBLE_UP_EVENTS.forEach(o=>{n.add(ii(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),hu.BUBBLE_DOWN_EVENTS.forEach(o=>{n.add(ii(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Li(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",zn(this.view),this.toDisposeOnClean=e.render(this.view)||H.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&&!(lr&&KC.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;let e=this.delegate.getAnchor(),t;if(XR(e)){let c=Ii(e);t={top:c.top,left:c.left,width:c.width,height:c.height}}else t={top:e.y,left:e.x,width:e.width||1,height:e.height||2};const i=Es(this.view),n=H1(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,d;if(a===0){const c={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:$a.ALIGN};l=yc(window.innerHeight,n,c)+window.pageYOffset,Bi.intersects({start:l,end:l+n},{start:c.offset,end:c.offset+c.size})&&(u.mode=$a.AVOID),d=yc(window.innerWidth,i,u)}else{const c={offset:t.left,size:t.width,position:r===0?0:1},u={offset:t.top,size:t.height,position:o===0?0:1,mode:$a.ALIGN};d=yc(window.innerWidth,i,c),Bi.intersects({start:d,end:d+i},{start:c.offset,end:c.offset+c.size})&&(u.mode=$a.AVOID),l=yc(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 h=Ii(this.container);this.view.style.top=`${l-(this.useFixedPosition?Ii(this.view).top:h.top)}px`,this.view.style.left=`${d-(this.useFixedPosition?Ii(this.view).left:h.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(),_n(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!nr(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}hu.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];hu.BUBBLE_DOWN_EVENTS=["click"];let uK=`
  137. :host {
  138. all: initial; /* 1st rule so subsequent properties are reset. */
  139. }
  140. @font-face {
  141. font-family: "codicon";
  142. font-display: block;
  143. src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
  144. }
  145. .codicon[class*='codicon-'] {
  146. font: normal normal normal 16px/1 codicon;
  147. display: inline-block;
  148. text-decoration: none;
  149. text-rendering: auto;
  150. text-align: center;
  151. -webkit-font-smoothing: antialiased;
  152. -moz-osx-font-smoothing: grayscale;
  153. user-select: none;
  154. -webkit-user-select: none;
  155. -ms-user-select: none;
  156. }
  157. :host {
  158. font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
  159. }
  160. :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
  161. :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
  162. :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
  163. :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
  164. :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
  165. :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
  166. :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
  167. :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
  168. :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
  169. :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
  170. :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
  171. :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; }
  172. :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; }
  173. :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; }
  174. :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; }
  175. `;function Ik(...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 Mv=fK.bind(void 0,!0);function fK(s,e,t){if(!t||t.length<e.length)return null;let i;return s?i=nM(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function WP(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function gK(s,e){return Zy(s.toLowerCase(),e.toLowerCase(),0,0)}function Zy(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=Zy(s,e,t+1,i+1))?Tk({start:i,end:i+1},n):null}return Zy(s,e,t,i+1)}function Ek(s){return 97<=s&&s<=122}function Ov(s){return 65<=s&&s<=90}function Nk(s){return 48<=s&&s<=57}function VP(s){return s===32||s===9||s===10||s===13}const HP=new Set;"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(s=>HP.add(s.charCodeAt(0)));function CC(s){return VP(s)||HP.has(s)}function pK(s,e){return s===e||CC(s)&&CC(e)}function zP(s){return Ek(s)||Ov(s)||Nk(s)}function Tk(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function UP(s,e){for(let t=e;t<s.length;t++){const i=s.charCodeAt(t);if(Ov(i)||Nk(i)||t>0&&!zP(s.charCodeAt(t-1)))return t}return s.length}function Yy(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=Yy(s,e,t+1,i+1);!n&&(o=UP(e,o))<e.length;)n=Yy(s,e,t+1,o),o++;return n===null?null:Tk({start:i,end:i+1},n)}}function mK(s){let e=0,t=0,i=0,n=0,o=0;for(let h=0;h<s.length;h++)o=s.charCodeAt(h),Ov(o)&&e++,Ek(o)&&t++,zP(o)&&i++,Nk(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 _K(s){const{upperPercent:e,lowerPercent:t}=s;return t===0&&e>.6}function bK(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function CK(s){let e=0,t=0,i=0,n=0;for(let o=0;o<s.length;o++)i=s.charCodeAt(o),Ov(i)&&e++,Ek(i)&&t++,VP(i)&&n++;return(e===0||t===0)&&n===0?s.length<=30:e<=5}function $P(s,e){if(!e||(e=e.trim(),e.length===0)||!CK(s)||e.length>60)return null;const t=mK(e);if(!bK(t)){if(!_K(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n<e.length&&(i=Yy(s,e,0,n))===null;)n=UP(e,n+1);return i}function vK(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=Xy(s,e,0,n,t))===null;)n=jP(e,n+1);return i}function Xy(s,e,t,i,n){if(t===s.length)return[];if(i===e.length)return null;if(pK(s.charCodeAt(t),e.charCodeAt(i))){let o=null,r=i+1;if(o=Xy(s,e,t+1,i+1,n),!n)for(;!o&&(r=jP(e,r))<e.length;)o=Xy(s,e,t+1,r,n),r++;return o===null?null:Tk({start:i,end:i+1},o)}else return null}function jP(s,e){for(let t=e;t<s.length;t++)if(CC(s.charCodeAt(t))||t>0&&CC(s.charCodeAt(t-1)))return t;return s.length}const wK=Ik(Mv,$P,WP),SK=Ik(Mv,$P,gK),dT=new kl(1e4);function hT(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=dT.get(s);i||(i=new RegExp(x3(s),"i"),dT.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?SK(s,e):wK(s,e)}function yK(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t<r;t++){const a=cu(s,e,t,i,n,o,!1);if(a)return a}return[0,o]}function Pv(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 ja=128;function Ak(){const s=[],e=[];for(let t=0;t<=ja;t++)e[t]=0;for(let t=0;t<=ja;t++)s.push(e.slice(0));return s}function KP(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const qP=KP(2*ja),Qy=KP(2*ja),Rr=Ak(),jl=Ak(),Vm=Ak();function Hm(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!!Pf(t)}}function cT(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function B_(s,e,t){return e[s]!==t[s]}function LK(s,e,t,i,n,o,r=!1){for(;e<t&&n<o;)s[e]===i[n]&&(r&&(qP[e]=n),e+=1),n+=1;return e===t}var _o;(function(s){s.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}s.isDefault=e})(_o||(_o={}));function cu(s,e,t,i,n,o,r){const a=s.length>ja?ja:s.length,l=i.length>ja?ja:i.length;if(t>=a||o>=l||a-t>l-o||!LK(e,t,a,n,o,l,!0))return;DK(a,l,t,o,e,n);let d=1,h=1,c=t,u=o;const f=[!1];for(d=1,c=t;c<a;d++,c++){const b=qP[c],v=Qy[c],w=c+1<a?Qy[c+1]:l;for(h=b-o+1,u=b;u<w;h++,u++){let y=Number.MIN_SAFE_INTEGER,k=!1;u<=v&&(y=xK(s,e,c,t,i,n,u,l,o,Rr[d-1][h-1]===0,f));let L=0;y!==Number.MAX_SAFE_INTEGER&&(k=!0,L=y+jl[d-1][h-1]);const D=u>b,N=D?jl[d][h-1]+(Rr[d][h-1]>0?-5:0):0,B=u>b+1&&Rr[d][h-1]>0,O=B?jl[d][h-2]+(Rr[d][h-2]>0?-5:0):0;if(B&&(!D||O>=N)&&(!k||O>=L))jl[d][h]=O,Vm[d][h]=3,Rr[d][h]=0;else if(D&&(!k||N>=L))jl[d][h]=N,Vm[d][h]=2,Rr[d][h]=0;else if(k)jl[d][h]=L,Vm[d][h]=1,Rr[d][h]=Rr[d-1][h-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r)return;d--,h--;const g=[jl[d][h],o];let m=0,_=0;for(;d>=1;){let b=h;do{const v=Vm[d][b];if(v===3)b=b-2;else if(v===2)b=b-1;else break}while(b>=1);m>1&&e[t+d-1]===n[o+h-1]&&!B_(b+o-1,i,n)&&m+1>Rr[d][b]&&(b=h),b===h?m++:m=1,_||(_=b),d--,h=b-1,g.push(h)}l===a&&(g[0]+=2);const C=_-a;return g[0]-=C,g}function DK(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(Qy[r]=a,r--),a--}function xK(s,e,t,i,n,o,r,a,l,d,h){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===t-i?c=s[t]===n[r]?7:5:B_(r,n,o)&&(r===0||!B_(r-1,n,o))?(c=s[t]===n[r]?7:5,u=!0):Hm(o,r)&&(r===0||!Hm(o,r-1))?c=5:(Hm(o,r-1)||cT(o,r-1))&&(c=5,u=!0),c>1&&t===i&&(h[0]=!0),u||(u=B_(r,n,o)||Hm(o,r-1)||cT(o,r-1)),t===i?r>l&&(c-=u?3:5):d?c+=u?2:0:c+=u?0:1,r+1===a&&(c-=u?3:5),c}function kK(s,e,t,i,n,o,r){return IK(s,e,t,i,n,o,!0,r)}function IK(s,e,t,i,n,o,r,a){let l=cu(s,e,t,i,n,o,a);if(l&&!r)return l;if(s.length>=3){const d=Math.min(7,s.length-1);for(let h=t+1;h<d;h++){const c=EK(s,h);if(c){const u=cu(c,c.toLowerCase(),t,i,n,o,a);u&&(u[0]-=3,(!l||u[0]>l[0])&&(l=u))}}}return l}function EK(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 ag="$(",Rk=new RegExp(`\\$\\(${En.iconNameExpression}(?:${En.iconModifierExpression})?\\)`,"g"),NK=new RegExp(`(\\\\)?${Rk.source}`,"g");function TK(s){return s.replace(NK,(e,t)=>t?e:`\\${e}`)}const AK=new RegExp(`\\\\${Rk.source}`,"g");function RK(s){return s.replace(AK,e=>`\\${e}`)}const MK=new RegExp(`(\\s)?(\\\\)?${Rk.source}(\\s)?`,"g");function GP(s){return s.indexOf(ag)===-1?s:s.replace(MK,(e,t,i,n)=>i?e:t||n||"")}function zm(s){const e=s.indexOf(ag);return e===-1?{text:s}:OK(s,e)}function OK(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,h=e;const c=s.length;for(n(s.substr(0,e));h<c;){if(l=s[h],d=s[h+1],l===ag[0]&&d===ag[1])o=h,n(r),r=ag,h++;else if(l===")"&&o!==-1){const u=h-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);h++}return n(r),{text:i,iconOffsets:t}}function Um(s,e,t=!1){const{text:i,iconOffsets:n}=e;if(!n||n.length===0)return hT(s,i,t);const o=JD(i," "),r=i.length-o.length,a=hT(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 Jy=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,G0=/(&amp;)?(&amp;)([^\s&])/g,ZP=Zs("menu-selection",ie.check),YP=Zs("menu-submenu",ie.chevronRight);var vC;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(vC||(vC={}));let XP=class Tf extends pa{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,...Me||Cn?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new X),this.initializeStyleSheet(e),this._register(lt.addTarget(n)),q(n,ue.KEY_DOWN,a=>{new Ot(a).equals(2)&&a.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(q(n,ue.KEY_DOWN,a=>{const l=a.key.toLocaleLowerCase();if(this.mnemonics.has(l)){rt.stop(a,!0);const d=this.mnemonics.get(l);if(d.length===1&&(d[0]instanceof uT&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(a)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(l,d)}}})),Cn&&this._register(q(n,ue.KEY_DOWN,a=>{const l=new Ot(a);l.equals(14)||l.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),rt.stop(a,!0)):(l.equals(13)||l.equals(12))&&(this.focusedItem=0,this.focusPrevious(),rt.stop(a,!0))})),this._register(q(this.domNode,ue.MOUSE_OUT,a=>{let l=a.relatedTarget;nr(l,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),a.stopPropagation())})),this._register(q(this.actionsList,ue.MOUSE_OVER,a=>{let l=a.target;if(!(!l||!nr(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()}}})),this._register(lt.addTarget(this.actionsList)),this._register(q(this.actionsList,vt.Tap,a=>{let l=a.initialTarget;if(!(!l||!nr(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 Up(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(q(n,vt.Change,a=>{rt.stop(a,!0);const l=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:l-a.translationY})})),this._register(q(r,ue.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 Z0)).forEach((a,l,d)=>{a.updatePositionInSet(l+1,d.length)})}initializeStyleSheet(e){GC(e)?(this.styleSheet=Yn(e),this.styleSheet.textContent=fT):(Tf.globalStyleSheet||(Tf.globalStyleSheet=Yn(),Tf.globalStyleSheet.textContent=fT),this.styleSheet=Tf.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 eL||a instanceof Z0)&&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 $s)return new Z0(t.context,e,{icon:!0});if(e instanceof Cv){const n=new uT(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 eL(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 eL extends Ad{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=Jy.exec(n);o&&(this.mnemonic=(o[1]?o[1]:o[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new Lt(()=>{this.element&&(this._register(q(this.element,ue.MOUSE_UP,n=>{if(rt.stop(n,!0),rn){if(new cs(n).rightButton)return;this.onClick(n)}else setTimeout(()=>{this.onClick(n)},0)})),this._register(q(this.element,ue.CONTEXT_MENU,n=>{rt.stop(n,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=U(this.element,Y("a.action-menu-item")),this._action.id===$s.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=U(this.item,Y("span.menu-item-check"+ZP.cssSelector)),this.check.setAttribute("role","none"),this.label=U(this.item,Y("span.action-label")),this.options.label&&this.options.keybinding&&(U(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){Li(this.label);let e=GP(this.getAction().label);if(e){const t=PK(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=Jy.exec(e);if(i){e=QD(e),G0.lastIndex=0;let n=G0.exec(e);for(;n&&n[1];)n=G0.exec(e);const o=r=>r.replace(/&amp;&amp;/g,"&amp;");n?this.label.append(JD(o(e.substr(0,n.index))," "),Y("u",{"aria-hidden":"true"},n[3]),tM(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({key:"titleLabel",comment:["action title","action keybinding"]},"{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(){if(!this.item)return;const e=this.getAction().checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){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 uT extends eL{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:vC.Right,this.showScheduler=new Lt(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Lt(()=>{this.element&&!nr(Ac(),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=U(this.item,Y("span.submenu-indicator"+YP.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(q(this.element,ue.KEY_UP,t=>{let i=new Ot(t);(i.equals(17)||i.equals(3))&&(rt.stop(t,!0),this.createSubmenu(!0))})),this._register(q(this.element,ue.KEY_DOWN,t=>{let i=new Ot(t);Ac()===this.item&&(i.equals(17)||i.equals(3))&&rt.stop(t,!0)})),this._register(q(this.element,ue.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(q(this.element,ue.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(q(this.element,ue.FOCUS_OUT,t=>{this.element&&!nr(Ac(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){rt.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=yc(e.width,t.width,{position:n===vC.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=yc(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=U(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 XP(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new vv],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 _t(window.innerWidth,window.innerHeight),_t.lift(r),o,this.expandDirection);this.submenuContainer.style.left=`${l-r.left}px`,this.submenuContainer.style.top=`${a-r.top}px`,this.submenuDisposables.add(q(this.submenuContainer,ue.KEY_UP,d=>{new Ot(d).equals(15)&&(rt.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(q(this.submenuContainer,ue.KEY_DOWN,d=>{new Ot(d).equals(15)&&rt.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 Z0 extends Yg{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function PK(s){const e=Jy,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}let fT=`
  176. .monaco-menu {
  177. font-size: 13px;
  178. }
  179. ${lT(ZP)}
  180. ${lT(YP)}
  181. .monaco-menu .monaco-action-bar {
  182. text-align: right;
  183. overflow: hidden;
  184. white-space: nowrap;
  185. }
  186. .monaco-menu .monaco-action-bar .actions-container {
  187. display: flex;
  188. margin: 0 auto;
  189. padding: 0;
  190. width: 100%;
  191. justify-content: flex-end;
  192. }
  193. .monaco-menu .monaco-action-bar.vertical .actions-container {
  194. display: inline-block;
  195. }
  196. .monaco-menu .monaco-action-bar.reverse .actions-container {
  197. flex-direction: row-reverse;
  198. }
  199. .monaco-menu .monaco-action-bar .action-item {
  200. cursor: pointer;
  201. display: inline-block;
  202. transition: transform 50ms ease;
  203. position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
  204. }
  205. .monaco-menu .monaco-action-bar .action-item.disabled {
  206. cursor: default;
  207. }
  208. .monaco-menu .monaco-action-bar.animated .action-item.active {
  209. transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
  210. }
  211. .monaco-menu .monaco-action-bar .action-item .icon,
  212. .monaco-menu .monaco-action-bar .action-item .codicon {
  213. display: inline-block;
  214. }
  215. .monaco-menu .monaco-action-bar .action-item .codicon {
  216. display: flex;
  217. align-items: center;
  218. }
  219. .monaco-menu .monaco-action-bar .action-label {
  220. font-size: 11px;
  221. margin-right: 4px;
  222. }
  223. .monaco-menu .monaco-action-bar .action-item.disabled .action-label,
  224. .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
  225. opacity: 0.4;
  226. }
  227. /* Vertical actions */
  228. .monaco-menu .monaco-action-bar.vertical {
  229. text-align: left;
  230. }
  231. .monaco-menu .monaco-action-bar.vertical .action-item {
  232. display: block;
  233. }
  234. .monaco-menu .monaco-action-bar.vertical .action-label.separator {
  235. display: block;
  236. border-bottom: 1px solid #bbb;
  237. padding-top: 1px;
  238. margin-left: .8em;
  239. margin-right: .8em;
  240. }
  241. .monaco-menu .secondary-actions .monaco-action-bar .action-label {
  242. margin-left: 6px;
  243. }
  244. /* Action Items */
  245. .monaco-menu .monaco-action-bar .action-item.select-container {
  246. overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
  247. flex: 1;
  248. max-width: 170px;
  249. min-width: 60px;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. margin-right: 10px;
  254. }
  255. .monaco-menu .monaco-action-bar.vertical {
  256. margin-left: 0;
  257. overflow: visible;
  258. }
  259. .monaco-menu .monaco-action-bar.vertical .actions-container {
  260. display: block;
  261. }
  262. .monaco-menu .monaco-action-bar.vertical .action-item {
  263. padding: 0;
  264. transform: none;
  265. display: flex;
  266. }
  267. .monaco-menu .monaco-action-bar.vertical .action-item.active {
  268. transform: none;
  269. }
  270. .monaco-menu .monaco-action-bar.vertical .action-menu-item {
  271. flex: 1 1 auto;
  272. display: flex;
  273. height: 2em;
  274. align-items: center;
  275. position: relative;
  276. }
  277. .monaco-menu .monaco-action-bar.vertical .action-label {
  278. flex: 1 1 auto;
  279. text-decoration: none;
  280. padding: 0 1em;
  281. background: none;
  282. font-size: 12px;
  283. line-height: 1;
  284. }
  285. .monaco-menu .monaco-action-bar.vertical .keybinding,
  286. .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
  287. display: inline-block;
  288. flex: 2 1 auto;
  289. padding: 0 1em;
  290. text-align: right;
  291. font-size: 12px;
  292. line-height: 1;
  293. }
  294. .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
  295. height: 100%;
  296. }
  297. .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
  298. font-size: 16px !important;
  299. display: flex;
  300. align-items: center;
  301. }
  302. .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
  303. margin-left: auto;
  304. margin-right: -20px;
  305. }
  306. .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
  307. .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
  308. opacity: 0.4;
  309. }
  310. .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
  311. display: inline-block;
  312. box-sizing: border-box;
  313. margin: 0;
  314. }
  315. .monaco-menu .monaco-action-bar.vertical .action-item {
  316. position: static;
  317. overflow: visible;
  318. }
  319. .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
  320. position: absolute;
  321. }
  322. .monaco-menu .monaco-action-bar.vertical .action-label.separator {
  323. padding: 0.5em 0 0 0;
  324. margin-bottom: 0.5em;
  325. width: 100%;
  326. height: 0px !important;
  327. margin-left: .8em !important;
  328. margin-right: .8em !important;
  329. }
  330. .monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
  331. padding: 0.7em 1em 0.1em 1em;
  332. font-weight: bold;
  333. opacity: 1;
  334. }
  335. .monaco-menu .monaco-action-bar.vertical .action-label:hover {
  336. color: inherit;
  337. }
  338. .monaco-menu .monaco-action-bar.vertical .menu-item-check {
  339. position: absolute;
  340. visibility: hidden;
  341. width: 1em;
  342. height: 100%;
  343. }
  344. .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
  345. visibility: visible;
  346. display: flex;
  347. align-items: center;
  348. justify-content: center;
  349. }
  350. /* Context Menu */
  351. .context-view.monaco-menu-container {
  352. outline: 0;
  353. border: none;
  354. animation: fadeIn 0.083s linear;
  355. -webkit-app-region: no-drag;
  356. }
  357. .context-view.monaco-menu-container :focus,
  358. .context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
  359. .context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
  360. outline: 0;
  361. }
  362. .monaco-menu .monaco-action-bar.vertical .action-item {
  363. border: thin solid transparent; /* prevents jumping behaviour on hover or focus */
  364. }
  365. /* High Contrast Theming */
  366. :host-context(.hc-black) .context-view.monaco-menu-container {
  367. box-shadow: none;
  368. }
  369. :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
  370. background: none;
  371. }
  372. /* Vertical Action Bar Styles */
  373. .monaco-menu .monaco-action-bar.vertical {
  374. padding: .5em 0;
  375. }
  376. .monaco-menu .monaco-action-bar.vertical .action-menu-item {
  377. height: 1.8em;
  378. }
  379. .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
  380. .monaco-menu .monaco-action-bar.vertical .keybinding {
  381. font-size: inherit;
  382. padding: 0 2em;
  383. }
  384. .monaco-menu .monaco-action-bar.vertical .menu-item-check {
  385. font-size: inherit;
  386. width: 2em;
  387. }
  388. .monaco-menu .monaco-action-bar.vertical .action-label.separator {
  389. font-size: inherit;
  390. padding: 0.2em 0 0 0;
  391. margin-bottom: 0.2em;
  392. }
  393. :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
  394. margin-left: 0;
  395. margin-right: 0;
  396. }
  397. .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
  398. font-size: 60%;
  399. padding: 0 1.8em;
  400. }
  401. :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
  402. height: 100%;
  403. mask-size: 10px 10px;
  404. -webkit-mask-size: 10px 10px;
  405. }
  406. .monaco-menu .action-item {
  407. cursor: default;
  408. }
  409. /* Arrows */
  410. .monaco-scrollable-element > .scrollbar > .scra {
  411. cursor: pointer;
  412. font-size: 11px !important;
  413. }
  414. .monaco-scrollable-element > .visible {
  415. opacity: 1;
  416. /* Background rule added for IE9 - to allow clicks on dom node */
  417. background:rgba(0,0,0,0);
  418. transition: opacity 100ms linear;
  419. }
  420. .monaco-scrollable-element > .invisible {
  421. opacity: 0;
  422. pointer-events: none;
  423. }
  424. .monaco-scrollable-element > .invisible.fade {
  425. transition: opacity 800ms linear;
  426. }
  427. /* Scrollable Content Inset Shadow */
  428. .monaco-scrollable-element > .shadow {
  429. position: absolute;
  430. display: none;
  431. }
  432. .monaco-scrollable-element > .shadow.top {
  433. display: block;
  434. top: 0;
  435. left: 3px;
  436. height: 3px;
  437. width: 100%;
  438. box-shadow: #DDD 0 6px 6px -6px inset;
  439. }
  440. .monaco-scrollable-element > .shadow.left {
  441. display: block;
  442. top: 3px;
  443. left: 0;
  444. height: 100%;
  445. width: 3px;
  446. box-shadow: #DDD 6px 0 6px -6px inset;
  447. }
  448. .monaco-scrollable-element > .shadow.top-left-corner {
  449. display: block;
  450. top: 0;
  451. left: 0;
  452. height: 3px;
  453. width: 3px;
  454. }
  455. .monaco-scrollable-element > .shadow.top.left {
  456. box-shadow: #DDD 6px 6px 6px -6px inset;
  457. }
  458. /* ---------- Default Style ---------- */
  459. :host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {
  460. background: rgba(100, 100, 100, .4);
  461. }
  462. :host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {
  463. background: rgba(121, 121, 121, .4);
  464. }
  465. :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {
  466. background: rgba(111, 195, 223, .6);
  467. }
  468. .monaco-scrollable-element > .scrollbar > .slider:hover {
  469. background: rgba(100, 100, 100, .7);
  470. }
  471. :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {
  472. background: rgba(111, 195, 223, .8);
  473. }
  474. .monaco-scrollable-element > .scrollbar > .slider.active {
  475. background: rgba(0, 0, 0, .6);
  476. }
  477. :host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {
  478. background: rgba(191, 191, 191, .4);
  479. }
  480. :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {
  481. background: rgba(111, 195, 223, 1);
  482. }
  483. :host-context(.vs-dark) .monaco-scrollable-element .shadow.top {
  484. box-shadow: none;
  485. }
  486. :host-context(.vs-dark) .monaco-scrollable-element .shadow.left {
  487. box-shadow: #000 6px 0 6px -6px inset;
  488. }
  489. :host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {
  490. box-shadow: #000 6px 6px 6px -6px inset;
  491. }
  492. :host-context(.hc-black) .monaco-scrollable-element .shadow.top {
  493. box-shadow: none;
  494. }
  495. :host-context(.hc-black) .monaco-scrollable-element .shadow.left {
  496. box-shadow: none;
  497. }
  498. :host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {
  499. box-shadow: none;
  500. }
  501. `;function io(s,e){const t=Object.create(null);for(let i in e){const n=e[i];n&&(t[i]=Br(n,s))}return t}function Mk(s,e,t){function i(){const n=io(s.getColorTheme(),e);typeof t=="function"?t(n):t.style(n)}return i(),s.onDidColorThemeChange(i)}function FK(s,e,t){return Mk(e,{badgeBackground:Xf,badgeForeground:Qf,badgeBorder:Zt},s)}function Xd(s,e,t){return Mk(e,Object.assign(Object.assign({},Fv),t||{}),s)}const Fv={listFocusBackground:V9,listFocusForeground:H9,listFocusOutline:z9,listActiveSelectionBackground:il,listActiveSelectionForeground:nl,listActiveSelectionIconForeground:N_,listFocusAndSelectionBackground:il,listFocusAndSelectionForeground:nl,listInactiveSelectionBackground:U9,listInactiveSelectionIconForeground:j9,listInactiveSelectionForeground:$9,listInactiveFocusBackground:K9,listInactiveFocusOutline:q9,listHoverBackground:G9,listHoverForeground:Z9,listDropBackground:Y9,listSelectionOutline:Xi,listHoverOutline:Xi,listFilterWidgetBackground:X9,listFilterWidgetOutline:Q9,listFilterWidgetNoMatchesOutline:J9,listMatchesShadow:fl,treeIndentGuidesStroke:e6,tableColumnsBorder:t6},BK={shadowColor:fl,borderColor:i6,foregroundColor:n6,backgroundColor:s6,selectionForegroundColor:o6,selectionBackgroundColor:r6,selectionBorderColor:a6,separatorColor:l6};function WK(s,e,t){return Mk(e,Object.assign(Object.assign({},BK),t),s)}class VK{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=XR(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",q(this.block,ue.MOUSE_DOWN,d=>d.stopPropagation()));const a=new X,l=e.actionRunner||new iu;return l.onBeforeRun(this.onActionRun,this,a),l.onDidRun(this.onDidActionRun,this,a),i=new XP(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(WK(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(q(window,ue.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(q(window,ue.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;let h=new cs(d),c=h.target;if(!h.rightButton){for(;c;){if(c===o)return;c=c.parentElement}this.contextViewService.hideContextView(!0)}})),Za(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&&!br(e.error)&&this.notificationService.error(e.error)}}var HK=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},gf=function(s,e){return function(t,i){e(t,i,s)}};let tL=class extends H{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new VK(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),cd.getInstance().resetKeyStatus()}};tL=HK([gf(0,El),gf(1,ni),gf(2,Nl),gf(3,Nt),gf(4,Dt)],tL);const Bv=Je("layoutService");var zK=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},UK=function(s,e){return function(t,i){e(t,i,s)}};let iL=class extends H{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=H.None,this.container=e.container,this.contextView=this._register(new hu(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=Ve(()=>{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)}};iL=zK([UK(0,Bv)],iL);const Kp=Je("dialogService");let $K=class{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}};class jK{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 $K(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(`
  502. `)}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 gT 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:
  503. ${e.toString()}`}}class wC{constructor(e=new qg,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Ge,this)}createChild(e){return new wC(e,this._strict,this)}invokeFunction(e,...t){let i=Ps.traceInvocation(e),n=!1;try{return e({get:(r,a)=>{if(n)throw C5("service accessor is only valid during the invocation of its target method");const l=this._getOrCreateServiceInstance(r,i);if(!l&&a!==U5)throw new Error(`[invokeFunction] unknown service '${r}'`);return l}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof Oa?(i=Ps.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Ps.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=lo.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 Oa)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 Oa?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 jK(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 gT(n);for(let l of lo.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 Oa){const h={id:l.id,desc:d,_trace:a._trace.branch(l.id,!0)};n.insertEdge(a,h),r.push(h)}}}for(;;){const a=n.roots();if(a.length===0){if(!n.isEmpty())throw new gT(n);break}for(const{data:l}of a){if(this._getServiceInstanceOrDescriptor(l.id)instanceof Oa){const h=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setServiceInstance(l.id,h)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof Oa)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 Tc(()=>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 Ps{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return Ps._None}static traceCreation(e){return Ps._None}branch(e,t){let i=new Ps(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;Ps._totals+=e;let t=!1;function i(o,r){let a=[],l=new Array(o+1).join(" ");for(const[d,h,c]of r._dep)if(h&&c){t=!0,a.push(`${l}CREATES -> ${d}`);let u=i(o+1,c);u&&a.push(u)}else a.push(`${l}uses -> ${d}`);return a.join(`
  504. `)}let n=[`${this.type===0?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ps._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join(`
  505. `))}}Ps._None=new class extends Ps{constructor(){super(-1,null)}stop(){}branch(){return this}};Ps._totals=0;const qp=Je("labelService");class KK{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class Kl extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function pT(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=Bi.intersect(s,i.range);Bi.isEmpty(n)||t.push({range:n,size:i.size})}return t}function nL({start:s,end:e},t){return{start:s+t,end:e+t}}function qK(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 GK(...s){return qK(s.reduce((e,t)=>e.concat(t),[]))}class mT{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=pT({start:0,end:e},this.groups),r=pT({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:nL(l.range,n),size:l.size})),a=i.map((l,d)=>({range:{start:e+d,end:e+d+1},size:l.size}));this.groups=GK(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 ZK(s){try{s.parentElement&&s.parentElement.removeChild(s)}catch{}}class YK{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"),ZK(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 Ih=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 Mo={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 Gp{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class XK{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class QK{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 JK(s,e){return Array.isArray(s)&&Array.isArray(e)?zs(s,e):s===e}class eq{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 ko{constructor(e,t,i,n=Mo){if(this.virtualDelegate=t,this.domId=`list_id_${++ko.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ca(50),this.splicing=!1,this.dragOverAnimationStopDisposable=H.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=H.None,this.onDragLeaveTimeout=H.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 mT;for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new YK(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,Mo.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=typeof n.additionalScrollHeight>"u"?0:n.additionalScrollHeight,this.accessibilityProvider=new eq(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",Ro(n,r=>r.transformOptimization,Mo.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(lt.addTarget(this.rowsContainer)),this.scrollable=new Tv(Ro(n,r=>r.smoothScrolling,!1)?125:0,r=>hr(r)),this.scrollableElement=this.disposables.add(new hk(this.rowsContainer,{alwaysConsumeMouseWheel:Ro(n,r=>r.alwaysConsumeMouseWheel,Mo.alwaysConsumeMouseWheel),horizontal:1,vertical:Ro(n,r=>r.verticalScrollMode,Mo.verticalScrollMode),useShadows:Ro(n,r=>r.useShadows,Mo.useShadows),mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(q(this.rowsContainer,vt.Change,r=>this.onTouchChange(r))),this.disposables.add(q(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(q(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(q(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(q(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(q(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=Ro(n,r=>r.setRowLineHeight,Mo.setRowLineHeight),this.setRowHeight=Ro(n,r=>r.setRowHeight,Mo.setRowHeight),this.supportDynamicHeights=Ro(n,r=>r.supportDynamicHeights,Mo.supportDynamicHeights),this.dnd=Ro(n,r=>r.dnd,Mo.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:Hw(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),e.mouseWheelScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}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=Bi.intersect(n,o),a=new Map;for(let k=r.start;k<r.end;k++){const L=this.items[k];if(L.dragStartDisposable.dispose(),L.row){let D=a.get(L.templateId);D||(D=[],a.set(L.templateId,D));const N=this.renderers.get(L.templateId);N&&N.disposeElement&&N.disposeElement(L.element,k,L.row.templateData,L.size),D.push(L.row)}L.row=null}const l={start:e+t,end:this.items.length},d=Bi.intersect(l,n),h=Bi.relativeComplement(l,n),c=i.map(k=>({id:String(this.itemId++),element:k,templateId:this.virtualDelegate.getTemplateId(k),size:this.virtualDelegate.getHeight(k),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(k),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:H.None}));let u;e===0&&t>=this.items.length?(this.rangeMap=new mT,this.rangeMap.splice(0,0,c),u=this.items,this.items=c):(this.rangeMap.splice(e,t,c),u=this.items.splice(e,t,...c));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=nL(d,f),_=Bi.intersect(g,m);for(let k=_.start;k<_.end;k++)this.updateItemInDOM(this.items[k],k);const C=Bi.relativeComplement(m,g);for(const k of C)for(let L=k.start;L<k.end;L++)this.removeItemFromDOM(L);const b=h.map(k=>nL(k,f)),w=[{start:e,end:e+i.length},...b].map(k=>Bi.intersect(g,k)),y=this.getNextToLastElement(w);for(const k of w)for(let L=k.start;L<k.end;L++){const D=this.items[L],N=a.get(D.templateId),B=N==null?void 0:N.pop();this.insertItemInDOM(L,y,B)}for(const k of a.values())for(const L of k)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(k=>k.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=hr(()=>{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:g3(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:Hw(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),l=Bi.relativeComplement(a,e),d=Bi.relativeComplement(e,a),h=this.getNextToLastElement(l);if(r){const c=Bi.intersect(e,a);for(let u=c.start;u<c.end;u++)this.updateItemInDOM(this.items[u],u)}for(const c of l)for(let u=c.start;u<c.end;u++)this.insertItemInDOM(u,h);for(const c of d)for(let u=c.start;u<c.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=q(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=rn?"-moz-fit-content":"fit-content",e.width=Hw(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("data-parity",t%2===0?"even":"odd"),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 he.map(this.disposables.add(new mt(this.domNode,"click")).event,e=>this.toMouseEvent(e))}get onMouseDblClick(){return he.map(this.disposables.add(new mt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return he.filter(he.map(this.disposables.add(new mt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e)),e=>e.browserEvent.button===1)}get onMouseDown(){return he.map(this.disposables.add(new mt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e))}get onContextMenu(){return he.any(he.map(this.disposables.add(new mt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e)),he.map(this.disposables.add(new mt(this.domNode,vt.Contextmenu)).event,e=>this.toGestureEvent(e)))}get onTouchStart(){return he.map(this.disposables.add(new mt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e))}get onTap(){return he.map(this.disposables.add(new mt(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(SP.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 Gp(n),Wr.CurrentDragAndDropData=new XK(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Wr.CurrentDragAndDropData&&Wr.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Wr.CurrentDragAndDropData)this.currentDragData=Wr.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new QK}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=Tb(i).filter(n=>n>=-1&&n<this.length).sort((n,o)=>n-o),i=i[0]===-1?[-1]:i,JK(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=Ve(()=>{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=Ve(()=>{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=Bd(()=>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,Wr.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,Wr.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=H.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=qR(this.domNode).top;this.dragOverAnimationDisposable=S3(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Bd(()=>{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 h=l.start;h<l.end;h++){const c=this.probeDynamicHeight(h);c!==0&&this.rangeMap.splice(h,1,[this.items[h]]),a+=c,d=d||c!==0}if(!d){a!==0&&this.eventuallyUpdateScrollDimensions();const h=Bi.relativeComplement(n,l);for(const u of h)for(let f=u.start;f<u.end;f++)this.items[f].row&&this.removeItemFromDOM(f);const c=Bi.relativeComplement(l,n);for(const u of c)for(let f=u.start;f<u.end;f++){const g=f+1,m=g<this.items.length?this.items[g].row:null,_=m?m.domNode:null;this.insertItemInDOM(f,_)}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(this.virtualDelegate.getDynamicHeight){const r=this.virtualDelegate.getDynamicHeight(t.element);if(r!==null){const a=t.size;return t.size=r,t.lastDynamicHeightWidth=this.renderWidth,r-a}}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),qe(this.disposables)}}ko.InstanceCount=0;Ih([si],ko.prototype,"onMouseClick",null);Ih([si],ko.prototype,"onMouseDblClick",null);Ih([si],ko.prototype,"onMouseMiddleClick",null);Ih([si],ko.prototype,"onMouseDown",null);Ih([si],ko.prototype,"onContextMenu",null);Ih([si],ko.prototype,"onTouchStart",null);Ih([si],ko.prototype,"onTap",null);var Eh=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,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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class tq{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 SC=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 tq(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,h)=>d?h+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(h=>h>=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(CT),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=sL(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return mx(this.sortedIndexes,e,CT)>=0}dispose(){qe(this._onChange)}};Eh([si],SC.prototype,"renderer",null);class iq extends SC{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 Y0{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 _l(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function Lc(s){return s.classList.contains("monaco-editor")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:Lc(s.parentElement)}class QP{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!==!1&&this.onKeyDown.filter(n=>(Me?n.metaKey:n.ctrlKey)&&n.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return he.chain(this.disposables.add(new mt(this.view.domNode,"keydown")).event).filter(e=>!_l(e.target)).map(e=>new Ot(e))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter(t=>(Me?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);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(tn(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Eh([si],QP.prototype,"onKeyDown",null);var Dc;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(Dc||(Dc={}));const JP=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 nq{constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=Dc.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=he.chain(this.enabledDisposables.add(new mt(this.view.domNode,"keydown")).event).filter(n=>!_l(n.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(n=>new Ot(n)).filter(n=>this.delegate.mightProducePrintableCharacter(n)).forEach(n=>{n.stopPropagation(),n.preventDefault()}).map(n=>n.browserEvent.key).event,t=he.debounce(e,()=>null,800);he.reduce(he.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&&Ei(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Dc.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===Dc.Idle?1:0;this.state=Dc.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"||Mv(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class sq{constructor(e,t){this.list=e,this.view=t,this.disposables=new X,he.chain(this.disposables.add(new mt(t.domNode,"keydown")).event).filter(n=>!_l(n.target)).map(n=>new Ot(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 e2(s){return Me?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function t2(s){return s.browserEvent.shiftKey}function oq(s){return s instanceof MouseEvent&&s.button===2}const bT={isSelectionSingleChangeEvent:e2,isSelectionRangeChangeEvent:t2};class i2{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||bT),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(lt.addTarget(e.getHTMLElement()))),he.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||bT))}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){Lc(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Lc(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||_l(e.browserEvent.target)||Lc(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),oq(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(_l(e.browserEvent.target)||Lc(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 h=this.list.getFocus()[0];i=h??t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),r=tn(n,o+1),a=this.list.getSelection(),l=lq(sL(a,[i]),i);if(l.length===0)return;const d=sL(r,dq(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 n2{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}; }`):Me||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(`
  506. .monaco-drag-image,
  507. .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
  508. `),e.listFocusAndSelectionForeground&&i.push(`
  509. .monaco-drag-image,
  510. .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
  511. `),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(`
  512. .monaco-drag-image,
  513. .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
  514. `),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(`
  515. .monaco-list${t}.drop-target,
  516. .monaco-list${t} .monaco-list-rows.drop-target,
  517. .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
  518. `),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(`
  519. .monaco-table:hover > .monaco-split-view2,
  520. .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
  521. border-color: ${e.tableColumnsBorder};
  522. }`),this.styleElement.textContent=i.join(`
  523. `)}}const rq={listFocusBackground:W.fromHex("#7FB0D0"),listActiveSelectionBackground:W.fromHex("#0E639C"),listActiveSelectionForeground:W.fromHex("#FFFFFF"),listActiveSelectionIconForeground:W.fromHex("#FFFFFF"),listFocusAndSelectionBackground:W.fromHex("#094771"),listFocusAndSelectionForeground:W.fromHex("#FFFFFF"),listInactiveSelectionBackground:W.fromHex("#3F3F46"),listInactiveSelectionIconForeground:W.fromHex("#FFFFFF"),listHoverBackground:W.fromHex("#2A2D2E"),listDropBackground:W.fromHex("#383B3D"),treeIndentGuidesStroke:W.fromHex("#a9a9a9"),tableColumnsBorder:W.fromHex("#cccccc").transparent(.2)},aq={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function lq(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 sL(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 dq(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 CT=(s,e)=>s-e;class hq{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 cq{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 uq{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 wr{constructor(e,t,i,n,o=aq){var r;this.user=e,this._options=o,this.focus=new SC("focused"),this.anchor=new SC("anchor"),this.eventBufferer=new HD,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 iq(a!=="listbox"),xo(o,rq,!1);const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(l.push(new cq(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(h=>new hq(h.templateId,[...l,h]));const d=Object.assign(Object.assign({},o),{dnd:o.dnd&&new uq(this,o.dnd)});if(this.view=new ko(t,i,n,d),this.view.domNode.setAttribute("role",a),o.styleController)this.styleController=o.styleController(this.view.domId);else{const h=Yn(this.view.domNode);this.styleController=new n2(h,this.view.domId)}if(this.spliceable=new KK([new Y0(this.focus,this.view,o.identityProvider),new Y0(this.selection,this.view,o.identityProvider),new Y0(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 sq(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new QP(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const h=o.keyboardNavigationDelegate||JP;this.typeLabelController=new nq(this,this.view,o.keyboardNavigationLabelProvider,h),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!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return he.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return he.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=he.chain(this.disposables.add(new mt(this.view.domNode,"keydown")).event).map(o=>new Ot(o)).filter(o=>e=o.keyCode===58||o.shiftKey&&o.keyCode===68).map(GN).filter(()=>!1).event,i=he.chain(this.disposables.add(new mt(this.view.domNode,"keyup")).event).forEach(()=>e=!1).map(o=>new Ot(o)).filter(o=>o.keyCode===58||o.shiftKey&&o.keyCode===68).map(GN).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=he.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 he.any(t,i,n)}get onKeyDown(){return this.disposables.add(new mt(this.view.domNode,"keydown")).event}get onDidFocus(){return he.signal(this.disposables.add(new mt(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new i2(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 Kl(this.user,`Invalid start index: ${e}`);if(t<0)throw new Kl(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 Kl(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 Kl(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return ay(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 Kl(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 _T(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 rl(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return _T(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 rl(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 Kl(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(Wd(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*As(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 Kl(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()}}Eh([si],wr.prototype,"onDidChangeFocus",null);Eh([si],wr.prototype,"onDidChangeSelection",null);Eh([si],wr.prototype,"onContextMenu",null);Eh([si],wr.prototype,"onKeyDown",null);Eh([si],wr.prototype,"onDidFocus",null);class fq{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:H.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 ln,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 gq{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 pq(s,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new gq(s,e.accessibilityProvider)})}class mq{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(l=>new fq(l,r));this.list=new wr(e,t,i,a,pq(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 he.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 he.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 he.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,tn(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 _q={separatorBorder:W.transparent};class s2{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=As(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 bq extends s2{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Cq extends s2{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Vr;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Vr||(Vr={}));var yC;(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})(yC||(yC={}));class o2 extends H{constructor(e,t={}){var i,n;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Vr.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=sn(t.orientation)?0:t.orientation,this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=sn(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=U(this.el,Y(".sash-container")),this.viewContainer=Y(".split-view-container"),this.scrollable=new Tv(125,hr),this.scrollableElement=this._register(new hk(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})),U(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||_q),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((o,r)=>{const a=sn(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=As(Math.round(this.proportions[n]*e),o.minimumSize,o.maximumSize)}else{const n=tn(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=Za(q(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),q(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const d=this.viewItems.map(g=>g.size);let h=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const m=this.viewItems[n];h=(m.minimumSize-m.size)/2,c=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];h=(m.size-m.maximumSize)/2,c=(m.size-m.minimumSize)/2}let u,f;if(!l){const g=tn(n,-1),m=tn(n+1,this.viewItems.length),_=g.reduce((D,N)=>D+(this.viewItems[N].minimumSize-d[N]),0),C=g.reduce((D,N)=>D+(this.viewItems[N].viewMaximumSize-d[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((D,N)=>D+(d[N]-this.viewItems[N].minimumSize),0),v=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((D,N)=>D+(d[N]-this.viewItems[N].viewMaximumSize),0),w=Math.max(_,v),y=Math.min(b,C),k=this.findFirstSnapIndex(g),L=this.findFirstSnapIndex(m);if(typeof k=="number"){const D=this.viewItems[k],N=Math.floor(D.viewMinimumSize/2);u={index:k,limitDelta:D.visible?w-N:w+N,size:D.size}}if(typeof L=="number"){const D=this.viewItems[L],N=Math.floor(D.viewMinimumSize/2);f={index:L,limitDelta:D.visible?y+N:y-N,size:D.size}}}this.sashDragState={start:a,current:a,index:n,sizes:d,minDelta:h,maxDelta:c,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 h=e-i,c=this.resize(t,h,n,void 0,void 0,r,a,l,d);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(v=>v.size),g=u?t:t+1,m=this.viewItems[g],_=m.size-m.maximumSize,C=m.size-m.minimumSize,b=u?t-1:t+1;this.resize(b,-c,f,void 0,void 0,_,C)}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=As(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!==Vr.Idle)throw new Error("Cant modify splitview");if(this.state=Vr.Busy,e<0||e>=this.viewItems.length)return;const i=tn(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=As(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o),this.state=Vr.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=As(i,a.minimumSize,a.maximumSize);const n=tn(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!==Vr.Idle)throw new Error("Cant modify splitview");this.state=Vr.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(h,u)),a=Ve(()=>this.viewContainer.removeChild(o)),l=Za(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 h=this.orientation===0?new bq(o,e,d,l):new Cq(o,e,d,l);if(this.viewItems.splice(i,0,h),this.viewItems.length>1){let u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const f=this.orientation===0?new Wi(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},u),{orientation:1})):new Wi(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},u),{orientation:0})),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=he.map(f.onDidStart,g)(this.onSashStart,this),b=he.map(f.onDidChange,g)(this.onSashChange,this),w=he.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),y=f.onDidReset(()=>{const D=this.sashItems.findIndex(K=>K.sash===f),N=tn(D,-1),B=tn(D+1,this.viewItems.length),O=this.findFirstSnapIndex(N),$=this.findFirstSnapIndex(B);typeof O=="number"&&!this.viewItems[O].visible||typeof $=="number"&&!this.viewItems[$].visible||this._onDidSashReset.fire(D)}),k=Za(_,b,w,y,f),L={sash:f,disposable:k};this.sashItems.splice(i-1,0,L)}o.appendChild(e.element);let c;typeof t!="number"&&t.type==="split"&&(c=[t.index]),n||this.relayout([i],c),this.state=Vr.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(h=>h.size),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,d){if(e<0||e>=this.viewItems.length)return 0;const h=tn(e,-1),c=tn(e+1,this.viewItems.length);if(o)for(const L of o)s0(h,L),s0(c,L);if(n)for(const L of n)vm(h,L),vm(c,L);const u=h.map(L=>this.viewItems[L]),f=h.map(L=>i[L]),g=c.map(L=>this.viewItems[L]),m=c.map(L=>i[L]),_=h.reduce((L,D)=>L+(this.viewItems[D].minimumSize-i[D]),0),C=h.reduce((L,D)=>L+(this.viewItems[D].maximumSize-i[D]),0),b=c.length===0?Number.POSITIVE_INFINITY:c.reduce((L,D)=>L+(i[D]-this.viewItems[D].minimumSize),0),v=c.length===0?Number.NEGATIVE_INFINITY:c.reduce((L,D)=>L+(i[D]-this.viewItems[D].maximumSize),0),w=Math.max(_,v,r),y=Math.min(b,C,a);let k=!1;if(l){const L=this.viewItems[l.index],D=t>=l.limitDelta;k=D!==L.visible,L.setVisible(D,l.size)}if(!k&&d){const L=this.viewItems[d.index],D=t<d.limitDelta;k=D!==L.visible,L.setVisible(D,d.size)}if(k)return this.resize(e,t,i,n,o,r,a);t=As(t,w,y);for(let L=0,D=t;L<u.length;L++){const N=u[L],B=As(f[L]+D,N.minimumSize,N.maximumSize),O=B-f[L];D-=O,N.size=B}for(let L=0,D=t;L<g.length;L++){const N=g[L],B=As(m[L]-D,N.minimumSize,N.maximumSize),O=B-m[L];D+=O,N.size=B}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const n=tn(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)s0(n,a);for(const a of o)vm(n,a);typeof e=="number"&&vm(n,e);for(let a=0;i!==0&&a<n.length;a++){const l=this.viewItems[n[a]],d=As(l.size+i,l.minimumSize,l.maximumSize),h=d-l.size;i-=h,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],h=this.viewItems[l];a+=h.size;const c=!(t[l]&&r[l+1]),u=!(i[l]&&o[l+1]);if(c&&u){const f=tn(l,-1),g=tn(l+1,this.viewItems.length),m=this.findFirstSnapIndex(f),_=this.findFirstSnapIndex(g),C=typeof m=="number"&&!this.viewItems[m].visible,b=typeof _=="number"&&!this.viewItems[_].visible;C&&o[l]&&(a>0||this.startSnappingEnabled)?d.state=1:b&&t[l]&&(a<this.contentSize||this.endSnappingEnabled)?d.state=2:d.state=0}else c&&!u?d.state=1:!c&&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 Zp{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Zp.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=U(e,Y(".monaco-table-tr")),i=[],n=[];for(let r=0;r<this.columns.length;r++){const a=this.renderers[r],l=U(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]);Li(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}Zp.TemplateId="row";function vq(s){return{getHeight(e){return s.getHeight(e)},getTemplateId(){return Zp.TemplateId}}}class wq{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:he.None}layout(e){this._onDidLayout.fire([this.index,e])}}class Wv{constructor(e,t,i,n,o,r){this.virtualDelegate=i,this.domId=`table_id_${++Wv.InstanceCount}`,this.cachedHeight=0,this.domNode=U(t,Y(`.monaco-table.${this.domId}`));const a=n.map((h,c)=>new wq(h,c)),l={size:a.reduce((h,c)=>h+c.column.weight,0),views:a.map(h=>({size:h.column.weight,view:h}))};this.splitview=new o2(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 Zp(n,o,h=>this.splitview.getViewSize(h));this.list=new wr(e,this.domNode,vq(i),[d],r),this.columnLayoutDisposable=he.any(...a.map(h=>h.onDidLayout))(([h,c])=>d.layoutColumn(h,c)),this.styleElement=Yn(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 {
  524. top: ${this.virtualDelegate.headerRowHeight+1}px;
  525. height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
  526. }`),this.styleElement.textContent=t.join(`
  527. `),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()}}Wv.InstanceCount=0;var lg;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element"})(lg||(lg={}));class hs extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class Ok{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 Pk(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function tp(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function X0(s){return typeof s.collapsible=="boolean"}class Sq{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new HD,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=Ue.empty(),n={}){if(e.length===0)throw new hs(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=Ue.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,o);const d=[...n],h=t[t.length-1],c=new Yo({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,h),...d,...l.children.slice(h+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(c.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,d,o);const u=t.slice(0,-1),f=(_,C,b)=>{if(r>0)for(let v=0;v<b;v++)_--,C--,this.spliceSmart(e,[...u,_,0],Number.MAX_SAFE_INTEGER,d[C].children,o,r-1)};let g=Math.min(l.children.length,h+i),m=d.length;for(const _ of c.changes.sort((C,b)=>b.originalStart-C.originalStart))f(g,m,g-(_.originalStart+_.originalLength)),g=_.originalStart,m=_.modifiedStart-h,this.spliceSimple([...u,g],_.originalLength,Ue.slice(d,m,m+_.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=Ue.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:d,visible:h}=this.getParentNodeWithListIndex(e),c=[],u=Ue.map(i,L=>this.createTreeNode(L,a,a.visible?1:0,d,c,n)),f=e[e.length-1],g=a.children.length>0;let m=0;for(let L=f;L>=0&&L<a.children.length;L--){const D=a.children[L];if(D.visible){m=D.visibleChildIndex;break}}const _=[];let C=0,b=0;for(const L of u)_.push(L),b+=L.renderNodeCount,L.visible&&(L.visibleChildIndex=m+C++);const v=EE(a.children,f,t,_);r?a.lastDiffIds?EE(a.lastDiffIds,f,t,_.map(L=>r.getId(L.element).toString())):a.lastDiffIds=a.children.map(L=>r.getId(L.element).toString()):a.lastDiffIds=void 0;let w=0;for(const L of v)L.visible&&w++;if(w!==0)for(let L=f+_.length;L<a.children.length;L++){const D=a.children[L];D.visible&&(D.visibleChildIndex-=w)}if(a.visibleChildrenCount+=C-w,d&&h){const L=v.reduce((D,N)=>D+(N.visible?N.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-L),this.list.splice(l,L,c)}if(v.length>0&&o){const L=D=>{o(D),D.children.forEach(L)};v.forEach(L)}const y=a.children.length>0;g!==y&&this.setCollapsible(e.slice(0,-1),y),this._onDidSplice.fire({insertedNodes:_,deletedNodes:v});let k=a;for(;k;){if(k.visibility===2){this.refilter();break}k=k.parent}}rerender(e){if(e.length===0)throw new hs(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&&!X0(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:(X0(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})),!X0(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||Ue.empty(),h=n&&l!==0&&!a.collapsed,c=Ue.map(d,g=>this.createTreeNode(g,a,l,h,o,r));let u=0,f=1;for(const g of c)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.visibility=o),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):Pk(i)?(e.filterData=i.data,tp(i.visibility)):(e.filterData=void 0,tp(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 hs(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 hs(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 hs(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?[]:XV(e)[0]}}const vT=Zs("tree-item-expanded",ie.chevronDown),wT=Zs("tree-filter-on-type-on",ie.listFilter),ST=Zs("tree-filter-on-type-off",ie.listSelection),yq=Zs("tree-filter-clear",ie.close),LC=Zs("tree-item-loading",ie.loading);class Lq extends Gp{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function Q0(s){return s instanceof Gp?new Lq(s):s}class Dq{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=H.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(Q0(e),t)}onDragOver(e,t,i,n,o=!0){const r=this.dnd.onDragOver(Q0(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=Bd(()=>{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),_=g&&u.getListIndex(g);return this.onDragOver(e,m,_,n,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),c=l.getListRenderCount(d);return Object.assign(Object.assign({},r),{feedback:tn(h,h+c)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Q0(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function xq(s,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Dq(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 Fk{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 ip;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(ip||(ip={}));class kq{constructor(e,t=[]){this._elements=t,this.onDidChange=he.forEach(e,i=>this._elements=i)}get elements(){return this._elements}}class np{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=np.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new BH,this.activeIndentNodes=new Set,this.indentGuidesDisposable=H.None,this.disposables=new X,this.templateId=e.templateId,this.updateOptions(o),he.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=As(e.indent,0,40)),typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==ip.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=U(e,Y(".monaco-tl-row")),i=U(t,Y(".monaco-tl-indent")),n=U(t,Y(".monaco-tl-twistie")),o=U(t,Y(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:H.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=np.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(...vT.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(...vT.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(Li(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(Ve(()=>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(),qe(this.disposables)}}np.DefaultIndent=8;class Iq{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:Pk(o)?r=tp(o.visibility):r=o,r===0)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:_o.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:_o.Default,visibility:!0};const a=cu(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:_o.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){qe(this.disposables)}}class Eq{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(q(this.domNode,"dragstart",()=>this.onDragStart())),this.messageDomNode=U(i.getHTMLElement(),Y(".monaco-list-type-filter-message")),this.labelDomNode=U(this.domNode,Y("span.label"));const r=U(this.domNode,Y(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=U(r,Y("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(q(this.filterOnTypeDomNode,"input",()=>this.onDidChangeFilterOnType())),this.clearDomNode=U(r,Y("button.clear"+yq.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 mt(this.view.getHTMLElement(),"keydown")),t=he.chain(e.event).filter(n=>!_l(n.target)||n.target===this.filterOnTypeDomNode).filter(n=>n.key!=="Dead"&&!/^Media/.test(n.key)).map(n=>new Ot(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&&(Me?n.altKey&&!n.metaKey:n.ctrlKey)&&!n.shiftKey).forEach(n=>{n.stopPropagation(),n.preventDefault()}).event,i=this.enabledDisposables.add(new mt(this.clearDomNode,"click"));he.chain(he.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&&(Me?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=>!_o.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}=Ii(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=c=>{c.preventDefault();const u=c.clientX-t;c.dataTransfer&&(c.dataTransfer.dropEffect="none"),u<n?a="nw":a="ne",l()},h=()=>{this.positionClassName=a,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",qe(r)};l(),this.domNode.classList.remove(a),this.domNode.classList.add("dragging"),r.add(Ve(()=>this.domNode.classList.remove("dragging"))),r.add(q(document,"dragover",c=>d(c))),r.add(q(this.domNode,"dragend",()=>h())),Wr.CurrentDragAndDropData=new q$("vscode-ui"),r.add(Ve(()=>Wr.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(...ST.classNamesArray),this.filterOnTypeDomNode.classList.add(...wT.classNamesArray),this.filterOnTypeDomNode.title=p("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...wT.classNamesArray),this.filterOnTypeDomNode.classList.add(...ST.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:!_o.isDefault(e.filterData)}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),qe(this.disposables)}}function yT(s){let e=lg.Unknown;return YI(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=lg.Twistie:YI(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(e=lg.Element),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function W_(s,e){e(s),s.children.forEach(t=>W_(t,e))}class J0{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)&&zs(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=h=>l.delete(h);t.forEach(h=>W_(h,d)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>W_(l,n));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>W_(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 c=o.get(d);c&&a.push(c)}}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 Nq extends i2{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(_l(e.browserEvent.target)||Lc(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 Tq extends wr{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 Nq(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(Tb([...super.getFocus(),...n])),o.length>0&&super.setSelection(Tb([...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 r2{constructor(e,t,i,n,o={}){this._options=o,this.eventBufferer=new HD,this.disposables=new X,this._onWillRefilter=new M,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new M;const r=new Fk(i),a=new $I,l=new $I,d=new kq(l.event);this.renderers=n.map(u=>new np(u,()=>this.model,a.event,d,o));for(let u of this.renderers)this.disposables.add(u);let h;o.keyboardNavigationLabelProvider&&(h=new Iq(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new J0(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new J0(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new J0(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new Tq(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},xq(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const c=he.forEach(this.model.onDidSplice,u=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(u),this.selection.onDidModelSplice(u)})});if(c(()=>null,null,this.disposables),l.input=he.chain(he.any(c,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=he.chain(this.view.onKeyDown).filter(f=>!_l(f.target)).map(f=>new Ot(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||JP;this.typeFilterController=new Eq(this,this.model,this.view,h,u),this.focusNavigationFilter=f=>this.typeFilterController.shouldAllowFocus(f),this.disposables.add(this.typeFilterController)}this.styleElement=Yn(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===ip.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return he.map(this.view.onMouseDblClick,yT)}get onPointer(){return he.map(this.view.onPointer,yT)}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===ip.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(`
  528. `),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(){qe(this.disposables),this.view.dispose()}}class Bk{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Sq(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=Ue.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ue.empty(),i){const n=new Set,o=new Set,r=l=>{var d;if(l.element===null)return;const h=l;if(n.add(h.element),this.nodes.set(h.element,h),this.identityProvider){const c=this.identityProvider.getId(h.element).toString();o.add(c),this.nodesByIdentity.set(c,h)}(d=i.onDidCreateNode)===null||d===void 0||d.call(i,h)},a=l=>{var d;if(l.element===null)return;const h=l;if(n.has(h.element)||this.nodes.delete(h.element),this.identityProvider){const c=this.identityProvider.getId(h.element).toString();o.has(c)||this.nodesByIdentity.delete(c)}(d=i.onDidDeleteNode)===null||d===void 0||d.call(i,h)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=Ue.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Ue.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 hs(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new hs(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new hs(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 hs(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function V_(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:Ue.map(Ue.from(s.children),V_),collapsible:s.collapsible,collapsed:s.collapsed}}function H_(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=Ue.consume(Ue.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:Ue.map(Ue.concat(n,i),H_),collapsible:s.collapsible,collapsed:s.collapsed}}function oL(s,e=0){let t;return e<s.element.elements.length-1?t=[oL(s,e+1)]:t=Ue.map(Ue.from(s.children),i=>oL(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 LT(s){return oL(s,0)}function a2(s,e,t){return s.element===e?Object.assign(Object.assign({},s),{children:t}):Object.assign(Object.assign({},s),{children:Ue.map(Ue.from(s.children),i=>a2(i,e,t))})}const Aq=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class Rq{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Bk(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=Ue.empty(),i){const n=i.diffIdentityProvider&&Aq(i.diffIdentityProvider);if(e===null){const f=Ue.map(t,this.enabled?H_:V_);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=LT(r),h=a2(d,e,t),c=(this.enabled?H_:V_)(h),u=l.children.map(f=>f===r?c: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=Ue.map(i,LT),o=Ue.map(n,e?H_:V_);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 hs(this.user,`Tree element not found: ${e}`);return t}}const Mq=s=>s[s.length-1];class Wk{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 Wk(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 Oq(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 Pq(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 Fq{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||Mq;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new Ok(o=>new Wk(n,o)),this.model=new Rq(e,Oq(this.nodeMapper,t),Pq(n,i))}get onDidSplice(){return he.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 he.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return he.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=Ue.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 Bq=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 Vk extends r2{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Ue.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 Bk(e,t,i)}}class l2{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}}Bq([si],l2.prototype,"compressedTreeNodeProvider",null);function Wq(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 d2 extends Vk{constructor(e,t,i,n,o={}){const r=()=>this,a=n.map(l=>new l2(r,l));super(e,t,i,a,Wq(r,o))}setChildren(e,t=Ue.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new Fq(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 Ia=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function eS(s){return Object.assign(Object.assign({},s),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function rL(s,e){return e.parent?e.parent===s?!0:rL(s,e.parent):!1}function Vq(s,e){return s===e||rL(s,e)||rL(e,s)}class Hk{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new Hk(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 Hq{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(...LC.classNamesArray),!0):(t.classList.remove(...LC.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 DT(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function xT(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}class zq extends Gp{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function tS(s){return s instanceof Gp?new zq(s):s}class Uq{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(tS(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(tS(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(tS(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function h2(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 Uq(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 aL(s,e){e(s),s.children.forEach(t=>aL(t,e))}class c2{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 Ok(a=>new Hk(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=eS({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 he.map(this.tree.onDidChangeFocus,DT)}get onDidChangeSelection(){return he.map(this.tree.onDidChangeSelection,DT)}get onMouseDblClick(){return he.map(this.tree.onMouseDblClick,xT)}get onPointer(){return he.map(this.tree.onPointer,xT)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const r=new Fk(i),a=n.map(d=>new Hq(d,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=h2(o)||{};return new Vk(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 Ia(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 Ia(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new hs(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield he.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 Ia(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new hs(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield he.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 he.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 he.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 hs(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return Ia(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)})}refreshNode(e,t,i){return Ia(this,void 0,void 0,function*(){let n;return this.subTreeRefreshPromises.forEach((o,r)=>{!n&&Vq(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return Ia(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 V1.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}})}doRefreshNode(e,t,i){return Ia(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(Ue.empty());else{const o=rl(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),br(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=gi(()=>Ia(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(Le))}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 h of e.children)if(r.set(h.element,h),this.identityProvider){const c=this.tree.isCollapsed(h);a.set(h.id,{node:h,collapsed:c})}const l=[],d=o.map(h=>{const c=!!this.dataSource.hasChildren(h);if(!this.identityProvider){const m=eS({element:h,parent:e,hasChildren:c});return c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(m.collapsedByDefault=!1,l.push(m)),m}const u=this.identityProvider.getId(h).toString(),f=a.get(u);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(h,m),m.element=h,m.hasChildren=c,i?f.collapsed?(m.children.forEach(_=>aL(_,C=>this.nodes.delete(C.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(m.collapsedByDefault=!1,l.push(m)),m}const g=eS({element:h,parent:e,id:u,hasChildren:c});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):c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const h of r.values())aL(h,c=>this.nodes.delete(c.element));for(const h of d)this.nodes.set(h.element,h);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?Ue.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 zk{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 zk(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 $q{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(...LC.classNamesArray),!0):(t.classList.remove(...LC.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=qe(this.disposables)}}function jq(s){const e=s&&h2(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 Kq extends c2{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new Ok(l=>new zk(l)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new Fk(i),a=n.map(d=>new $q(d,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=jq(o)||{};return new d2(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 _ of m.element.elements)f.add(i(_.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 h=!1;const c=u=>{const f=u.element;if(f)for(let g=0;g<f.elements.length;g++){const m=i(f.elements[g].element),_=f.elements[f.elements.length-1].element;o.has(m)&&a.indexOf(_)===-1&&(a.push(_),l=!0),r.has(m)&&d.indexOf(_)===-1&&(d.push(_),h=!0)}u.children.forEach(c)};c(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),h&&this.setFocus(d)}processChildren(e){return this.filter&&(e=Ue.filter(e,t=>{const i=this.filter.filter(t,1),n=qq(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function qq(s){return typeof s=="boolean"?s?1:0:Pk(s)?tp(s.visibility):tp(s)}class Gq extends r2{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 Bk(e,t,i)}}const Vv=new re("isWindows",Ai,p("isWindows","Whether the operating system is Windows")),Zq="inputFocus";var Sr=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},Ae=function(s,e){return function(t,i){e(t,i,s)}};const Ss=Je("listService");let lL=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 n2(Yn(),"");this.disposables.add(Xd(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),Za(e.onDidFocus(()=>this._lastFocusedWidget=e),Ve(()=>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()}};lL=Sr([Ae(0,Dt)],lL);const u2=new re("listFocus",!0),Hv=new re("listSupportsMultiselect",!0),f2=te.and(u2,te.not(Zq)),Uk=new re("listHasSelectionOrFocus",!1),$k=new re("listDoubleSelection",!1),jk=new re("listMultiSelection",!1),zv=new re("listSelectionNavigation",!1),g2="listAutomaticKeyboardNavigation";function Uv(s,e){const t=s.createScoped(e.getHTMLElement());return u2.bindTo(t),t}const Nh="workbench.list.multiSelectModifier",dL="workbench.list.openMode",_s="workbench.list.horizontalScrolling",DC="workbench.list.keyboardNavigation",Kk="workbench.list.automaticKeyboardNavigation",sp="workbench.tree.indent",xC="workbench.tree.renderIndentGuides",So="workbench.list.smoothScrolling",pr="workbench.list.mouseWheelScrollSensitivity",mr="workbench.list.fastScrollSensitivity",kC="workbench.tree.expandMode";function _r(s){return s.getValue(Nh)==="alt"}class Yq extends H{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=_r(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Nh)&&(this.useAltAsMultipleSelectionModifier=_r(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:e2(e)}isSelectionRangeChangeEvent(e){return t2(e)}}function $v(s,e,t){var i;const n=new X;return[Object.assign(Object.assign({},s),{keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return t.mightProducePrintableCharacter(r)}},smoothScrolling:!!e.getValue(So),mouseWheelScrollSensitivity:e.getValue(pr),fastScrollSensitivity:e.getValue(mr),multipleSelectionController:(i=s.multipleSelectionController)!==null&&i!==void 0?i:n.add(new Yq(e))}),n]}let hL=class extends wr{constructor(e,t,i,n,o,r,a,l,d,h){const c=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!d.getValue(_s),[u,f]=$v(o,d,h);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},io(l.getColorTheme(),Fv)),u),{horizontalScrolling:c})),this.disposables.add(f),this.contextKeyService=Uv(r,this),this.themeService=l,this.listSupportsMultiSelect=Hv.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),zv.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=Uk.bindTo(this.contextKeyService),this.listDoubleSelection=$k.bindTo(this.contextKeyService),this.listMultiSelection=jk.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_r(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(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(d.onDidChangeConfiguration(m=>{m.affectsConfiguration(Nh)&&(this._useAltAsMultipleSelectionModifier=_r(d));let _={};if(m.affectsConfiguration(_s)&&this.horizontalScrolling===void 0){const C=!!d.getValue(_s);_=Object.assign(Object.assign({},_),{horizontalScrolling:C})}if(m.affectsConfiguration(So)){const C=!!d.getValue(So);_=Object.assign(Object.assign({},_),{smoothScrolling:C})}if(m.affectsConfiguration(pr)){const C=d.getValue(pr);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:C})}if(m.affectsConfiguration(mr)){const C=d.getValue(mr);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:C})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new p2(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=Xd(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),super.dispose()}};hL=Sr([Ae(5,ve),Ae(6,Ss),Ae(7,Dt),Ae(8,Vt),Ae(9,Nt)],hL);let kT=class extends mq{constructor(e,t,i,n,o,r,a,l,d,h){const c=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!d.getValue(_s),[u,f]=$v(o,d,h);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},io(l.getColorTheme(),Fv)),u),{horizontalScrolling:c})),this.disposables=new X,this.disposables.add(f),this.contextKeyService=Uv(r,this),this.themeService=l,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Hv.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),zv.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=_r(d),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add(Xd(this,l,o.overrideStyles)),this.disposables.add(d.onDidChangeConfiguration(m=>{m.affectsConfiguration(Nh)&&(this._useAltAsMultipleSelectionModifier=_r(d));let _={};if(m.affectsConfiguration(_s)&&this.horizontalScrolling===void 0){const C=!!d.getValue(_s);_=Object.assign(Object.assign({},_),{horizontalScrolling:C})}if(m.affectsConfiguration(So)){const C=!!d.getValue(So);_=Object.assign(Object.assign({},_),{smoothScrolling:C})}if(m.affectsConfiguration(pr)){const C=d.getValue(pr);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:C})}if(m.affectsConfiguration(mr)){const C=d.getValue(mr);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:C})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new p2(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=Xd(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};kT=Sr([Ae(5,ve),Ae(6,Ss),Ae(7,Dt),Ae(8,Vt),Ae(9,Nt)],kT);let IT=class extends Wv{constructor(e,t,i,n,o,r,a,l,d,h,c){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!h.getValue(_s),[f,g]=$v(r,h,c);super(e,t,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},io(d.getColorTheme(),Fv)),f),{horizontalScrolling:u})),this.disposables=new X,this.disposables.add(g),this.contextKeyService=Uv(a,this),this.themeService=d,this.listSupportsMultiSelect=Hv.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),zv.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=Uk.bindTo(this.contextKeyService),this.listDoubleSelection=$k.bindTo(this.contextKeyService),this.listMultiSelection=jk.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_r(h),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const _=this.getSelection(),C=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(_.length>0||C.length>0),this.listMultiSelection.set(_.length>1),this.listDoubleSelection.set(_.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const _=this.getSelection(),C=this.getFocus();this.listHasSelectionOrFocus.set(_.length>0||C.length>0)})),this.disposables.add(h.onDidChangeConfiguration(_=>{_.affectsConfiguration(Nh)&&(this._useAltAsMultipleSelectionModifier=_r(h));let C={};if(_.affectsConfiguration(_s)&&this.horizontalScrolling===void 0){const b=!!h.getValue(_s);C=Object.assign(Object.assign({},C),{horizontalScrolling:b})}if(_.affectsConfiguration(So)){const b=!!h.getValue(So);C=Object.assign(Object.assign({},C),{smoothScrolling:b})}if(_.affectsConfiguration(pr)){const b=h.getValue(pr);C=Object.assign(Object.assign({},C),{mouseWheelScrollSensitivity:b})}if(_.affectsConfiguration(mr)){const b=h.getValue(mr);C=Object.assign(Object.assign({},C),{fastScrollSensitivity:b})}Object.keys(C).length>0&&this.updateOptions(C)})),this.navigator=new Xq(this,Object.assign({configurationService:h},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=Xd(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};IT=Sr([Ae(6,ve),Ae(7,Ss),Ae(8,Dt),Ae(9,Vt),Ae(10,Nt)],IT);class qk extends H{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new M),this.onDidOpen=this._onDidOpen.event,this._register(he.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(dL))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(dL))!=="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 p2 extends qk{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Xq extends qk{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Qq extends qk{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Jq(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 ET=class extends Vk{constructor(e,t,i,n,o,r,a,l,d,h,c){const{options:u,getAutomaticKeyboardNavigation:f,disposable:g}=Yp(t,o,r,d,h,c);super(e,t,i,n,u),this.disposables.add(g),this.internals=new Qd(this,o,f,o.overrideStyles,r,a,l,d,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};ET=Sr([Ae(5,ve),Ae(6,Ss),Ae(7,Dt),Ae(8,Vt),Ae(9,Nt),Ae(10,On)],ET);let NT=class extends d2{constructor(e,t,i,n,o,r,a,l,d,h,c){const{options:u,getAutomaticKeyboardNavigation:f,disposable:g}=Yp(t,o,r,d,h,c);super(e,t,i,n,u),this.disposables.add(g),this.internals=new Qd(this,o,f,o.overrideStyles,r,a,l,d,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};NT=Sr([Ae(5,ve),Ae(6,Ss),Ae(7,Dt),Ae(8,Vt),Ae(9,Nt),Ae(10,On)],NT);let TT=class extends Gq{constructor(e,t,i,n,o,r,a,l,d,h,c,u){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=Yp(t,r,a,h,c,u);super(e,t,i,n,o,f),this.disposables.add(m),this.internals=new Qd(this,r,g,r.overrideStyles,a,l,d,h,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};TT=Sr([Ae(6,ve),Ae(7,Ss),Ae(8,Dt),Ae(9,Vt),Ae(10,Nt),Ae(11,On)],TT);let cL=class extends c2{constructor(e,t,i,n,o,r,a,l,d,h,c,u){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=Yp(t,r,a,h,c,u);super(e,t,i,n,o,f),this.disposables.add(m),this.internals=new Qd(this,r,g,r.overrideStyles,a,l,d,h,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)}};cL=Sr([Ae(6,ve),Ae(7,Ss),Ae(8,Dt),Ae(9,Vt),Ae(10,Nt),Ae(11,On)],cL);let AT=class extends Kq{constructor(e,t,i,n,o,r,a,l,d,h,c,u,f){const{options:g,getAutomaticKeyboardNavigation:m,disposable:_}=Yp(t,a,l,c,u,f);super(e,t,i,n,o,r,g),this.disposables.add(_),this.internals=new Qd(this,a,m,a.overrideStyles,l,d,h,c,f),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};AT=Sr([Ae(7,ve),Ae(8,Ss),Ae(9,Dt),Ae(10,Vt),Ae(11,Nt),Ae(12,On)],AT);function Yp(s,e,t,i,n,o){var r;const a=()=>{let g=!!t.getContextKeyValue(g2);return g&&(g=!!i.getValue(Kk)),g},l=o.isScreenReaderOptimized(),d=e.simpleKeyboardNavigation||l?"simple":i.getValue(DC),h=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(_s),[c,u]=$v(e,i,n),f=e.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(sp)=="number"?i.getValue(sp):void 0,renderIndentGuides:i.getValue(xC),smoothScrolling:!!i.getValue(So),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:d==="simple",filterOnType:d==="filter",horizontalScrolling:h,keyboardNavigationEventFilter:Jq(s,n),additionalScrollHeight:f,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(r=e.expandOnlyOnTwistieClick)!==null&&r!==void 0?r:i.getValue(kC)==="doubleClick"})}}let Qd=class{constructor(e,t,i,n,o,r,a,l,d){this.tree=e,this.themeService=a,this.disposables=[],this.contextKeyService=Uv(o,e),this.listSupportsMultiSelect=Hv.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),zv.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.hasSelectionOrFocus=Uk.bindTo(this.contextKeyService),this.hasDoubleSelection=$k.bindTo(this.contextKeyService),this.hasMultiSelection=jk.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=_r(l);const c=new Set;c.add(g2);const u=()=>{const g=d.isScreenReaderOptimized()?"simple":l.getValue(DC);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(Nh)&&(this._useAltAsMultipleSelectionModifier=_r(l)),f.affectsConfiguration(sp)){const m=l.getValue(sp);g=Object.assign(Object.assign({},g),{indent:m})}if(f.affectsConfiguration(xC)){const m=l.getValue(xC);g=Object.assign(Object.assign({},g),{renderIndentGuides:m})}if(f.affectsConfiguration(So)){const m=!!l.getValue(So);g=Object.assign(Object.assign({},g),{smoothScrolling:m})}if(f.affectsConfiguration(DC)&&u(),f.affectsConfiguration(Kk)&&(g=Object.assign(Object.assign({},g),{automaticKeyboardNavigation:i()})),f.affectsConfiguration(_s)&&t.horizontalScrolling===void 0){const m=!!l.getValue(_s);g=Object.assign(Object.assign({},g),{horizontalScrolling:m})}if(f.affectsConfiguration(kC)&&t.expandOnlyOnTwistieClick===void 0&&(g=Object.assign(Object.assign({},g),{expandOnlyOnTwistieClick:l.getValue(kC)==="doubleClick"})),f.affectsConfiguration(pr)){const m=l.getValue(pr);g=Object.assign(Object.assign({},g),{mouseWheelScrollSensitivity:m})}if(f.affectsConfiguration(mr)){const m=l.getValue(mr);g=Object.assign(Object.assign({},g),{fastScrollSensitivity:m})}Object.keys(g).length>0&&e.updateOptions(g)}),this.contextKeyService.onDidChangeContext(f=>{f.affectsSome(c)&&e.updateOptions({automaticKeyboardNavigation:i()})}),d.onDidChangeScreenReaderOptimized(()=>u())),this.navigator=new Qq(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){qe(this.styler),this.styler=e?Xd(this.tree,this.themeService,e):H.None}dispose(){this.disposables=qe(this.disposables),qe(this.styler),this.styler=void 0}};Qd=Sr([Ae(4,ve),Ae(5,Ss),Ae(6,Dt),Ae(7,Vt),Ae(8,On)],Qd);const eG=Xt.as(Ch.Configuration);eG.registerConfiguration({id:"workbench",order:7,title:p("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Nh]:{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({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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.")},[dL]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"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.")},[_s]:{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.")},[sp]:{type:"number",default:8,minimum:0,maximum:40,description:p("tree indent setting","Controls tree indentation in pixels.")},[xC]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:p("render tree indent guides","Controls whether the tree should render indent guides.")},[So]:{type:"boolean",default:!1,description:p("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[pr]:{type:"number",default:1,description:p("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[mr]:{type:"number",default:5,description:p("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[DC]:{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.")},[Kk]:{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.")},[kC]:{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 Mt;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Mt||(Mt={}));(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 Wt.Error:return s.Error;case Wt.Warning:return s.Warning;case Wt.Info:return s.Info;case Wt.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Wt.Error;case s.Warning:return Wt.Warning;case s.Info:return Wt.Info;case s.Hint:return Wt.Ignore}}s.toSeverity=o})(Mt||(Mt={}));var IC;(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(Mt.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})(IC||(IC={}));const Xp=Je("markerService");class tG{constructor(){this._byResource=new Zi,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 Zi,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:Ue.empty():me.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:Ue.empty():Ue.map(Ue.concat(...this._byOwner.values()),r=>r[1])}}class iG{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Zi,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===Te.inMemory||e.scheme===Te.walkThrough||e.scheme===Te.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===Mt.Error?t.errors+=1:i===Mt.Warning?t.warnings+=1:i===Mt.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 od{constructor(){this._onMarkerChanged=new L5({delay:0,merge:od._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new tG,this._stats=new iG(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(BM(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=od._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:h,endColumn:c,relatedInformation:u,tags:f}=i;if(r)return l=l>0?l:1,d=d>0?d:1,h=h>=l?h:l,c=c>0?c:d,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:h,endColumn:c,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(od._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(od._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(od._accept(d,n)){const h=a.push(d);if(o>0&&h===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Zi;for(let i of e)for(let n of i)t.set(n,!0);return Array.from(t.keys())}}var z_=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},xc;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(xc||(xc={}));class op extends H{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=xc.None,this.cache=new Map,this.flushDelayer=new n3(op.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===xc.Closed)return;let i=!1;Un(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 Un(i)?t:i}getBoolean(e,t){const i=this.get(e);return Un(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Un(i)?t:parseInt(i,10)}set(e,t){return z_(this,void 0,void 0,function*(){if(this.state===xc.Closed)return;if(Un(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 z_(this,void 0,void 0,function*(){if(!(this.state===xc.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 z_(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()}}op.DEFAULT_FLUSH_DELAY=100;class RT{constructor(){this.onDidChangeItemsExternal=he.None,this.items=new Map}updateItems(e){return z_(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 $m="__$__targetStorageMarker",yr=Je("storageService");var EC;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(EC||(EC={}));class jv extends H{constructor(e={flushInterval:jv.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new ob),this._onDidChangeTarget=this._register(new ob),this._onWillSaveState=this._register(new M),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===$m?(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(Un(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($m,JSON.stringify(r))):typeof r[e]=="number"&&(delete r[e],(o=this.getStorage(t))===null||o===void 0||o.set($m,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($m,e);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}}jv.DEFAULT_FLUSH_INTERVAL=60*1e3;class nG extends jv{constructor(){super(),this.globalStorage=this._register(new op(new RT)),this.workspaceStorage=this._register(new op(new RT)),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 m2=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 uL=class{constructor(e){this._commandService=e}createMenu(e,t,i){return new fL(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};uL=m2([U_(0,Yt)],uL);let fL=class fc{constructor(e,t,i,n,o){this._id=e,this._options=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 Lt(()=>{this._build(),this._onDidChange.fire(this)},t.eventDebounceDelay);this._disposables.add(r),this._disposables.add(ps.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new X),l=()=>{const d=new Lt(()=>this._onDidChange.fire(this),t.eventDebounceDelay);a.add(d),a.add(n.onDidChangeContext(h=>{h.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=ps.getMenuItems(this._id);let t;e.sort(fc._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(fc._fillInKbExprKeys(e.when,this._contextKeys),Df(e)){if(e.command.precondition&&fc._fillInKbExprKeys(e.command.precondition,this._contextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;fc._fillInKbExprKeys(t,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&ps.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=Df(a)?new Ud(a.command,a.alt,e,this._contextKeyService,this._commandService):new Nx(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:fc._compareTitles(Df(e)?e.command.title:e.title,Df(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)}};fL=m2([U_(2,Yt),U_(3,ve),U_(4,yh)],fL);var sG=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},MT=function(s,e){return function(t,i){e(t,i,s)}};class oG extends H{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Ve(()=>{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 gL=class extends H{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new M),this._markerDecorations=new Zi,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(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new oG(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Te.inMemory||e.uri.scheme===Te.internal||e.uri.scheme===Te.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=S.lift(t);return t.severity===Mt.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),e.validateRange(i)}_createDecorationOption(e){let t,i,n,o,r;switch(e.severity){case Mt.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case Mt.Warning:t="squiggly-warning",i=$t(U6),n=20,r={color:$t(p6),position:fs.Inline};break;case Mt.Info:t="squiggly-info",i=$t($6),n=10;break;case Mt.Error:default:t="squiggly-error",i=$t(z6),n=30,r={color:$t(g6),position:fs.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:Xn.Right},minimap:r,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}};gL=sG([MT(0,ri),MT(1,Xp)],gL);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},OT=function(s,e){return function(t,i){e(t,i,s)}};let pL=class extends H{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new M,this._accessibilityModeEnabledContext=jp.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}};pL=rG([OT(0,ve),OT(1,Vt)],pL);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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class aG{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return jm(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 jm(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 jm(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return jm(this,void 0,void 0,function*(){this.findText=e})}}var lG=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},PT=function(s,e){return function(t,i){e(t,i,s)}},Km=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function qm(s){return s.scheme===Te.file?s.fsPath:s.path}let _2=0;class Gm{constructor(e,t,i,n,o,r,a){this.id=++_2,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 FT{constructor(e,t){this.resourceLabel=e,this.reason=t}}class BT{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({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(`
  529. `)}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 dG{constructor(e,t,i,n,o,r,a){this.id=++_2,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 BT),this.removedResources.has(t)||this.removedResources.set(t,new FT(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 BT),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new FT(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class b2{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(`
  530. `)}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 EO(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 iS{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 C2=new b2("","");C2.locked=!0;let NC=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(`
  531. `))}pushElement(e,t=su.None,i=Qo.None){if(e.type===0){const n=qm(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new Gm(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=qm(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),o.push(l),r.push(d))}o.length===1?this._pushElement(new Gm(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new dG(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 b2(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=qm(o.resource),a=this.getUriComparisonKey(o.resource),l=new Gm(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=qm(o.resource),a=this.getUriComparisonKey(o.resource),l=new Gm(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 EO(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 Qo){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){Le(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 Km(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return H.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?H.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(H.None);const i=e.actual.prepareUndoRedo();return i?VD(i)?t(i):i.then(n=>t(n)):t(H.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||C2);return new iS(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Zm(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new Zm}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"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({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"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({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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 Km(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const a=yield this._dialogService.show(Wt.Info,p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[p({key:"ok",comment:["{0} denotes a number that is > 1"]},"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({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"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 iS([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 Qo){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 Km(this,void 0,void 0,function*(){if((yield this._dialogService.show(Wt.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 Qo){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 Zm(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new Zm}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,p({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"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({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"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({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"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 Km(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({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"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 iS([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 Qo){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{}}}};NC=lG([PT(0,Kp),PT(1,ni)],NC);class Zm{constructor(e){this.returnValue=e}}Il(Wp,NC);const hG=new RegExp(`(\\\\)?\\$\\((${En.iconNameExpression}(?:${En.iconModifierExpression})?)\\)`,"g");function Rd(s){const e=new Array;let t,i=0,n=0;for(;(t=hG.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})`:cG({id:r}))}return i<s.length&&e.push(s.substring(i)),e}function cG(s){const e=Y("span");return e.classList.add(...En.asClassNameArray(s)),e}const uG={buttonBackground:W.fromHex("#0E639C"),buttonHoverBackground:W.fromHex("#006BB3"),buttonForeground:W.white};class WT extends H{constructor(e,t){super(),this._onDidClick=this._register(new M),this.options=t||Object.create(null),xo(this.options,uG,!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(lt.addTarget(this._element)),[ue.CLICK,vt.Tap].forEach(i=>{this._register(q(this._element,i,n=>{if(!this.enabled){rt.stop(n);return}this._onDidClick.fire(n)}))}),this._register(q(this._element,ue.KEY_DOWN,i=>{const n=new Ot(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&&rt.stop(n,!0)})),this._register(q(this._element,ue.MOUSE_OVER,i=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(q(this._element,ue.MOUSE_OUT,i=>{this.applyStyles()})),this.focusTracker=this._register(Gc(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?al(this._element,...Rd(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")}}const fG={badgeBackground:W.fromHex("#4D4D4D"),badgeForeground:W.fromHex("#FFFFFF")};class mL{constructor(e,t){this.count=0,this.options=t||Object.create(null),xo(this.options,fG,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=U(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=Vi(this.countFormat,this.count),this.element.title=Vi(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 VT="done",HT="active",nS="infinite",zT="discrete",gG={progressBarBackground:W.fromHex("#0E70C0")};class pG extends H{constructor(e,t){super(),this.options=t||Object.create(null),xo(this.options,gG,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new Lt(()=>zn(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(HT,nS,zT),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(VT),this.element.classList.contains(nS)?(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(zT,VT),this.element.classList.add(HT,nS),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}}}class Gk{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const v2=new Gk("id#"),sS={},mG=new Gk("quick-input-button-icon-");function _L(s){if(!s)return;let e;const t=s.dark.toString();return sS[t]?e=sS[t]:(e=mG.nextId(),z1(`.${e}`,`background-image: ${ua(s.light||s.dark)}`),z1(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${ua(s.dark)}`),sS[t]=e),e}const _G={ctrlCmd:!1,alt:!1};var rp;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(rp||(rp={}));var eo;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(eo||(eo={}));function bG(s,e={}){const t=Zk(e);return t.textContent=s,t}function w2(s,e={}){const t=Zk(e);return S2(t,vG(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Zk(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class CG{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 S2(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.disposables.add(ii(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=>{S2(n,o,t,i)})}function vG(s,e){const t={type:1,children:[]};let i=0,n=t;const o=[],r=new CG(s);for(;!r.eos();){let a=r.next();const l=a==="\\"&&bL(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&wG(a,e)&&a===r.peek()){r.advance(),n.type===2&&(n=o.pop());const d=bL(a,e);if(n.type===d||n.type===5&&d===6)n=o.pop();else{const h={type:d,children:[]};d===5&&(h.index=i,i++),n.children.push(h),o.push(n),n=h}}else if(a===`
  532. `)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 wG(s,e){return bL(s,e)!==0}function bL(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 SG{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 yG{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}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 SG(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 pf=Y,LG={inputBackground:W.fromHex("#3C3C3C"),inputForeground:W.fromHex("#CCCCCC"),inputValidationInfoBorder:W.fromHex("#55AAFF"),inputValidationInfoBackground:W.fromHex("#063B49"),inputValidationWarningBorder:W.fromHex("#B89500"),inputValidationWarningBackground:W.fromHex("#352A05"),inputValidationErrorBorder:W.fromHex("#BE1100"),inputValidationErrorBackground:W.fromHex("#5A1D1D")};class y2 extends ss{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),xo(this.options,LG,!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=U(e,pf(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",r=U(this.element,pf(".ibwrapper"));if(this.input=U(r,pf(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=U(r,pf("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new dk(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),U(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(d=>this.input.scrollTop=d.scrollTop));const a=this._register(new mt(document,"selectionchange")),l=he.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 pa(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:H1(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 Es(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=Es(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{if(!this.message)return null;e=U(n,pf(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?w2(this.message.content,o):bG(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}`:"",U(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),Ei(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).replace(/\u000c/g,"")?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=H1(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 L2 extends y2{constructor(e,t,i){const n=p({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${n}`,r=` (⇅ ${n})`;super(e,t,i),this.history=new yG(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:r,d=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=d:this.setPlaceHolder(d)}};this.observer=new MutationObserver((l,d)=>{l.forEach(h=>{h.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=d=>{if(this.placeholder.endsWith(d)){const h=this.placeholder.slice(0,this.placeholder.length-d.length);return i.showPlaceholderOnFocus?this.placeholder=h:this.setPlaceHolder(h),!0}else return!1};l(r)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}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,$b(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,$b(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 DG=Y;class xG extends H{constructor(e){super(),this.parent=e,this.onKeyDown=t=>q(this.inputBox.inputElement,ue.KEY_DOWN,i=>{t(new Ot(i))}),this.onMouseDown=t=>q(this.inputBox.inputElement,ue.MOUSE_DOWN,i=>{t(new cs(i))}),this.onDidChange=t=>this.inputBox.onDidChange(t),this.container=U(this.parent,DG(".quick-input-box")),this.inputBox=this._register(new y2(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===Wt.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Wt.Info?1:e===Wt.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Wt.Info?1:e===Wt.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}class bl{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=bl.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&po(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?Rd(r):[r])),t=i.end}const n=this.text.substring(i.start,i.end),o=Y("span.highlight",void 0,...this.supportIcons?Rd(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?Rd(i):[i]))}al(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
  533. `?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class ma{constructor(e="",t=!1){var i,n,o;if(this.value=e,typeof this.value!="string")throw fo("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(n=t.supportThemeIcons)!==null&&n!==void 0?n:!1,this.supportHtml=(o=t.supportHtml)!==null&&o!==void 0?o:!1)}appendText(e,t=0){return this.value+=kG(this.supportThemeIcons?TK(e):e).replace(/([ \t]+)/g,(i,n)=>"&nbsp;".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
  534. `:`
  535. `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
  536. `,this.value+=t,this.value+="\n```\n",this}}function dg(s){return D2(s)?!s.value:Array.isArray(s)?s.every(dg):!0}function D2(s){return s instanceof ma?!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 kG(s){return s.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}function oS(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1")}function IG(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 CL=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function EG(s,e){Gs(e)?s.title=e:e!=null&&e.markdownNotSupportedFallback?s.title=e.markdownNotSupportedFallback:s.removeAttribute("title")}class NG{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return CL(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(e===void 0||Gs(e)||e instanceof HTMLElement)n=e;else if(!Bf(e.markdown))n=(i=e.markdown)!==null&&i!==void 0?i:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new ln;const o=this._cancellationTokenSource.token;if(n=yield e.markdown(o),this.isDisposed||o.isCancellationRequested)return}this.show(n,t)})}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const n={content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(n,t)}i==null||i.dispose()}hasContent(e){return e?D2(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function TG(s,e,t){let i,n;const o=(h,c)=>{var u;h&&(n==null||n.dispose(),n=void 0),c&&(i==null||i.dispose(),i=void 0),(u=s.onDidHideHover)===null||u===void 0||u.call(s)},r=(h,c,u)=>new hn(()=>CL(this,void 0,void 0,function*(){(!n||n.isDisposed)&&(n=new NG(s,u||e,h>0),yield n.update(t,c))}),h),a=()=>{if(i)return;const h=new X,c=g=>o(!1,g.fromElement===e);h.add(q(e,ue.MOUSE_LEAVE,c,!0));const u=()=>o(!0,!0);h.add(q(e,ue.MOUSE_DOWN,u,!0));const f={targetElements:[e],dispose:()=>{}};if(s.placement===void 0||s.placement==="mouse"){const g=m=>f.x=m.x+10;h.add(q(e,ue.MOUSE_MOVE,g,!0))}h.add(r(s.delay,!1,f)),i=h},l=q(e,ue.MOUSE_OVER,a,!0);return{show:h=>{o(!1,!0),r(0,h)},hide:()=>{o(!0,!0)},update:h=>CL(this,void 0,void 0,function*(){t=h,yield n==null?void 0:n.update(t)}),dispose:()=>{l.dispose(),o(!0,!0)}}}class rS{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 Yk extends H{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new rS(U(e,Y(".monaco-icon-label")))),this.labelContainer=U(this.domNode.element,Y(".monaco-icon-label-container"));const i=U(this.labelContainer,Y("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new rS(U(this.labelContainer,Y("span.monaco-icon-description-container")))),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new MG(i,!!t.supportIcons):this.nameNode=new AG(i),t!=null&&t.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new bl(U(this.descriptionContainer.element,Y("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new rS(U(this.descriptionContainer.element,Y("span.label-description")))),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}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(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof bl?(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)EG(e,t);else{const n=TG(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 AG{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&po(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=U(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}`;U(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&&U(this.container,Y("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function RG(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=>Bi.intersect(o,a)).filter(a=>!Bi.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class MG{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&po(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 bl(U(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=RG(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 bl(U(this.container,d),this.supportIcons).set(r,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&&U(d,Y("span.label-separator",void 0,i))}}}}const Ym=Y;class Xk{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=U(e,Ym(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&Xk.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&&(U(this.domNode,Ym("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(){Li(this.domNode),this.keyElements.clear()}renderPart(e,t,i){const n=Ix.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){U(e,this.createKeyElement(t,i?".highlight":"")),n&&U(e,Ym("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){U(e,this.createKeyElement(p("unbound","Unbound")))}createKeyElement(e,t=""){const i=Ym("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&&po(e.firstPart,t.firstPart)&&po(e.chordPart,t.chordPart)}}const UT=new Tc(()=>{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}});function OG(s,e,t=!1){const i=s||"",n=e||"",o=UT.value.collator.compare(i,n);return UT.value.collatorIsNumeric&&o===0&&i!==n?i<n?-1:1:o}function PG(s,e,t){const i=s.toLowerCase(),n=e.toLowerCase(),o=FG(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=OG(i,n);return l!==0?l:i.localeCompare(n)}function FG(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}var x2=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},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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Ho=Y;class WG{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 Qp{get templateId(){return Qp.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=U(e,Ho(".quick-input-list-entry"));const i=U(t.entry,Ho("label.quick-input-list-label"));t.toDisposeTemplate.push(ii(i,ue.CLICK,d=>{t.checkbox.offsetParent||d.preventDefault()})),t.checkbox=U(i,Ho("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(ii(t.checkbox,ue.CHANGE,d=>{t.element.checked=t.checkbox.checked}));const n=U(i,Ho(".quick-input-list-rows")),o=U(n,Ho(".quick-input-list-row")),r=U(n,Ho(".quick-input-list-row"));t.label=new Yk(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=U(o,Ho(".quick-input-list-entry-keybinding"));t.keybinding=new Xk(a,Ms);const l=U(r,Ho(".quick-input-list-label-meta"));return t.detail=new bl(l,!0),t.separator=U(t.entry,Ho(".quick-input-list-separator")),t.actionBar=new pa(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=qe(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,h)=>{let c=d.iconClass||(d.iconPath?_L(d.iconPath):void 0);d.alwaysVisible&&(c=c?`${c} always-visible`:"always-visible");const u=new Us(`id-${h}`,"",c,!0,()=>BG(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=qe(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=qe(e.toDisposeElement),e.toDisposeTemplate=qe(e.toDisposeTemplate)}}Qp.ID="listelement";class VG{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return Qp.ID}}var qt;(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"})(qt||(qt={}));class Qk{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=U(this.parent,Ho(".quick-input-list"));const n=new VG,o=new zG;this.list=i.createList("QuickInput",this.container,n,[new Qp],{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 Ot(r);switch(a.keyCode){case 10:this.toggleCheckbox();break;case 31:(Me?r.metaKey:r.ctrlKey)&&this.list.setFocus(tn(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(q(this.container,ue.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 he.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return he.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}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=qe(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],h=n.label&&n.label.replace(/\r?\n/g," "),c=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||[h,u,f].map(m=>zW(m)).filter(m=>!!m).join(", ");i.push(new WG({index:o,item:n,saneLabel:h,saneMeta:c,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===qt.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=qt.First),e===qt.Previous&&this.list.getFocus()[0]===0&&(e=qt.Last),e===qt.Second&&this.list.length<2&&(e=qt.First),e){case qt.First:this.list.focusFirst();break;case qt.Second:this.list.focusNth(1);break;case qt.Last:this.list.focusLast();break;case qt.Next:this.list.focusNext();break;case qt.Previous:this.list.focusPrevious();break;case qt.NextPage:this.list.focusNextPage();break;case qt.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?Kn(Um(e,zm(n.saneLabel))):void 0,r=this.matchOnDescription?Kn(Um(e,zm(n.saneDescription||""))):void 0,a=this.matchOnDetail?Kn(Um(e,zm(n.saneDetail||""))):void 0,l=this.matchOnMeta?Kn(Um(e,zm(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)=>HG(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=qe(this.elementDisposables),this.disposables=qe(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)}}x2([si],Qk.prototype,"onDidChangeFocus",null);x2([si],Qk.prototype,"onDidChangeSelection",null);function HG(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:PG(s.saneLabel,e.saneLabel,t)}class zG{getWidgetAriaLabel(){return p("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}var $T=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Fn=Y,UG=Zs("quick-input-back",ie.arrowLeft),vL={iconClass:UG.classNames,tooltip:p("quickInput.back","Back"),handle:-1};class Kv extends H{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=Kv.noPromptMessage,this._severity=Wt.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&&!lr;this._ignoreFocusOut=e&&!lr,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._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=rp.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 hn,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===vL);this.ui.leftActionBar.push(n.map((r,a)=>{const l=new Us(`id-${a}`,"",r.iconClass||_L(r.iconPath),!0,()=>$T(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!==vL);this.ui.rightActionBar.push(o.map((r,a)=>{const l=new Us(`id-${a}`,"",r.iconClass||_L(r.iconPath),!0,()=>$T(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,al(this.ui.message,...Rd(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!==Wt.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()}}Kv.noPromptMessage=p("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ap extends Kv{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._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?eo.NONE:eo.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}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?_G: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(qt.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(qt.Next),this.canSelectMany&&this.ui.list.domFocus(),rt.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(qt.Previous):this.ui.list.focus(qt.Last),this.canSelectMany&&this.ui.list.domFocus(),rt.stop(e,!0);break;case 12:this.ui.list.focus(qt.NextPage),this.canSelectMany&&this.ui.list.domFocus(),rt.stop(e,!0);break;case 11:this.ui.list.focus(qt.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),rt.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(qt.First),rt.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(qt.Last),rt.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&zs(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&&zs(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&&zs(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 q(this.ui.container,ue.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ot(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.keepScrollPosition?this.scrollTop:0,t=!!this._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",t&&!this.description);const i={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!t,progressBar:!t,visibleCount:!0,count:this.canSelectMany,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),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 n=this.ariaLabel||this.placeholder||ap.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n),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 eo.NONE:this._itemActivation=eo.FIRST;break;case eo.SECOND:this.ui.list.focus(qt.Second),this._itemActivation=eo.FIRST;break;case eo.LAST:this.ui.list.focus(qt.Last),this._itemActivation=eo.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),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(qt.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ap.DEFAULT_ARIA_LABEL=p("quickInputBox.ariaLabel","Type to narrow down results.");class qv extends H{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(q(window,ue.KEY_DOWN,e,!0)),this._register(q(window,ue.KEY_UP,e,!0)),this._register(q(window,ue.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=U(this.parentElement,Fn(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Yn(e),i=U(e,Fn(".quick-input-titlebar")),n=this._register(new pa(i));n.domNode.classList.add("quick-input-left-action-bar");const o=U(i,Fn(".quick-input-title")),r=this._register(new pa(i));r.domNode.classList.add("quick-input-right-action-bar");const a=U(e,Fn(".quick-input-description")),l=U(e,Fn(".quick-input-header")),d=U(l,Fn("input.quick-input-check-all"));d.type="checkbox",this._register(ii(d,ue.CHANGE,B=>{const O=d.checked;L.setAllVisibleChecked(O)})),this._register(q(d,ue.CLICK,B=>{(B.x||B.y)&&f.setFocus()}));const h=U(l,Fn(".quick-input-description")),c=U(l,Fn(".quick-input-and-message")),u=U(c,Fn(".quick-input-filter")),f=this._register(new xG(u));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=U(u,Fn(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new mL(g,{countFormat:p({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")}),_=U(u,Fn(".quick-input-count"));_.setAttribute("aria-live","polite");const C=new mL(_,{countFormat:p({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")}),b=U(l,Fn(".quick-input-action")),v=new WT(b);v.label=p("ok","OK"),this._register(v.onDidClick(B=>{this.onDidAcceptEmitter.fire()}));const w=U(l,Fn(".quick-input-action")),y=new WT(w);y.label=p("custom","Custom"),this._register(y.onDidClick(B=>{this.onDidCustomEmitter.fire()}));const k=U(c,Fn(`#${this.idPrefix}message.quick-input-message`)),L=this._register(new Qk(e,this.idPrefix+"list",this.options));this._register(L.onChangedAllVisibleChecked(B=>{d.checked=B})),this._register(L.onChangedVisibleCount(B=>{m.setCount(B)})),this._register(L.onChangedCheckedCount(B=>{C.setCount(B)})),this._register(L.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof ap&&this.controller.canSelectMany&&L.clearFocus()},0)})),this._register(L.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const D=new pG(e);D.getContainer().classList.add("quick-input-progress");const N=Gc(e);return this._register(N),this._register(q(e,ue.FOCUS,B=>{this.previousFocusElement=B.relatedTarget instanceof HTMLElement?B.relatedTarget:void 0},!0)),this._register(N.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(rp.Blur),this.previousFocusElement=void 0})),this._register(q(e,ue.FOCUS,B=>{f.setFocus()})),this._register(q(e,ue.KEY_DOWN,B=>{const O=new Ot(B);switch(O.keyCode){case 3:rt.stop(B,!0),this.onDidAcceptEmitter.fire();break;case 9:rt.stop(B,!0),this.hide(rp.Gesture);break;case 2:if(!O.altKey&&!O.ctrlKey&&!O.metaKey){const $=[".action-label.codicon"];e.classList.contains("show-checkboxes")?$.push("input"):$.push("input[type=text]"),this.getUI().list.isDisplayed()&&$.push(".monaco-list");const K=e.querySelectorAll($.join(", "));O.shiftKey&&O.target===K[0]?(rt.stop(B,!0),K[K.length-1].focus()):!O.shiftKey&&O.target===K[K.length-1]&&(rt.stop(B,!0),K[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:a,description2:h,rightActionBar:r,checkAll:d,filterContainer:u,inputBox:f,visibleCountContainer:g,visibleCount:m,countContainer:_,count:C,okContainer:b,ok:v,message:k,customButtonContainer:w,customButton:y,list:L,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:B=>this.show(B),hide:()=>this.hide(),setVisibilities:B=>this.setVisibilities(B),setComboboxAccessibility:B=>this.setComboboxAccessibility(B),setEnabled:B=>this.setEnabled(B),setContextKey:B=>this.options.setContextKey(B)},this.updateStyles(),this.ui}pick(e,t={},i=Oe.None){return new Promise((n,o)=>{let r=h=>{r=n,t.onKeyMods&&t.onKeyMods(a.keyMods),n(h)};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 h=a.activeItems[0];h&&(r(h),a.hide())}}),a.onDidChangeActive(h=>{const c=h[0];c&&t.onDidFocus&&t.onDidFocus(c)}),a.onDidChangeSelection(h=>{if(!a.canSelectMany){const c=h[0];c&&(r(c),a.hide())}}),a.onDidTriggerItemButton(h=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},h),{removeItem:()=>{const c=a.items.indexOf(h.item);if(c!==-1){const u=a.items.slice(),f=u.splice(c,1),g=a.activeItems.filter(_=>_!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,g&&(a.activeItems=g),a.keepScrollPosition=m}}}))),a.onDidChangeValue(h=>{l&&!h&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{qe(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(([h,c])=>{l=c,a.busy=!1,a.items=h,a.canSelectMany&&(a.selectedItems=h.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,h=>{o(h),a.hide()})})}createQuickPick(){const e=this.getUI();return new ap(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(Wt.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),al(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();vL.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,qv.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(`
  537. `);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}qv.MAX_WIDTH=600;var wL;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(wL||(wL={}));const Th={Quickaccess:"workbench.contributions.quickaccess"};class $G{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),Ve(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return vh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Xt.add(Th.Quickaccess,new $G);const Rl=Je("quickInputService");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},jT=function(s,e){return function(t,i){e(t,i,s)}};let SL=class extends H{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Xt.as(Th.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===wL.LAST?g=this.lastAcceptedPickerValues.get(r):typeof m=="string"&&(g=`${r.prefix}${m}`)}typeof g=="string"&&(e=g)}const d=new X,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,r,i),h.placeholder=r==null?void 0:r.placeholder,h.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(h.itemActivation=(n=i==null?void 0:i.itemActivation)!==null&&n!==void 0?n:eo.SECOND),h.contextKey=r==null?void 0:r.contextKey,h.filterValue=g=>g.substring(r?r.prefix.length:0),r!=null&&r.placeholder&&(h.ariaLabel=r==null?void 0:r.placeholder);let c,u;t&&(c=new Promise(g=>u=g),d.add(ha(h.onWillAccept)(g=>{g.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,o,r,e));const f=d.add(new ln);if(o&&d.add(o.provide(h,f.token)),ha(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u==null||u(h.selectedItems)}),h.show(),t)return c}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(Ve(()=>{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]}};SL=jG([jT(0,Rl),jT(1,Ge)],SL);var KG=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},mf=function(s,e){return function(t,i){e(t,i,s)}};let yL=class extends C8{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(SL))),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,h,c)=>this.instantiationService.createInstance(hL,a,l,d,h,c),styles:this.computeStyles()},r=this._register(new qv(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 re(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=Oe.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},io(this.theme,{quickInputBackground:cN,quickInputForeground:f9,quickInputTitleBackground:g9,contrastBorder:Zt,widgetShadow:fl})),inputBox:io(this.theme,{inputForeground:Kx,inputBackground:jx,inputBorder:qx,inputValidationInfoBackground:Gx,inputValidationInfoForeground:Zx,inputValidationInfoBorder:Yx,inputValidationWarningBackground:RO,inputValidationWarningForeground:MO,inputValidationWarningBorder:OO,inputValidationErrorBackground:PO,inputValidationErrorForeground:FO,inputValidationErrorBorder:BO}),countBadge:io(this.theme,{badgeBackground:Xf,badgeForeground:Qf,badgeBorder:Zt}),button:io(this.theme,{buttonForeground:s9,buttonBackground:xy,buttonHoverBackground:o9,buttonBorder:Zt}),progressBar:io(this.theme,{progressBarBackground:r9}),keybindingLabel:io(this.theme,{keybindingLabelBackground:_9,keybindingLabelForeground:b9,keybindingLabelBorder:C9,keybindingLabelBottomBorder:v9,keybindingLabelShadow:fl}),list:io(this.theme,{listBackground:cN,listInactiveFocusForeground:T_,listInactiveSelectionIconForeground:A_,listInactiveFocusBackground:R_,listFocusOutline:Xi,listInactiveFocusOutline:Xi,pickerGroupBorder:m9,pickerGroupForeground:p9})}}};yL=KG([mf(0,Ge),mf(1,ve),mf(2,Dt),mf(3,On),mf(4,Bv)],yL);var k2=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},rd=function(s,e){return function(t,i){e(t,i,s)}};let LL=class extends yL{constructor(e,t,i,n,o,r){super(t,i,n,o,r),this.host=void 0;const a=uu.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)}};LL=k2([rd(1,Ge),rd(2,ve),rd(3,Dt),rd(4,On),rd(5,Bv)],LL);let DL=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(LL,e);this.mapEditorToService.set(e,t),ha(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=Oe.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};DL=k2([rd(0,Ge),rd(1,tt)],DL);class uu{constructor(e){this.editor=e,this.widget=new Gv(this.editor)}static get(e){return e.getContribution(uu.ID)}dispose(){this.widget.dispose()}}uu.ID="editor.controller.quickInput";class Gv{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Gv.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Gv.ID="editor.contrib.quickInputWidget";nt(uu.ID,uu);var it;(function(s){const e=new qg;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 qg;for(const[h,c]of AV())l.set(h,c);for(let h in a)a.hasOwnProperty(h)&&l.set(Je(h),a[h]);i.forEach(h=>l.set(h.id,h.get(a)));let d=new wC(l,!0);return l.set(Ge,d),[l,d]}s.init=o,s.instantiationService=n(Ge,()=>new wC(e,!0));const r=new lO;s.configurationService=n(Vt,()=>r),s.resourceConfigurationService=n(px,()=>new u8(r)),s.resourcePropertiesService=n(PM,()=>new _y(r)),s.contextService=n(nO,()=>new bv),s.labelService=n(qp,()=>new p8),s.telemetryService=n(El,()=>new f8),s.dialogService=n(Kp,()=>new h8),s.notificationService=n(ni,()=>new _v),s.markerService=n(Xp,()=>new od),s.modeService=n(Qi,a=>new Jg),s.standaloneThemeService=n(kh,()=>new oK),s.logService=n(Cr,()=>new nH(new iH)),s.undoRedoService=n(Wp,a=>new NC(s.dialogService.get(a),s.notificationService.get(a))),s.languageConfigurationService=n(Pp,a=>new Ib(s.configurationService.get(a),s.modeService.get(a))),s.modelService=n(ri,a=>new _C(s.configurationService.get(a),s.resourcePropertiesService.get(a),s.standaloneThemeService.get(a),s.logService.get(a),s.undoRedoService.get(a),s.modeService.get(a),s.languageConfigurationService.get(a))),s.markerDecorationsService=n(Ex,a=>new gL(s.modelService.get(a),s.markerService.get(a))),s.contextKeyService=n(ve,a=>new Gy(s.configurationService.get(a))),s.codeEditorService=n(tt,a=>new pC(null,s.contextKeyService.get(a),s.standaloneThemeService.get(a))),s.editorProgressService=n(Ca,()=>new mv),s.storageService=n(yr,()=>new nG),s.editorWorkerService=n(Ys,a=>new dy(s.modelService.get(a),s.resourceConfigurationService.get(a),s.logService.get(a)))})(it||(it={}));class qG extends H{constructor(e,t){super();const[i,n]=it.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(Vt),r=this.get(ni),a=this.get(El),l=this.get(Dt),d=this.get(Cr),h=this.get(ve);let c=(_,C)=>{let b=null;return t&&(b=t[_.toString()]),b||(b=C()),this._serviceCollection.set(_,b),b};c(On,()=>new pL(h,o)),c(Ss,()=>new lL(l));let u=c(Yt,()=>new c8(this._instantiationService)),f=c(Nt,()=>this._register(new aO(h,u,a,r,d,e))),g=c(Bv,()=>new m8(it.codeEditorService.get(tt),e));c(Rl,()=>new DL(n,it.codeEditorService.get(tt)));let m=c(Nl,()=>this._register(new iL(g)));c(Al,()=>new aG),c(Tl,()=>{const _=new tL(a,r,m,f,l);return _.configure({blockMouse:!1}),this._register(_)}),c(yh,()=>new uL(u)),c(yx,()=>new g8(it.modelService.get(ri)))}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 I2(s,e,t){let i=new qG(s,e),n=null;i.has(Qn)||(n=new my(it.modelService.get()),i.set(Qn,n)),i.has(Co)||i.set(Co,new G1(i.get(tt),i.get(Yt)));let o=t(i);return n&&n.setEditor(o),o}function GG(s,e,t){return I2(s,t||{},i=>new Uy(s,e,i,i.get(Ge),i.get(tt),i.get(Yt),i.get(ve),i.get(Nt),i.get(Nl),i.get(kh),i.get(ni),i.get(Vt),i.get(On),i.get(ri),i.get(Qi)))}function ZG(s){return it.codeEditorService.get().onCodeEditorAdd(e=>{s(e)})}function YG(s,e,t){return I2(s,t||{},i=>new $y(s,e,i,i.get(Ge),i.get(ve),i.get(Nt),i.get(Nl),i.get(Ys),i.get(tt),i.get(kh),i.get(ni),i.get(Vt),i.get(Tl),i.get(Ca),i.get(Al)))}function XG(s,e){return new fW(s,e)}function QG(s,e,t){return EP(it.modelService.get(),it.modeService.get(),s,e,t)}function JG(s,e){it.modelService.get().setMode(s,it.modeService.get().create(e))}function eZ(s,e,t){s&&it.markerService.get().changeOne(e,s.uri,t)}function tZ(s){return it.markerService.get().read(s)}function iZ(s){return it.markerService.get().onMarkerChanged(s)}function nZ(s){return it.modelService.get().getModel(s)}function sZ(){return it.modelService.get().getModels()}function oZ(s){return it.modelService.get().onModelAdded(s)}function rZ(s){return it.modelService.get().onModelRemoved(s)}function aZ(s){return it.modelService.get().onModelModeChanged(e=>{s({model:e.model,oldLanguage:e.oldModeId})})}function lZ(s){return lH(it.modelService.get(),s)}function dZ(s,e){const t=it.standaloneThemeService.get();return t.registerEditorContainer(s),Sx.colorizeElement(t,it.modeService.get(),s,e)}function hZ(s,e,t){return it.standaloneThemeService.get().registerEditorContainer(document.body),Sx.colorize(it.modeService.get(),s,e,t)}function cZ(s,e,t=4){return it.standaloneThemeService.get().registerEditorContainer(document.body),Sx.colorizeModelLine(s,e,t)}function uZ(s){let e=Rt.get(s);return e||{getInitialState:()=>Op,tokenize:(t,i,n,o)=>vM(s,t,n,o)}}function fZ(s,e){it.modeService.get().triggerMode(e);let i=uZ(e),n=cr(s),o=[],r=i.getInitialState();for(let a=0,l=n.length;a<l;a++){let d=n[a],h=i.tokenize(d,!0,r,0);o[a]=h.tokens,r=h.endState}return o}function gZ(s,e){it.standaloneThemeService.get().defineTheme(s,e)}function pZ(s){it.standaloneThemeService.get().setTheme(s)}function mZ(){I8()}function _Z(s,e){return $e.registerCommand({id:s,handler:e})}function bZ(){return{create:GG,onDidCreateEditor:ZG,createDiffEditor:YG,createDiffNavigator:XG,createModel:QG,setModelLanguage:JG,setModelMarkers:eZ,getModelMarkers:tZ,onDidChangeMarkers:iZ,getModels:sZ,getModel:nZ,onDidCreateModel:oZ,onWillDisposeModel:rZ,onDidChangeModelLanguage:aZ,createWebWorker:lZ,colorizeElement:dZ,colorize:hZ,colorizeModelLine:cZ,tokenize:fZ,defineTheme:gZ,setTheme:pZ,remeasureFonts:mZ,registerCommand:_Z,AccessibilitySupport:t1,ContentWidgetPositionPreference:r1,CursorChangeReason:a1,DefaultEndOfLine:l1,EditorAutoIndentStrategy:h1,EditorOption:c1,EndOfLinePreference:u1,EndOfLineSequence:f1,MinimapPosition:v1,MouseTargetType:w1,OverlayWidgetPositionPreference:S1,OverviewRulerLane:y1,RenderLineNumbersType:L1,RenderMinimap:D1,ScrollbarVisibility:k1,ScrollType:x1,TextEditorCursorBlinkingStyle:A1,TextEditorCursorStyle:R1,TrackedRangeStickiness:M1,WrappingIndent:O1,ConfigurationChangedEvent:xR,BareFontInfo:wd,FontInfo:Y1,TextModelResolvedOptions:y_,FindMatch:Cg,EditorType:Mp,EditorOptions:Do}}function CZ(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function Xm(s,e){return typeof s=="boolean"?s:e}function KT(s,e){return typeof s=="string"?s:e}function vZ(s){const e={};for(const t of s)e[t]=!0;return e}function qT(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=vZ(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 xL(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?pt(s,"language definition does not contain attribute '"+r+"', used at: "+e):pt(s,"attribute reference '"+r+"' must be a string, used at: "+e);return hc(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 wZ(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 SZ(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 h=qT(l.split("|"),s.ignoreCase);d=function(c){return a==="~"?h(c):!h(c)}}else if(a==="@"||a==="!@"){let h=s[l];if(!h)throw pt(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!CZ(function(u){return typeof u=="string"},h))throw pt(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);let c=qT(h,s.ignoreCase);d=function(u){return a==="@"?c(u):!c(u)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){let h=xL(s,"^"+l+"$");d=function(c){return a==="~"?h.test(c):!h.test(c)}}else d=function(h,c,u,f){return xL(s,"^"+Ba(s,l,c,u,f)+"$").test(h)};else if(l.indexOf("$")<0){let h=Xa(s,l);d=function(c){return a==="=="?c===h:c!==h}}else{let h=Xa(s,l);d=function(c,u,f,g,m){let _=Ba(s,h,u,f,g);return a==="=="?c===_:c!==_}}return n===-1?{name:t,value:i,test:function(h,c,u,f){return d(h,h,c,u,f)}}:{name:t,value:i,test:function(h,c,u,f){let g=wZ(h,c,u,n);return d(g||"",h,c,u,f)}}}function kL(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw pt(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 pt(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw pt(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&&!IH(s,Ba(s,n,"",[],""))))throw pt(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]=kL(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=kL(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,h){return h},value:r,name:o}):i.push(SZ(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 pt(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 yZ{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 pt(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=xL(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=kL(e,this.name,t)}}function LZ(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");let t={};t.languageId=s,t.includeLF=Xm(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=Xm(e.ignoreCase,!1),t.unicode=Xm(e.unicode,!1),t.tokenPostfix=KT(e.tokenPostfix,"."+t.languageId),t.defaultToken=KT(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 h=d.include;if(h){if(typeof h!="string")throw pt(t,"an 'include' attribute must be a string at: "+r);if(h[0]==="@"&&(h=h.substr(1)),!e.tokenizer[h])throw pt(t,"include target '"+h+"' is not defined at: "+r);n(r+"."+h,a,e.tokenizer[h])}else{const c=new yZ(r);if(Array.isArray(d)&&d.length>=1&&d.length<=3)if(c.setRegex(i,d[0]),d.length>=3)if(typeof d[1]=="string")c.setAction(i,{token:d[1],next:d[2]});else if(typeof d[1]=="object"){const u=d[1];u.next=d[2],c.setAction(i,u)}else throw pt(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 c.setAction(i,d[1]);else{if(!d.regex)throw pt(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"&&(c.name=d.name),d.matchOnlyAtStart&&(c.matchOnlyAtLineStart=Xm(d.matchOnlyAtLineStart,!1)),c.setRegex(i,d.regex),c.setAction(i,d.action)}a.push(c)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw pt(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 pt(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 pt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
  538. 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:Xa(t,a.open),close:Xa(t,a.close)});else throw pt(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 DZ(s){Td.registerLanguage(s)}function xZ(){let s=[];return s=s.concat(Td.getLanguages()),s}function kZ(s){return it.modeService.get().languageIdCodec.encodeLanguageId(s)}function IZ(s,e){let t=it.modeService.get().onDidEncounterLanguage(i=>{i===s&&(t.dispose(),e())});return t}function EZ(s,e){const t=it.modeService.get().validateLanguageId(s);if(!t)throw new Error(`Cannot set configuration for unknown language ${s}`);return Qe.register(t,e,100)}class NZ{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i,n){if(typeof this._actual.tokenize=="function")return lp.adaptTokenize(this._languageId,this._actual,e,i,n);throw new Error("Not supported!")}tokenize2(e,t,i){let n=this._actual.tokenizeEncoded(e,i);return new jC(n.tokens,n.endState)}}class lp{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._modeService=i,this._standaloneThemeService=n}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 $C(d+i,l.scopes,t),o=d}return n}static adaptTokenize(e,t,i,n,o){let r=t.tokenize(i,n),a=lp._toClassicTokens(r.tokens,e,o),l;return r.endState.equals(n)?l=n:l=r.endState,new jD(a,l)}tokenize(e,t,i,n){return lp.adaptTokenize(this._languageId,this._actual,e,i,n)}_toBinaryTokens(e,t,i){const n=e.encodeLanguageId(this._languageId),o=this._standaloneThemeService.getColorTheme().tokenTheme;let r=[],a=0,l=0;for(let h=0,c=t.length;h<c;h++){const u=t[h],f=o.match(n,u.scopes);if(a>0&&r[a-1]===f)continue;let g=u.startIndex;h===0?g=0:g<l&&(g=l),r[a++]=g+i,r[a++]=f,l=g}let d=new Uint32Array(a);for(let h=0;h<a;h++)d[h]=r[h];return d}tokenize2(e,t,i,n){let o=this._actual.tokenize(e,i),r=this._toBinaryTokens(this._modeService.languageIdCodec,o.tokens,n),a;return o.endState.equals(i)?a=i:a=o.endState,new jC(r,a)}}function TZ(s){return"tokenizeEncoded"in s}function E2(s){return s&&typeof s.then=="function"}function AZ(s){if(s){const e=[null];for(let t=1,i=s.length;t<i;t++)e[t]=W.fromHex(s[t]);it.standaloneThemeService.get().setColorMapOverride(e)}else it.standaloneThemeService.get().setColorMapOverride(null)}function RZ(s,e){const t=it.modeService.get().validateLanguageId(s);if(!t)throw new Error(`Cannot set tokens provider for unknown language ${s}`);const i=n=>TZ(n)?new NZ(t,n):new lp(t,n,it.modeService.get(),it.standaloneThemeService.get());return E2(e)?Rt.registerPromise(s,e.then(n=>i(n))):Rt.register(s,i(e))}function MZ(s,e){const t=i=>TH(it.modeService.get(),it.standaloneThemeService.get(),s,LZ(s,i));return E2(e)?Rt.registerPromise(s,e.then(i=>t(i))):Rt.register(s,t(e))}function OZ(s,e){return vb.register(s,e)}function PZ(s,e){return wb.register(s,e)}function FZ(s,e){return yd.register(s,e)}function BZ(s,e){return wg.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 S(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),r.range||(r.range=new S(i.lineNumber,i.column,i.lineNumber,i.column)),r})}})}function WZ(s,e){return Vs.register(s,e)}function VZ(s,e){return Xc.register(s,e)}function HZ(s,e){return Sb.register(s,e)}function zZ(s,e){return Sg.register(s,e)}function UZ(s,e){return Lb.register(s,e)}function $Z(s,e){return Db.register(s,e)}function jZ(s,e){return Zr.register(s,e)}function KZ(s,e,t){return ar.register(s,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,provideCodeActions:(i,n,o,r)=>{let a=it.markerService.get().read({resource:i.uri}).filter(l=>S.areIntersectingOrTouching(l,n));return e.provideCodeActions(i,n,{markers:a,only:o.only},r)},resolveCodeAction:e.resolveCodeAction})}function qZ(s,e){return Wf.register(s,e)}function GZ(s,e){return ao.register(s,e)}function ZZ(s,e){return xb.register(s,e)}function YZ(s,e){return yg.register(s,e)}function XZ(s,e){return ro.register(s,e)}function QZ(s,e){return Qc.register(s,e)}function JZ(s,e){return J1.register(s,e)}function eY(s,e){return yb.register(s,e)}function tY(s,e){return JC.register(s,e)}function iY(s,e){return Jc.register(s,e)}function nY(s,e){return ev.register(s,e)}function sY(s,e){return hx.register(s,e)}function oY(s,e){return za.register(s,e)}function rY(){return{register:DZ,getLanguages:xZ,onLanguage:IZ,getEncodedLanguageId:kZ,setLanguageConfiguration:EZ,setColorMap:AZ,setTokensProvider:RZ,setMonarchTokensProvider:MZ,registerReferenceProvider:OZ,registerRenameProvider:PZ,registerCompletionItemProvider:XZ,registerSignatureHelpProvider:FZ,registerHoverProvider:BZ,registerDocumentSymbolProvider:WZ,registerDocumentHighlightProvider:VZ,registerLinkedEditingRangeProvider:HZ,registerDefinitionProvider:zZ,registerImplementationProvider:UZ,registerTypeDefinitionProvider:$Z,registerCodeLensProvider:jZ,registerCodeActionProvider:KZ,registerDocumentFormattingEditProvider:qZ,registerDocumentRangeFormattingEditProvider:GZ,registerOnTypeFormattingEditProvider:ZZ,registerLinkProvider:YZ,registerColorProvider:QZ,registerFoldingRangeProvider:JZ,registerDeclarationProvider:eY,registerSelectionRangeProvider:tY,registerDocumentSemanticTokensProvider:iY,registerDocumentRangeSemanticTokensProvider:nY,registerInlineCompletionsProvider:sY,registerInlayHintsProvider:oY,DocumentHighlightKind:d1,CompletionItemKind:n1,CompletionItemTag:s1,CompletionItemInsertTextRule:i1,SymbolKind:N1,SymbolTag:T1,IndentAction:g1,CompletionTriggerKind:o1,SignatureHelpTriggerKind:E1,InlayHintKind:p1,InlineCompletionTriggerKind:m1,FoldingRangeKind:vo}}class fu{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=fu._handleEolEdits(e,t);n.length===1&&fu._isFullModelReplaceEdit(e,n[0])?e.executeEdits("formatEditsCommand",n.map(o=>Ut.replace(S.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",n.map(o=>Ut.replaceMove(S.lift(o.range),o.text))),i&&e.pushUndoStop()}}class aS{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function Jk(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=S.plusRange(e,s[n].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?s.length===1?Ei(p("hint11","Made 1 formatting edit on line {0}",t)):Ei(p("hintn1","Made {0} formatting edits on line {1}",s.length,t)):s.length===1?Ei(p("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):Ei(p("hintnn","Made {0} formatting edits between lines {1} and {2}",s.length,t,i))}function N2(s){const e=[],t=new Set,i=Wf.ordered(s);for(const o of i)e.push(o),o.extensionId&&t.add(aS.toKey(o.extensionId));const n=ao.ordered(s);for(const o of n){if(o.extensionId){if(t.has(aS.toKey(o.extensionId)))continue;t.add(aS.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 Jd{static setFormatterSelector(e){return{dispose:Jd._selectors.unshift(e)}}static select(e,t,i){return yo(this,void 0,void 0,function*(){if(e.length===0)return;const n=Ue.first(Jd._selectors);if(n)return yield n(e,t,i)})}}Jd._selectors=new jn;function T2(s,e,t,i,n,o){return yo(this,void 0,void 0,function*(){const r=s.get(Ge),a=ur(e)?e.getModel():e,l=ao.ordered(a),d=yield Jd.select(l,a,i);d&&(n.report(d),yield r.invokeFunction(aY,d,e,t,o))})}function aY(s,e,t,i,n){return yo(this,void 0,void 0,function*(){const o=s.get(Ys);let r,a;ur(t)?(r=t.getModel(),a=new Zg(t,5,void 0,n)):(r=t,a=new wk(t,n));let l=[],d=0;for(let g of bx(i).sort(S.compareRangesUsingStarts))d>0&&S.areIntersectingOrTouching(l[d-1],g)?l[d-1]=S.fromPositions(l[d-1].getStartPosition(),g.getEndPosition()):d=l.push(g);const h=g=>yo(this,void 0,void 0,function*(){return(yield e.provideDocumentRangeFormattingEdits(r,g,r.getFormattingOptions(),a.token))||[]}),c=(g,m)=>{if(!g.length||!m.length)return!1;const _=g.reduce((C,b)=>S.plusRange(C,b.range),g[0].range);if(!m.some(C=>S.intersectRanges(_,C.range)))return!1;for(let C of g)for(let b of m)if(S.intersectRanges(C.range,b.range))return!0;return!1},u=[],f=[];try{for(let g of l){if(a.token.isCancellationRequested)return!0;f.push(yield h(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(c(f[g],f[m])){const _=S.plusRange(l[g],l[m]),C=yield h(_);l.splice(m,1),l.splice(g,1),l.push(_),f.splice(m,1),f.splice(g,1),f.push(C),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(ur(t))fu.execute(t,u,!0),Jk(u),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:g}]=u,m=new ne(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn);r.pushEditOperations([m],u.map(_=>({text:_.text,range:S.lift(_.range),forceMoveMarkers:!0})),_=>{for(const{range:C}of _)if(S.areIntersectingOrTouching(C,m))return[new ne(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return!0})}function lY(s,e,t,i,n){return yo(this,void 0,void 0,function*(){const o=s.get(Ge),r=ur(e)?e.getModel():e,a=N2(r),l=yield Jd.select(a,r,t);l&&(i.report(l),yield o.invokeFunction(dY,l,e,t,n))})}function dY(s,e,t,i,n){return yo(this,void 0,void 0,function*(){const o=s.get(Ys);let r,a;ur(t)?(r=t.getModel(),a=new Zg(t,5,void 0,n)):(r=t,a=new wk(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(ur(t))fu.execute(t,l,i!==2),i!==2&&(Jk(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:d}]=l,h=new ne(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);r.pushEditOperations([h],l.map(c=>({text:c.text,range:S.lift(c.range),forceMoveMarkers:!0})),c=>{for(const{range:u}of c)if(S.areIntersectingOrTouching(u,h))return[new ne(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn)];return null})}return!0})}function hY(s,e,t,i,n){return yo(this,void 0,void 0,function*(){const o=ao.ordered(e);for(const r of o){let a=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(e,t,i,n)).catch(Di);if(Tn(a))return yield s.computeMoreMinimalEdits(e.uri,a)}})}function cY(s,e,t,i){return yo(this,void 0,void 0,function*(){const n=N2(e);for(const o of n){let r=yield Promise.resolve(o.provideDocumentFormattingEdits(e,t,i)).catch(Di);if(Tn(r))return yield s.computeMoreMinimalEdits(e.uri,r)}})}function A2(s,e,t,i,n){const o=xb.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,Oe.None)).catch(Di).then(r=>s.computeMoreMinimalEdits(e.uri,r))}$e.registerCommand("_executeFormatRangeProvider",function(s,...e){return yo(this,void 0,void 0,function*(){const[t,i,n]=e;ut(me.isUri(t)),ut(S.isIRange(i));const o=s.get(Qn),r=s.get(Ys),a=yield o.createModelReference(t);try{return hY(r,a.object.textEditorModel,S.lift(i),n,Oe.None)}finally{a.dispose()}})});$e.registerCommand("_executeFormatDocumentProvider",function(s,...e){return yo(this,void 0,void 0,function*(){const[t,i]=e;ut(me.isUri(t));const n=s.get(Qn),o=s.get(Ys),r=yield n.createModelReference(t);try{return cY(o,r.object.textEditorModel,i,Oe.None)}finally{r.dispose()}})});$e.registerCommand("_executeFormatOnTypeProvider",function(s,...e){return yo(this,void 0,void 0,function*(){const[t,i,n,o]=e;ut(me.isUri(t)),ut(F.isIPosition(i)),ut(typeof n=="string");const r=s.get(Qn),a=s.get(Ys),l=yield r.createModelReference(t);try{return A2(a,l.object.textEditorModel,F.lift(i),n,o)}finally{l.dispose()}})});var lS;Do.wrappingIndent.defaultValue=0;Do.glyphMargin.defaultValue=!1;Do.autoIndent.defaultValue=3;Do.overviewRulerLanes.defaultValue=2;Jd.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const un=FR();un.editor=bZ();un.languages=rY();const uY=un.CancellationTokenSource,gu=un.Emitter,fY=un.KeyCode,gY=un.KeyMod,pY=un.Position,mY=un.Range,_Y=un.Selection,bY=un.SelectionDirection,CY=un.MarkerSeverity,vY=un.MarkerTag,wY=un.Uri,SY=un.Token,yY=un.editor,on=un.languages;(!((lS=Et.MonacoEnvironment)===null||lS===void 0)&&lS.globalAPI||typeof define=="function"&&define.amd)&&(self.monaco=un);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 LY="4.4.4",IL;(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"})(IL||(IL={}));var EL;(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"})(EL||(EL={}));var NL;(function(s){s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed"})(NL||(NL={}));var dp;(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"})(dp||(dp={}));var TL;(function(s){s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs"})(TL||(TL={}));var R2=function(){function s(e,t,i,n){this._onDidChange=new gu,this._onDidExtraLibsChange=new gu,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(n),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}),Object.defineProperty(s.prototype,"inlayHintsOptions",{get:function(){return this._inlayHintsOptions},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=window.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.setInlayHintsOptions=function(e){this._inlayHintsOptions=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}(),DY=LY,M2=new R2({allowNonTsExtensions:!0,target:dp.Latest},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),O2=new R2({allowNonTsExtensions:!0,allowJs:!0,target:dp.Latest},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{}),xY=function(){return Zv().then(function(s){return s.getTypeScriptWorker()})},kY=function(){return Zv().then(function(s){return s.getJavaScriptWorker()})};on.typescript={ModuleKind:IL,JsxEmit:EL,NewLineKind:NL,ScriptTarget:dp,ModuleResolutionKind:TL,typescriptVersion:DY,typescriptDefaults:M2,javascriptDefaults:O2,getTypeScriptWorker:xY,getJavaScriptWorker:kY};function Zv(){return ce(()=>import("./tsMode-B866h-rO.js"),__vite__mapDeps([0,1,2]))}on.onLanguage("typescript",function(){return Zv().then(function(s){return s.setupTypeScript(M2)})});on.onLanguage("javascript",function(){return Zv().then(function(s){return s.setupJavaScript(O2)})});var eI=function(){function s(e,t,i){this._onDidChange=new gu,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}(),tI={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}},iI={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},P2=new eI("css",tI,iI),F2=new eI("scss",tI,iI),B2=new eI("less",tI,iI);on.css={cssDefaults:P2,lessDefaults:B2,scssDefaults:F2};function nI(){return ce(()=>import("./cssMode-eBylpmo-.js"),__vite__mapDeps([3,1,2]))}on.onLanguage("less",function(){nI().then(function(s){return s.setupMode(B2)})});on.onLanguage("scss",function(){nI().then(function(s){return s.setupMode(F2)})});on.onLanguage("css",function(){nI().then(function(s){return s.setupMode(P2)})});var IY=function(){function s(e,t,i){this._onDidChange=new gu,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}(),EY={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},NY={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},W2=new IY("json",EY,NY);on.json={jsonDefaults:W2};function TY(){return ce(()=>import("./jsonMode-DTPlfJVi.js"),__vite__mapDeps([4,1,2]))}on.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});on.onLanguage("json",function(){TY().then(function(s){return s.setupMode(W2)})});var AY=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},RY=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(h){return l([d,h])}}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(h){d=[6,h],n=0}finally{i=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},MY=function(){function s(e,t,i){this._onDidChange=new gu,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}(),OY={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"},Yv={format:OY,suggest:{},data:{useDefaultDataProvider:!0}};function Xv(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===hg,documentFormattingEdits:s===hg,documentRangeFormattingEdits:s===hg}}var hg="html",GT="handlebars",ZT="razor",V2=Qv(hg,Yv,Xv(hg)),PY=V2.defaults,H2=Qv(GT,Yv,Xv(GT)),FY=H2.defaults,z2=Qv(ZT,Yv,Xv(ZT)),BY=z2.defaults;on.html={htmlDefaults:PY,razorDefaults:BY,handlebarDefaults:FY,htmlLanguageService:V2,handlebarLanguageService:H2,razorLanguageService:z2,registerHTMLLanguageService:Qv};function WY(){return ce(()=>import("./htmlMode-COQ-WmPk.js"),__vite__mapDeps([5,1,2]))}function Qv(s,e,t){var i=this;e===void 0&&(e=Yv),t===void 0&&(t=Xv(s));var n=new MY(s,e,t),o,r=on.onLanguage(s,function(){return AY(i,void 0,void 0,function(){return RY(this,function(a){switch(a.label){case 0:return[4,WY()];case 1:return o=a.sent().setupMode(n),[2]}})})});return{defaults:n,dispose:function(){r.dispose(),o==null||o.dispose(),o=void 0}}}var U2={},dS={},VY=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 dS[e]||(dS[e]=new s(e)),dS[e]},s.prototype.whenLoaded=function(){return this._lazyLoadPromise},s.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,U2[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;U2[e]=s,on.register(s);var t=VY.getOrCreate(e);on.setMonarchTokensProvider(e,t.whenLoaded().then(function(i){return i.language})),on.onLanguage(e,function(){t.load().then(function(i){on.setLanguageConfiguration(e,i.conf)})})}fe({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:function(){return ce(()=>import("./abap-CRCWOmpq.js"),[])}});fe({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:function(){return ce(()=>import("./apex-BL_CmIl-.js"),[])}});fe({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:function(){return ce(()=>import("./azcli-1IWB1ccx.js"),[])}});fe({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:function(){return ce(()=>import("./bat-DPkNLes8.js"),[])}});fe({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:function(){return ce(()=>import("./bicep-DLNwh9K6.js"),[])}});fe({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:function(){return ce(()=>import("./cameligo-CGrWLZr3.js"),[])}});fe({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:function(){return ce(()=>import("./clojure-D9WOWImG.js"),[])}});fe({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:function(){return ce(()=>import("./coffee-B7EJu28W.js"),[])}});fe({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:function(){return ce(()=>import("./cpp-RmZVvII3.js"),[])}});fe({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:function(){return ce(()=>import("./cpp-RmZVvII3.js"),[])}});fe({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:function(){return ce(()=>import("./csharp-BoL64M5l.js"),[])}});fe({id:"csp",extensions:[],aliases:["CSP","csp"],loader:function(){return ce(()=>import("./csp-C46ZqvIl.js"),[])}});fe({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:function(){return ce(()=>import("./css-yEtxmcUf.js"),[])}});fe({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:function(){return ce(()=>import("./dart-D8lhlL1r.js"),[])}});fe({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:function(){return ce(()=>import("./dockerfile-DLk6rpji.js"),[])}});fe({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:function(){return ce(()=>import("./ecl-BO6FnfXk.js"),[])}});fe({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:function(){return ce(()=>import("./elixir-B9GXSzSz.js"),[])}});fe({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:function(){return ce(()=>import("./flow9-Cac8vKd7.js"),[])}});fe({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:function(){return ce(()=>import("./fsharp-fd1GTHhf.js"),[])}});fe({id:"go",extensions:[".go"],aliases:["Go"],loader:function(){return ce(()=>import("./go-O9LJTZXk.js"),[])}});fe({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:function(){return ce(()=>import("./graphql-LQdxqEYJ.js"),[])}});fe({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:function(){return ce(()=>import("./handlebars-tICy3fok.js"),__vite__mapDeps([6,1,2]))}});fe({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:function(){return ce(()=>import("./hcl-DxDQ3s82.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 ce(()=>import("./html-CIhdV4Dm.js"),__vite__mapDeps([7,1,2]))}});fe({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:function(){return ce(()=>import("./ini-BvajGCUy.js"),[])}});fe({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:function(){return ce(()=>import("./java-SYsfObOQ.js"),[])}});fe({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return ce(()=>import("./javascript-6-OYjSbv.js"),__vite__mapDeps([8,9,1,2]))}});fe({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:function(){return ce(()=>import("./julia-DQXNmw_w.js"),[])}});fe({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:function(){return ce(()=>import("./kotlin-qQ0MG-9I.js"),[])}});fe({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:function(){return ce(()=>import("./less-B86-qBTk.js"),[])}});fe({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:function(){return ce(()=>import("./lexon-Canl7DCW.js"),[])}});fe({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:function(){return ce(()=>import("./lua-D28Ae8-K.js"),[])}});fe({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:function(){return ce(()=>import("./liquid-C1TmegDG.js"),__vite__mapDeps([10,1,2]))}});fe({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:function(){return ce(()=>import("./m3-DPitgjJI.js"),[])}});fe({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:function(){return ce(()=>import("./markdown-XFFkuszK.js"),[])}});fe({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:function(){return ce(()=>import("./mips-CdjsipkG.js"),[])}});fe({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:function(){return ce(()=>import("./msdax-CYqgjx_P.js"),[])}});fe({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:function(){return ce(()=>import("./mysql-uE-sL1AK.js"),[])}});fe({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:function(){return ce(()=>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 ce(()=>import("./pascal-BhNW15KB.js"),[])}});fe({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:function(){return ce(()=>import("./pascaligo-5jv8CcQD.js"),[])}});fe({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:function(){return ce(()=>import("./perl-DlYyT36c.js"),[])}});fe({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:function(){return ce(()=>import("./pgsql-DYSgOGm2.js"),[])}});fe({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:function(){return ce(()=>import("./php-120yhfDK.js"),[])}});fe({id:"pla",extensions:[".pla"],loader:function(){return ce(()=>import("./pla-CjnFlu4u.js"),[])}});fe({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:function(){return ce(()=>import("./postiats-CQpG440k.js"),[])}});fe({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:function(){return ce(()=>import("./powerquery-DdJtto1Z.js"),[])}});fe({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:function(){return ce(()=>import("./powershell-Bu_VLpJB.js"),[])}});fe({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:function(){return ce(()=>import("./protobuf-UZVfc1EA.js"),[])}});fe({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:function(){return ce(()=>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 ce(()=>import("./python-BH2HFM7y.js"),__vite__mapDeps([11,1,2]))}});fe({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:function(){return ce(()=>import("./qsharp-BhgV_cYv.js"),[])}});fe({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:function(){return ce(()=>import("./r-BIFz-_sK.js"),[])}});fe({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:function(){return ce(()=>import("./razor-DGcNB0iQ.js"),__vite__mapDeps([12,1,2]))}});fe({id:"redis",extensions:[".redis"],aliases:["redis"],loader:function(){return ce(()=>import("./redis-CHOsPHWR.js"),[])}});fe({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:function(){return ce(()=>import("./redshift-w2XKkDvD.js"),[])}});fe({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:function(){return ce(()=>import("./restructuredtext-CghPJEOS.js"),[])}});fe({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:function(){return ce(()=>import("./ruby-CYWGW-b1.js"),[])}});fe({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:function(){return ce(()=>import("./rust-DMDD0SHb.js"),[])}});fe({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:function(){return ce(()=>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 ce(()=>import("./scala-Bqvq8jcR.js"),[])}});fe({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:function(){return ce(()=>import("./scheme-Dhb-2j9p.js"),[])}});fe({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:function(){return ce(()=>import("./scss-CdQcnAnq.js"),[])}});fe({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:function(){return ce(()=>import("./shell-CmmbcNmB.js"),[])}});fe({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:function(){return ce(()=>import("./solidity-CME5AdoB.js"),[])}});fe({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:function(){return ce(()=>import("./sophia-RYC1BQQz.js"),[])}});fe({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:function(){return ce(()=>import("./sparql-KEyrF7De.js"),[])}});fe({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:function(){return ce(()=>import("./sql-BdTr02Mf.js"),[])}});fe({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:function(){return ce(()=>import("./st-C8kzSboH.js"),[])}});fe({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:function(){return ce(()=>import("./swift-vE6e-x0J.js"),[])}});fe({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:function(){return ce(()=>import("./systemverilog-DgMryOEJ.js"),[])}});fe({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:function(){return ce(()=>import("./systemverilog-DgMryOEJ.js"),[])}});fe({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:function(){return ce(()=>import("./tcl-PloMZuKG.js"),[])}});fe({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:function(){return ce(()=>import("./twig-bne2BnKZ.js"),[])}});fe({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:function(){return ce(()=>import("./typescript-hltC-XIV.js"),__vite__mapDeps([9,1,2]))}});fe({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:function(){return ce(()=>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 ce(()=>import("./xml-CRrmAUmf.js"),__vite__mapDeps([13,1,2]))}});fe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:function(){return ce(()=>import("./yaml-A89blxgn.js"),[])}});var HY=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},zY=function(s,e){return function(t,i){e(t,i,s)}},Jv=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const ew=new re("selectionAnchorSet",!1);let _a=class $2{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ew.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(e){return e.getContribution($2.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],i=this.editor.deltaDecorations(t,[{range:ne.fromPositions(e,e),options:{description:"selection-anchor",stickiness:1,hoverMessage:new ma().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"}}]);this.decorationId=i[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),Ei(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(ne.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()}};_a.ID="editor.contrib.selectionAnchorController";_a=HY([zY(1,ve)],_a);class UY extends oe{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2080),weight:100}})}run(e,t){return Jv(this,void 0,void 0,function*(){_a.get(t).setSelectionAnchor()})}}class $Y extends oe{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ew})}run(e,t){return Jv(this,void 0,void 0,function*(){_a.get(t).goToSelectionAnchor()})}}class jY extends oe{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ew,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2089),weight:100}})}run(e,t){return Jv(this,void 0,void 0,function*(){_a.get(t).selectFromAnchorToCursor()})}}class KY extends oe{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ew,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}run(e,t){return Jv(this,void 0,void 0,function*(){_a.get(t).cancelSelectionAnchor()})}}nt(_a.ID,_a);ee(UY);ee($Y);ee(jY);ee(KY);const qY=R("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class GY extends oe{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=bo.get(t);i&&i.jumpToBracket()}}class ZY extends oe{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=bo.get(t);if(!n)return;let o=!0;i&&i.selectBrackets===!1&&(o=!1),n.selectToBracket(o)}}class YY{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class bo extends H{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new Lt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(63),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(63)&&(this._matchBrackets=this._editor.getOption(63),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}static get(e){return e.getContribution(bo.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 ne(r.lineNumber,r.column,r.lineNumber,r.column):new ne(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(S.compareRangesUsingStarts);const[d,h]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(o)){const c=a;a=l,l=c}}a&&l&&i.push(new ne(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._editor.hasWidgetFocus()){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 c=0,u=e.length;c<u;c++){let f=e[c];f.isEmpty()&&(o[r++]=f.getStartPosition())}o.length>1&&o.sort(F.compare);let a=[],l=0,d=0,h=n.length;for(let c=0,u=o.length;c<u;c++){let f=o[c];for(;d<h&&n[d].position.isBefore(f);)d++;if(d<h&&n[d].position.equals(f))a[l++]=n[d];else{let g=t.matchBracket(f),m=bo._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=t.findEnclosingBrackets(f,20),m=bo._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new YY(f,g,m)}}this._lastBracketsData=a,this._lastVersionId=i}}bo.ID="editor.contrib.bracketMatchingController";bo._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ee.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:$t(qY),position:Xn.Center}});bo._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ee.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});nt(bo.ID,bo);ee(ZY);ee(GY);st((s,e)=>{const t=s.getColor(O6);t&&e.addRule(`.monaco-editor .bracket-match { background-color: ${t}; }`);const i=s.getColor(YO);i&&e.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)});ps.appendMenuItem(ae.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class XY{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 S(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new S(i,o,i,o),a)}else{const r=new S(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new S(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ne(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ne(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class j2 extends oe{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 XY(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class QY extends j2{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:E.writable})}}class JY extends j2{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:E.writable})}}ee(QY);ee(JY);class eX extends oe{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:E.writable,kbOpts:{kbExpr:E.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 h=l===d?r.getPosition():Xe.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),c=Xe.leftPosition(i,h),u=Xe.leftPosition(i,c),f=i.getValueInRange(S.fromPositions(u,c)),g=i.getValueInRange(S.fromPositions(c,h)),m=S.fromPositions(u,h);n.push(new xi(m,g+f))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}ee(eX);var tX=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const eh="9_cutcopypaste",iX=uo||document.queryCommandSupported("cut"),K2=uo||document.queryCommandSupported("copy"),nX=typeof navigator.clipboard>"u"||rn?document.queryCommandSupported("paste"):!0;function sI(s){return s.register(),s}const sX=iX?sI(new Mu({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:uo?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:ae.MenubarEditMenu,group:"2_ccp",title:p({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:ae.EditorContext,group:eh,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1},{menuId:ae.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:ae.SimpleEditorContext,group:eh,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1}]})):void 0,oX=K2?sI(new Mu({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:uo?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:ae.MenubarEditMenu,group:"2_ccp",title:p({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:ae.EditorContext,group:eh,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:ae.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:ae.SimpleEditorContext,group:eh,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ps.appendMenuItem(ae.MenubarEditMenu,{submenu:ae.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});ps.appendMenuItem(ae.EditorContext,{submenu:ae.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:eh,order:3});const hS=nX?sI(new Mu({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:uo?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:ae.MenubarEditMenu,group:"2_ccp",title:p({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:ae.EditorContext,group:eh,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4},{menuId:ae.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:ae.SimpleEditorContext,group:eh,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4}]})):void 0;class rX extends oe{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:E.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(32)&&t.getSelection().isEmpty()||(Ty.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),Ty.forceCopyWithSyntaxHighlighting=!1)}}function q2(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(tt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(32),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)))}q2(sX,"cut");q2(oX,"copy");hS&&(hS.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(tt),i=s.get(Al),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!document.execCommand("paste")&&Nu?tX(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=Bg.INSTANCE.get(r);let l=!1,d=null,h=null;a&&(l=n.getOption(32)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,h=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:h})}}):!0:!1}),hS.addImplementation(0,"generic-dom",(s,e)=>(document.execCommand("paste"),!0)));K2&&ee(rX);class TC{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 We{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+We.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new We(this.value+We.sep+e)}}We.sep=".";We.None=new We("@@none@@");We.Empty=new We("");We.QuickFix=new We("quickfix");We.Refactor=new We("refactor");We.Source=new We("source");We.SourceOrganizeImports=We.Source.append("organizeImports");We.SourceFixAll=We.Source.append("fixAll");function aX(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>G2(e,t,s.include))||!s.includeSourceActions&&We.Source.contains(e))}function lX(s,e){const t=e.kind?new We(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>G2(t,i,s.include))||!s.includeSourceActions&&t&&We.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function G2(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class Jo{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return!e||typeof e!="object"?new Jo(t.kind,t.apply,!1):new Jo(Jo.getKindFromUser(e,t.kind),Jo.getApplyFromUser(e,t.apply),Jo.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 We(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}}var oI=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Z2="editor.action.codeAction",Y2="editor.action.refactor",X2="editor.action.sourceAction",rI="editor.action.organizeImports",aI="editor.action.fixAll";class Q2{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return oI(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){Di(n)}i&&(this.action.edit=i.edit)}return this})}}class lI extends H{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(lI.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:Tn(e.diagnostics)?Tn(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:Tn(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&We.QuickFix.contains(new We(e.kind))&&!!e.isPreferred)}}const YT={actions:[],documentation:void 0};function dI(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 wk(s,n),d=dX(s,r),h=new X,c=d.map(f=>oI(this,void 0,void 0,function*(){try{i.report(f);const g=yield f.provideCodeActions(s,e,a,l.token);if(g&&h.add(g),l.token.isCancellationRequested)return YT;const m=((g==null?void 0:g.actions)||[]).filter(C=>C&&lX(r,C)),_=hX(f,m,r.include);return{actions:m.map(C=>new Q2(C,f)),documentation:_}}catch(g){if(br(g))throw g;return Di(g),YT}})),u=ar.onDidChange(()=>{const f=ar.all(s);zs(f,d)||l.cancel()});return Promise.all(c).then(f=>{const g=_x(f.map(_=>_.actions)),m=vh(f.map(_=>_.documentation));return new lI(g,m,h)}).finally(()=>{u.dispose(),l.dispose()})}function dX(s,e){return ar.all(s).filter(t=>t.providedCodeActionKinds?t.providedCodeActionKinds.some(i=>aX(e,new We(i))):!0)}function hX(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new We(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 We(n.kind)))return o.command}}$e.registerCommand("_executeCodeActionProvider",function(s,e,t,i,n){return oI(this,void 0,void 0,function*(){if(!(e instanceof me))throw fo();const o=s.get(ri).getModel(e);if(!o)throw fo();const r=ne.isISelection(t)?ne.liftSelection(t):S.isIRange(t)?o.validateRange(t):void 0;if(!r)throw fo();const a=typeof i=="string"?new We(i):void 0,l=yield dI(o,r,{type:1,filter:{includeSourceActions:!0,include:a}},xh.None,Oe.None),d=[],h=Math.min(l.validActions.length,typeof n=="number"?n:0);for(let c=0;c<h;c++)d.push(l.validActions[c].resolve(Oe.None));try{return yield Promise.all(d),l.validActions.map(c=>c.action)}finally{setTimeout(()=>l.dispose(),100)}})});var cX=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)}};let is=class AL{constructor(e,t){this._messageWidget=new dn,this._messageListeners=new X,this._editor=e,this._visible=AL.MESSAGE_VISIBLE.bindTo(t),this._editorListener=this._editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit())}static get(e){return e.getContribution(AL.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Ei(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new XT(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 hn(()=>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 S(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(XT.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(p("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};is.ID="editor.contrib.messageController";is.MESSAGE_VISIBLE=new re("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));is=cX([uX(1,ve)],is);const fX=Mi.bindToContribution(is.get);J(new fX({id:"leaveEditorMessage",precondition:is.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let XT=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)}};nt(is.ID,is);st((s,e)=>{const t=s.getColor(Yx);if(t){let o=s.type===gs.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(Gx);i&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${i}; }`);const n=s.getColor(Zx);n&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${n}; }`)});var gX=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},QT=function(s,e){return function(t,i){e(t,i,s)}},pX=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class JT extends Us{constructor(e,t){super(e.command?e.command.id:e.title,mX(e.title),void 0,!e.disabled,t),this.action=e}}function mX(s){return s.replace(/\r\n|\r|\n/g," ")}let RL=class extends H{constructor(e,t,i,n){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._visible=!1,this._showingActions=this._register(new dn),this._keybindingResolver=new tw({getKeybindings:()=>n.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,n){return pX(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,Au();this._visible=!0,this._showingActions.value=t;const r=this.getMenuActions(e,o,t.documentation),a=F.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},l=this._keybindingResolver.getResolver(),d=this._editor.getOption(113);this._contextMenuService.showContextMenu({domForShadowRoot:d?this._editor.getDomNode():void 0,getAnchor:()=>a,getActions:()=>r,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:h=>h instanceof JT?l(h.action):void 0})})}getMenuActions(e,t,i){var n,o;const r=h=>new JT(h.action,()=>this._delegate.onSelectCodeAction(h)),a=t.map(r),l=[...i],d=this._editor.getModel();if(d&&a.length)for(const h of ar.all(d))h._getAdditionalMenuItems&&l.push(...h._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(c=>c.action)));return l.length&&a.push(new $s,...l.map(h=>r(new Q2({title:h.title,command:h},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=Ii(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,y:o}}};RL=gX([QT(2,Tl),QT(3,Nt)],RL);class tw{constructor(e){this._keybindingProvider=e}getResolver(){const e=new TC(()=>this._keybindingProvider.getKeybindings().filter(t=>tw.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===rI?i={kind:We.SourceOrganizeImports.value}:t.command===aI&&(i={kind:We.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Jo.fromUser(i,{kind:We.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 We(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)}}tw.codeActionCommands=[Y2,Z2,X2,rI,aI];var _X=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},bX=function(s,e){return function(t,i){e(t,i,s)}},cg;(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})(cg||(cg={}));let AC=class J2 extends H{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=cg.Hidden,this._domNode=document.createElement("div"),this._domNode.className=ie.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()})),lt.ignoreTarget(this._domNode),this._register(a3(this._domNode,o=>{if(this.state.type!==1)return;this._editor.focus(),o.preventDefault();const{top:r,height:a}=Ii(this._domNode),l=this._editor.getOption(58);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(q(this._domNode,"mouseenter",o=>{if((o.buttons&1)!==1)return;this.hide();const r=new Lh;r.startMonitoring(o.target,o.buttons,Ou,()=>{},()=>{r.dispose()})})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(56)&&!this._editor.getOption(56).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(56).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(43),h=o.getLineContent(r),c=ts.computeIndentLevel(h,l),u=d.spaceWidth*c>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 cg.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:J2._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=cg.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(...ie.lightBulb.classNamesArray),this._domNode.classList.add(...ie.lightbulbAutofix.classNamesArray);const t=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(t){this.title=p("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",t.getLabel());return}}this._domNode.classList.remove(...ie.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...ie.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);e?this.title=p("codeActionWithKb","Show Code Actions ({0})",e.getLabel()):this.title=p("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};AC._posPref=[0];AC=_X([bX(3,Nt)],AC);st((s,e)=>{var t;const i=(t=s.getColor(ms))===null||t===void 0?void 0:t.transparent(.7),n=s.getColor(M9);n&&e.addRule(`
  539. .monaco-editor .contentWidgets ${ie.lightBulb.cssSelector} {
  540. color: ${n};
  541. background-color: ${i};
  542. }`);const o=s.getColor(O9);o&&e.addRule(`
  543. .monaco-editor .contentWidgets ${ie.lightbulbAutofix.cssSelector} {
  544. color: ${o};
  545. background-color: ${i};
  546. }`)});var CX=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},vX=function(s,e){return function(t,i){e(t,i,s)}},cS=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},wX=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},SX=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)},$_;let ML=class extends H{constructor(e,t,i,n,o){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new dn),$_.set(this,!1),this._codeActionWidget=new TC(()=>this._register(o.createInstance(RL,this._editor,{onSelectCodeAction:r=>cS(this,void 0,void 0,function*(){this.delegate.applyCodeAction(r,!0)})}))),this._lightBulbWidget=new TC(()=>{const r=this._register(o.createInstance(AC,this._editor,t,i));return this._register(r.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1}))),r})}dispose(){wX(this,$_,!0,"f"),super.dispose()}update(e){var t,i,n;return cS(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){Le(r);return}if(!SX(this,$_,"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{this._lightBulbWidget.getValue().hide(),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){is.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)){is.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 cS(this,void 0,void 0,function*(){this._codeActionWidget.getValue().show(e,t,i,n)})}};$_=new WeakMap;ML=CX([vX(4,Ge)],ML);var uS=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)},yX=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},gc;const eF=new re("supportedCodeAction","");class LX extends H{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new hn),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=>lM(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(S.intersectRanges(n,e))return S.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 ad;(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(br(a))return DX;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=e})(ad||(ad={}));const DX={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class xX extends H{constructor(e,t,i,n){super(),this._editor=e,this._markerService=t,this._progressService=n,this._codeActionOracle=this._register(new dn),this._state=ad.Empty,this._onDidChangeState=this._register(new M),this.onDidChangeState=this._onDidChangeState.event,gc.set(this,!1),this._supportedCodeActions=eF.bindTo(i),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(ar.onDidChange(()=>this._update())),this._update()}dispose(){uS(this,gc,"f")||(yX(this,gc,!0,"f"),super.dispose(),this.setState(ad.Empty,!0))}_update(){if(uS(this,gc,"f"))return;this._codeActionOracle.value=void 0,this.setState(ad.Empty);const e=this._editor.getModel();if(e&&ar.has(e)&&!this._editor.getOption(80)){const t=[];for(const i of ar.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new LX(this._editor,this._markerService,i=>{var n;if(!i){this.setState(ad.Empty);return}const o=gi(r=>dI(e,i.selection,i.trigger,xh.None,r));i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(o,250)),this.setState(new ad.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&&!uS(this,gc,"f")&&this._onDidChangeState.fire(e))}}gc=new WeakMap;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},Qm=function(s,e){return function(t,i){e(t,i,s)}},tF=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function Jp(s){return te.regex(eF.keys()[0],new RegExp("(\\s|^)"+Ks(s.value)+"\\b"))}const hI={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 th=class iF extends H{constructor(e,t,i,n,o){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new xX(this._editor,t,i,n)),this._register(this._model.onDidChangeState(r=>this.update(r))),this._ui=new TC(()=>this._register(new ML(e,Vu.Id,em.Id,{applyCodeAction:(r,a)=>tF(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(iF.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;is.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(IX,e,this._editor)}};th.ID="editor.contrib.quickFixController";th=kX([Qm(1,Xp),Qm(2,ve),Qm(3,Ca),Qm(4,Ge)],th);function IX(s,e,t){return tF(this,void 0,void 0,function*(){const i=s.get(yx),n=s.get(Yt),o=s.get(El),r=s.get(ni);if(o.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred}),yield e.resolve(Oe.None),e.action.edit&&(yield i.apply(lv.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=EX(a);r.error(typeof l=="string"?l:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function EX(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}function Ah(s,e,t,i){if(s.hasModel()){const n=th.get(s);n&&n.manualTriggerAtCurrentPosition(e,t,i)}}class Vu extends oe{constructor(){super({id:Vu.Id,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:te.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:2132,weight:100}})}run(e,t){return Ah(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0)}}Vu.Id="editor.action.quickFix";class NX extends Mi{constructor(){super({id:Z2,precondition:te.and(E.writable,E.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:hI}]}})}runEditorCommand(e,t,i){const n=Jo.fromUser(i,{kind:We.Empty,apply:"ifSingle"});return Ah(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 TX extends oe{constructor(){super({id:Y2,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:te.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:te.and(E.writable,Jp(We.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:hI}]}})}run(e,t,i){const n=Jo.fromUser(i,{kind:We.Refactor,apply:"never"});return Ah(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:We.Refactor.contains(n.kind)?n.kind:We.None,onlyIncludePreferredActions:n.preferred},n.apply)}}class AX extends oe{constructor(){super({id:X2,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:te.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:te.and(E.writable,Jp(We.Source))},description:{description:"Source Action...",args:[{name:"args",schema:hI}]}})}run(e,t,i){const n=Jo.fromUser(i,{kind:We.Source,apply:"never"});return Ah(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:We.Source.contains(n.kind)?n.kind:We.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class RX extends oe{constructor(){super({id:rI,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:te.and(E.writable,Jp(We.SourceOrganizeImports)),kbOpts:{kbExpr:E.editorTextFocus,primary:1581,weight:100}})}run(e,t){return Ah(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:We.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}class MX extends oe{constructor(){super({id:aI,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:te.and(E.writable,Jp(We.SourceFixAll))})}run(e,t){return Ah(t,p("fixAll.noneMessage","No fix all action available"),{include:We.SourceFixAll,includeSourceActions:!0},"ifSingle")}}class em extends oe{constructor(){super({id:em.Id,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:te.and(E.writable,Jp(We.QuickFix)),kbOpts:{kbExpr:E.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return Ah(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:We.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}em.Id="editor.action.autoFix";nt(th.ID,th);ee(Vu);ee(TX);ee(AX);ee(RX);ee(em);ee(MX);J(new NX);var eA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class OL{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 nF(s,e){return eA(this,void 0,void 0,function*(){const t=Zr.ordered(s),i=new Map,n=new OL,o=t.map((r,a)=>eA(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){Di(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})}$e.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;ut(me.isUri(t)),ut(typeof i=="number"||!i);const n=s.get(ri).getModel(t);if(!n)throw fo();const o=[],r=new X;return nF(n,Oe.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,Oe.None)).then(h=>o.push(h||d.symbol)));return Promise.all(l)}).then(()=>o).finally(()=>{setTimeout(()=>r.dispose(),100)})});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},PX=function(s,e){return function(t,i){e(t,i,s)}};const sF=Je("ICodeLensCache");class tA{constructor(e,t){this.lineCount=e,this.data=t}}let PL=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new kl(20,.75);const t="codelens/cache";cb(()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ha(e.onWillSaveState)(o=>{o.reason===EC.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 OL;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new tA(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 S(a,1,a,11)});const r=new OL;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new tA(n.lineCount,r))}}catch{}}};PL=OX([PX(0,yr)],PL);Il(sF,PL);class FX{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())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class iw{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${iw._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=Rd(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?(al(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):al(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}}iw._idPool=0;class fS{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 iA{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((h,c)=>{h.symbol.command&&d.push(h.symbol),n.addDecoration({range:h.symbol.range,options:Ee.EMPTY},u=>this._decorationIds[c]=u),l?l=S.plusRange(l,h.symbol.range):l=S.lift(h.symbol.range)}),this._viewZone=new FX(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 iw(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&&S.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:Ee.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.isVisible())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}}st((s,e)=>{const t=s.getColor(M6);t&&(e.addRule(`.monaco-editor .codelens-decoration { color: ${t}; }`),e.addRule(`.monaco-editor .codelens-decoration .codicon { color: ${t}; }`));const i=s.getColor(ik);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 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},gS=function(s,e){return function(t,i){e(t,i,s)}},WX=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let pu=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 _b(Zr,250,2500),this._oldCodeLensModels=new X,this._resolveCodeLensesDelays=new _b(Zr,250,2500),this._resolveCodeLensesScheduler=new Lt(()=>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(43)||o.hasChanged(16)||o.hasChanged(15))&&this._updateLensStyle(),o.hasChanged(14)&&this._onModelChange()})),this._disposables.add(Zr.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+ax(this._editor.getId()).toString(16),this._styleElement=Yn(GC(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(16),t;return!e||e<5?(e=this._editor.getOption(45)*.9|0,t=this._editor.getOption(58)):t=e*Math.max(1.3,this._editor.getOption(58)/this._editor.getOption(45))|0,{codeLensHeight:t,fontSize:e}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(15),n=this._editor.getOption(43),o=`--codelens-font-family${this._styleClassName}`,r=`--codelens-font-features${this._styleClassName}`;let a=`
  547. .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}) }
  548. .monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }
  549. `;i&&(a+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o}), ${Hi.fontFamily}}`),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(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!Zr.has(e)){t&&this._localToDispose.add(Bd(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of Zr.all(e))if(typeof n.onDidChange=="function"){let o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Lt(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=gi(r=>nF(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._resolveCodeLensesInViewportSoon()},Le)},this._getCodeLensModelDelays.get(e));this._localToDispose.add(i),this._localToDispose.add(Ve(()=>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 fS;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(Ve(()=>{if(this._editor.getModel()){const n=gl.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 fS;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=gl.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new fS;let h=0,c=0;for(;c<i.length&&h<this._lenses.length;){let u=i[c][0].symbol.range.startLineNumber,f=this._lenses[h].getLineNumber();f<u?(this._lenses[h].dispose(d,l),this._lenses.splice(h,1)):f===u?(this._lenses[h].updateCodeLensSymbols(i[c],d),c++,h++):(this._lenses.splice(h,0,new iA(i[c],this._editor,this._styleClassName,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++,c++)}for(;h<this._lenses.length;)this._lenses[h].dispose(d,l),this._lenses.splice(h,1);for(;c<i.length;)this._lenses.push(new iA(i[c],this._editor,this._styleClassName,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++;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=gi(a=>{const l=i.map((d,h)=>{const c=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=>{c[g]=m},Di):(c[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[h].isDisposed()&&n[h].updateCommands(c)})});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=>{Le(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getLenses(){return this._lenses}};pu.ID="css.editor.codeLens";pu=BX([gS(1,Yt),gS(2,ni),gS(3,sF)],pu);nt(pu.ID,pu);ee(class extends oe{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:E.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return WX(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Rl),n=e.get(Yt),o=e.get(ni),r=t.getSelection().positionLineNumber,a=t.getContribution(pu.ID),l=[];for(let h of a.getLenses())if(h.getLineNumber()===r)for(let c of h.getItems()){const{command:u}=c.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(h){o.error(h)}})}});function VX(s,e){const t=[],n=Qc.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 nA(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}$e.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof me))throw fo();const i=s.get(ri).getModel(t);if(!i)throw fo();const n=[],r=Qc.ordered(i).reverse().map(a=>Promise.resolve(a.provideDocumentColors(i,Oe.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)});$e.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof me)||!Array.isArray(t)||t.length!==4||!S.isIRange(o))throw fo();const[r,a,l,d]=t,h=s.get(ri).getModel(n);if(!h)throw fo();const c={range:o,color:{red:r,green:a,blue:l,alpha:d}},u=[],g=Qc.ordered(h).reverse().map(m=>Promise.resolve(m.provideColorPresentations(h,c,Oe.None)).then(_=>{Array.isArray(_)&&u.push(..._)}));return Promise.all(g).then(()=>u)});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},sA=function(s,e){return function(t,i){e(t,i,s)}};const zX=500;let ih=class oF extends H{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(Qc.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.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(17)}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||!Qc.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new hn,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},oF.RECOMPUTE_TIME))})),this.beginCompute())}beginCompute(){this._computePromise=gi(e=>{const t=this._editor.getModel();return t?VX(t,e):Promise.resolve([])}),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},Le)}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:Ee.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<zX;n++){const{red:o,green:r,blue:a,alpha:l}=e[n].colorInfo.color,d=new Be(Math.round(o*255),Math.round(r*255),Math.round(a*255),l);let h=ax(`rgba(${d.r},${d.g},${d.b},${d.a})`).toString(16),c=`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`,u="colorBox-"+h;!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:c},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(S.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}};ih.ID="editor.contrib.colorDetector";ih.RECOMPUTE_TIME=1e3;ih=HX([sA(1,tt),sA(2,Vt)],ih);nt(ih.ID,ih);function FL(s,e){return!!s[e]}class pS{constructor(e,t){this.target=e.target,this.hasTriggerModifier=FL(e.event,t.triggerModifier),this.hasSideBySideModifier=FL(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class oA{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=FL(e,t.triggerModifier)}}class Jm{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 rA(s){return s==="altKey"?Me?new Jm(57,"metaKey",6,"altKey"):new Jm(5,"ctrlKey",6,"altKey"):Me?new Jm(6,"altKey",57,"metaKey"):new Jm(6,"altKey",5,"ctrlKey")}class rF extends H{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=rA(this._editor.getOption(69)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(t=>{if(t.hasChanged(69)){const i=rA(this._editor.getOption(69));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 pS(t,this._opts)))),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(new pS(t,this._opts)))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(new pS(t,this._opts)))),this._register(this._editor.onKeyDown(t=>this._onEditorKeyDown(new oA(t,this._opts)))),this._register(this._editor.onKeyUp(t=>this._onEditorKeyUp(new oA(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 UX=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},ql=function(s,e){return function(t,i){e(t,i,s)}};let nh=class extends Gg{constructor(e,t,i,n,o,r,a,l,d,h){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,r,a,l,d,h),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(c=>this._onParentConfigurationChanged(c)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){xo(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};nh=UX([ql(3,Ge),ql(4,tt),ql(5,Yt),ql(6,ve),ql(7,Dt),ql(8,ni),ql(9,On)],nh);const aA=new W(new Be(0,122,204)),$X={showArrow:!0,showFrame:!0,className:"",frameColor:aA,arrowColor:aA,keepEditorSelection:!1},jX="vs.editor.contrib.zoneWidget";class KX{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 qX{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class nw{constructor(e){this._editor=e,this._ruleName=nw._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),ub(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(){ub(this._ruleName),z1(`.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:S.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}nw._IdGenerator=new Gk(".arrow-decoration-");class GX{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=Fa(t),xo(this.options,$X,!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 nw(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=S.isIRange(e)?S.lift(e):S.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:Ee.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(58),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(58),l=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,l);let d=0,h=0;if(this._arrow&&this.options.showArrow&&(d=Math.round(a/3),this._arrow.height=d,this._arrow.show(i)),this.options.showFrame&&(h=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 KX(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g)),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new qX(jX+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:h;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}let c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=d+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,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 Wi(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(58),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 ZX extends iu{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new M),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=U(e,Y(".monaco-dropdown")),this._label=U(this._element,Y(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[ue.CLICK,ue.MOUSE_DOWN,vt.Tap])this._register(q(this.element,o,r=>rt.stop(r,!0)));for(const o of[ue.MOUSE_DOWN,vt.Tap])this._register(q(this._label,o,r=>{r instanceof MouseEvent&&r.detail>1||(this.visible?this.hide():this.show())}));this._register(q(this._label,ue.KEY_UP,o=>{const r=new Ot(o);(r.equals(3)||r.equals(10))&&(rt.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(lt.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 YX extends ZX{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 aF extends Ad{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=U(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 YX(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 cI=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},qo=function(s,e){return function(t,i){e(t,i,s)}},lF=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function XX(s,e,t,i,n,o,r){const a=s.getActions(e);return JX(a,t,!1,i,n,o,r),QX(a)}function QX(s){const e=new X;for(const[,t]of s)for(const i of t)e.add(i);return e}function JX(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[h,c]of s){let u;i(h)?(u=a,u.length>0&&r&&u.push(new $s)):(u=l,u.length>0&&u.push(new $s));for(let f of c){const g=u.push(f);f instanceof Cv&&d.add({group:h,action:f,index:g-1})}}for(const{group:h,action:c,index:u}of d){const f=i(h)?a:l,g=c.actions;(g.length<=1||f.length+g.length-2<=n)&&o(c,h,f.length)&&f.splice(u,1,...g)}if(a!==l&&a.length>n){const h=a.splice(n,a.length-n);l.unshift(...h,new $s)}}let mu=class extends Yg{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 dn),this._altKey=cd.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return lF(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||(Ai||Cn)&&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||(Ai||Cn)&&o.shiftKey,n()})),this._register(q(e,"mouseleave",o=>{t=!1,n()})),this._register(q(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+=`
  550. [${Ix.modifierLabels[Ms].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(kt.isThemeIcon(o)){const r=kt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=Ve(()=>{n.classList.remove(...r)})}else o.light&&n.style.setProperty("--menu-entry-icon-light",ua(o.light)),o.dark&&n.style.setProperty("--menu-entry-icon-dark",ua(o.dark)),n.classList.add("icon"),this._itemClassDispose.value=Ve(()=>{n.classList.remove("icon"),n.style.removeProperty("--menu-entry-icon-light"),n.style.removeProperty("--menu-entry-icon-dark")})}};mu=cI([qo(2,Nt),qo(3,ni),qo(4,ve)],mu);let BL=class extends aF{constructor(e,t,i){var n,o;const r=Object.assign({},t??Object.create(null),{menuAsChild:(n=t==null?void 0:t.menuAsChild)!==null&&n!==void 0?n:!1,classNames:(o=t==null?void 0:t.classNames)!==null&&o!==void 0?o:kt.isThemeIcon(e.item.icon)?kt.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,r)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!kt.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",ua(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",ua(t.dark)))}}};BL=cI([qo(2,Tl)],BL);let WL=class extends Ad{constructor(e,t,i,n,o,r,a,l){var d,h,c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let u,f=l.get(this._storageKey,1);f&&(u=e.actions.find(m=>f===m.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(mu,u,void 0);const g=Object.assign({},t??Object.create(null),{menuAsChild:(d=t==null?void 0:t.menuAsChild)!==null&&d!==void 0?d:!0,classNames:(h=t==null?void 0:t.classNames)!==null&&h!==void 0?h:["codicon","codicon-chevron-down"],actionRunner:(c=t==null?void 0:t.actionRunner)!==null&&c!==void 0?c:new iu});this._dropdown=new aF(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof Ud&&this.update(m.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(mu,e,void 0),this._defaultAction.actionRunner=new class extends iu{runAction(t,i){return lF(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render(C3(this._container,Y(".action-container")))}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=Y(".action-container");this._defaultAction.render(U(this._container,t)),this._register(q(t,ue.KEY_DOWN,n=>{const o=new Ot(n);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=Y(".dropdown-action-container");this._dropdown.render(U(this._container,i)),this._register(q(i,ue.KEY_DOWN,n=>{var o;const r=new Ot(n);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};WL=cI([qo(2,Nt),qo(3,ni),qo(4,Tl),qo(5,yh),qo(6,Ge),qo(7,yr)],WL);function eQ(s,e,t){return e instanceof Ud?s.createInstance(mu,e,void 0):e instanceof Nx?e.item.rememberDefaultAction?s.createInstance(WL,e,t):s.createInstance(BL,e,t):void 0}var dF=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},hF=function(s,e){return function(t,i){e(t,i,s)}};const cF=Je("IPeekViewService");Il(cF,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 Rn;(function(s){s.inPeekEditor=new re("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(Rn||(Rn={}));let hp=class{constructor(e,t){e instanceof nh&&Rn.inPeekEditor.bindTo(t)}dispose(){}};hp.ID="editor.contrib.referenceController";hp=dF([hF(1,ve)],hp);nt(hp.ID,hp);function tQ(s){let e=s.get(tt).getFocusedCodeEditor();return e instanceof nh?e.getParentEditor():e}const iQ={headerBackgroundColor:W.white,primaryHeadingColor:W.fromHex("#333333"),secondaryHeadingColor:W.fromHex("#6c6c6cb3")};let RC=class extends GX{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new M,this.onDidClose=this._onDidClose.event,xo(this.options,iQ,!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.options.supportOnTitleClick&&(i.classList.add("clickable"),ii(i,"click",r=>this._onTitleClick(r))),U(this._headElement,i),this._fillTitleIcon(i),this._primaryHeading=Y("span.filename"),this._secondaryHeading=Y("span.dirname"),this._metaHeading=Y("span.meta"),U(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=Y(".peekview-actions");U(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new pa(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Us("peekview.close",p("label.close","Close"),ie.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:eQ.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:Li(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,zn(this._metaHeading)):_n(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(58)*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`)}};RC=dF([hF(2,Ge)],RC);const nQ=R("peekViewTitle.background",{dark:wt(mo,.1),light:wt(mo,.1),hc:null},p("peekViewTitleBackground","Background color of the peek view title area.")),uF=R("peekViewTitleLabel.foreground",{dark:W.white,light:W.black,hc:W.white},p("peekViewTitleForeground","Color of the peek view title.")),fF=R("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hc:"#FFFFFF99"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),sQ=R("peekView.border",{dark:mo,light:mo,hc:Zt},p("peekViewBorder","Color of the peek view borders and arrow.")),gF=R("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:W.black},p("peekViewResultsBackground","Background color of the peek view result list.")),oQ=R("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:W.white},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),rQ=R("peekViewResult.fileForeground",{dark:W.white,light:"#1E1E1E",hc:W.white},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),aQ=R("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),lQ=R("peekViewResult.selectionForeground",{dark:W.white,light:"#6C6C6C",hc:W.white},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),j_=R("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:W.black},p("peekViewEditorBackground","Background color of the peek view editor.")),dQ=R("peekViewEditorGutter.background",{dark:j_,light:j_,hc:j_},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),hQ=R("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),cQ=R("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),uQ=R("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:Xi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var fQ=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Cl{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=v2.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({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",qs(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):p("aria.oneReference","symbol in {0} on line {1} at column {2}",qs(this.uri),this.range.startLineNumber,this.range.startColumn)}}class gQ{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 S(n,l.startColumn,n,o),h=new S(r,a,r,1073741824),c=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(h).replace(/\s+$/,"");return{value:c+u+f,highlight:{start:c.length,end:c.length+u.length}}}}class cp{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Zi}dispose(){qe(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}",qs(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,qs(this.uri),this.uri.fsPath)}resolve(e){return fQ(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 gQ(i))}catch(i){Le(i)}return this})}}class An{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(An._compareReferences);let n;for(let o of e)if((!n||!vn.isEqual(n.uri,o.uri,!0))&&(n=new cp(this,o.uri),this.groups.push(n)),n.children.length===0||An._compareReferences(o,n.children[n.children.length-1])!==0){const r=new Cl(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){qe(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new An(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:Zc(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()&&S.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 vn.compare(e.uri,t.uri)||S.compareRangesUsingStarts(e.range,t.range)}}function pF(s){if(!s)return;typeof s=="string"&&(s=me.file(s));const e=qs(s)||(s.scheme===Te.file?s.fsPath:s.path);return Ai&&J3(e)?VL(e):e}function VL(s){return aM(s)?s.charAt(0).toUpperCase()+s.slice(1):s}var sw=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},up=function(s,e){return function(t,i){e(t,i,s)}};let HL=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof An||e instanceof cp}getChildren(e){if(e instanceof An)return e.groups;if(e instanceof cp)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};HL=sw([up(0,Qn)],HL);class pQ{getHeight(){return 23}getTemplateId(e){return e instanceof cp?fp.id:tm.id}}let zL=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Cl){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return qs(e.uri)}};zL=sw([up(0,Nt)],zL);class mQ{getId(e){return e instanceof Cl?e.id:e.uri}}let UL=class extends H{constructor(e,t,i){super(),this._uriLabel=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new Yk(n,{supportHighlights:!0})),this.badge=new mL(U(n,Y(".count"))),this._register(FK(this.badge,i)),e.appendChild(n)}set(e,t){let i=sx(e.uri);this.file.setLabel(pF(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))}};UL=sw([up(1,qp),up(2,Dt)],UL);let fp=class mF{constructor(e){this._instantiationService=e,this.templateId=mF.id}renderTemplate(e){return this._instantiationService.createInstance(UL,e)}renderElement(e,t,i){i.set(e.element,Pv(e.filterData))}disposeTemplate(e){e.dispose()}};fp.id="FileReferencesRenderer";fp=sw([up(0,Ge)],fp);class _Q{constructor(e){this.label=new bl(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(`${qs(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=n;t&&!_o.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,Pv(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class tm{constructor(){this.templateId=tm.id}renderTemplate(e){return new _Q(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}tm.id="OneReferenceRenderer";class bQ{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var CQ=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},Mr=function(s,e){return function(t,i){e(t,i,s)}},lA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class ow{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:ow.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(!S.equalsRange(o,n.range)){if(S.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()}}ow.DecorationOptions=Ee.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class vQ{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 wQ extends cL{}let $L=class extends RC{constructor(e,t,i,n,o,r,a,l,d,h,c,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!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=h,this._modeService=c,this._languageConfigurationService=u,this._disposeOnNewModel=new X,this._callOnDispose=new X,this._onDidSelectReference=new M,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new _t(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(),qe(this._preview),qe(this._previewNotAvailableMessage),qe(this._tree),qe(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(sQ)||W.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(nQ)||W.transparent,primaryHeadingColor:e.getColor(uF),secondaryHeadingColor:e.getColor(fF)})}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=U(e,Y("div.messages")),_n(this._messageContainer),this._splitView=new o2(e,{orientation:1}),this._previewContainer=U(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(nh,this._previewContainer,t,this.editor),_n(this._previewContainer),this._previewNotAvailableMessage=new ts(p("missingPreviewMessage","no preview available"),ts.DEFAULT_CREATION_OPTIONS,null,null,this._undoRedoService,this._modeService,this._languageConfigurationService),this._treeContainer=U(e,Y("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new bQ,keyboardNavigationLabelProvider:this._instantiationService.createInstance(zL),identityProvider:new mQ,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:gF}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(ii(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(wQ,"ReferencesWidget",this._treeContainer,new pQ,[this._instantiationService.createInstance(fp),this._instantiationService.createInstance(tm)],this._instantiationService.createInstance(HL),i),this._splitView.addView({onDidChange:he.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},yC.Distribute),this._splitView.addView({onDidChange:he.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)}},yC.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 Cl&&(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")}),_n(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new _t(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"),zn(this._messageContainer),Promise.resolve(void 0)):(_n(this._messageContainer),this._decorationsManager=new ow(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"),zn(this._treeContainer),zn(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 Cl)return e;if(e instanceof cp&&e.children.length>0)return e.children[0]}revealReference(e){return lA(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return lA(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Te.inMemory?this.setTitle(dM(e.uri),this._uriLabel.getUriLabel(sx(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}qe(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=S.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()})}};$L=CQ([Mr(3,Dt),Mr(4,Qn),Mr(5,Ge),Mr(6,cF),Mr(7,qp),Mr(8,Wp),Mr(9,Nt),Mr(10,Qi),Mr(11,Pp)],$L);st((s,e)=>{const t=s.getColor(hQ);t&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${t}; }`);const i=s.getColor(cQ);i&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${i}; }`);const n=s.getColor(uQ);n&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${n}; box-sizing: border-box; }`);const o=s.getColor(Xi);o&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${o}; box-sizing: border-box; }`);const r=s.getColor(gF);r&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${r}; }`);const a=s.getColor(oQ);a&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const l=s.getColor(rQ);l&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${l}; }`);const d=s.getColor(aQ);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 h=s.getColor(lQ);h&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${h} !important; }`);const c=s.getColor(j_);c&&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: ${c};}`);const u=s.getColor(dQ);u&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin { background-color: ${u};}`)});var SQ=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)}},dA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Rh=new re("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let vl=class jL{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=Rh.bindTo(i)}static get(e){return e.getContribution(jL.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=vQ.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance($L,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:h}=l;if(d)switch(h){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 h=this._editor.getModel().uri,c=new F(e.startLineNumber,e.startColumn),u=this._model.nearestReference(h,c);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(76)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return dA(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 dA(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=S.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=jL.get(i),r=this._model.clone();this.closeWidget(),i.focus(),o.toggleWidget(t,gi(a=>Promise.resolve(r)),(n=this._peekMode)!==null&&n!==void 0?n:!1)}},i=>{this._ignoreModelChangeEvent=!1,Le(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)}};vl.ID="editor.contrib.referencesController";vl=SQ([Jh(2,ve),Jh(3,tt),Jh(4,ni),Jh(5,Ge),Jh(6,yr),Jh(7,Vt)],vl);function Mh(s,e){const t=tQ(s);if(!t)return;let i=vl.get(t);i&&e(i)}cn.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:mi(2089,60),when:te.or(Rh,Rn.inPeekEditor),handler(s){Mh(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});cn.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:te.or(Rh,Rn.inPeekEditor),handler(s){Mh(s,e=>{e.goToNextOrPreviousReference(!0)})}});cn.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:te.or(Rh,Rn.inPeekEditor),handler(s){Mh(s,e=>{e.goToNextOrPreviousReference(!1)})}});$e.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");$e.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");$e.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");$e.registerCommand("closeReferenceSearch",s=>Mh(s,e=>e.closeWidget()));cn.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:te.and(Rn.inPeekEditor,te.not("config.editor.stablePeek"))});cn.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:te.and(Rh,te.not("config.editor.stablePeek"))});cn.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:te.and(Rh,f2),handler(s){var e;const i=(e=s.get(Ss).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Cl&&Mh(s,n=>n.revealReference(i[0]))}});cn.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:te.and(Rh,f2),handler(s){var e;const i=(e=s.get(Ss).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Cl&&Mh(s,n=>n.openReference(i[0],!0,!0))}});$e.registerCommand("openReference",s=>{var e;const i=(e=s.get(Ss).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Cl&&Mh(s,n=>n.openReference(i[0],!1,!0))});var _F=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},Af=function(s,e){return function(t,i){e(t,i,s)}};const uI=new re("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),rw=Je("ISymbolNavigationService");let KL=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=uI.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 qL(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,h=!1;for(const c of t.references)if(lM(c.uri,a.uri))d=!0,h=h||S.containsPosition(c.range,l);else if(d)break;(!d||!h)&&this.reset()});this._currentState=Za(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:S.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)}};KL=_F([Af(0,ve),Af(1,tt),Af(2,ni),Af(3,Nt)],KL);Il(rw,KL,!0);J(new class extends Mi{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:uI,kbOpts:{weight:100,primary:70}})}runEditorCommand(s,e){return s.get(rw).revealNext(e)}});cn.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:uI,primary:9,handler(s){s.get(rw).reset()}});let qL=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(),qe(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Za(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)}};qL=_F([Af(0,tt)],qL);var bF=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function im(s,e,t,i){const o=t.ordered(s).map(r=>Promise.resolve(i(r,s,e)).then(void 0,a=>{Di(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 fI(s,e,t){return im(s,e,Sg,(i,n,o)=>i.provideDefinition(n,o,t))}function CF(s,e,t){return im(s,e,yb,(i,n,o)=>i.provideDeclaration(n,o,t))}function vF(s,e,t){return im(s,e,Lb,(i,n,o)=>i.provideImplementation(n,o,t))}function wF(s,e,t){return im(s,e,Db,(i,n,o)=>i.provideTypeDefinition(n,o,t))}function aw(s,e,t,i){return im(s,e,vb,(n,o,r)=>bF(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 nm(s){return bF(this,void 0,void 0,function*(){const e=yield s(),t=new An(e,""),i=t.references.map(n=>n.link);return t.dispose(),i})}vr("_executeDefinitionProvider",(s,e)=>nm(()=>fI(s,e,Oe.None)));vr("_executeDeclarationProvider",(s,e)=>nm(()=>CF(s,e,Oe.None)));vr("_executeImplementationProvider",(s,e)=>nm(()=>vF(s,e,Oe.None)));vr("_executeTypeDefinitionProvider",(s,e)=>nm(()=>wF(s,e,Oe.None)));vr("_executeReferenceProvider",(s,e)=>nm(()=>aw(s,e,!1,Oe.None)));var js=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},mS,_S,bS,CS,vS,wS,SS,yS;ps.appendMenuItem(ae.EditorContext,{submenu:ae.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});const SF=new Set;function Io(s){const e=new s;return pO(e),SF.add(e.id),e}class Hu extends oe{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(ni),n=e.get(tt),o=e.get(Ca),r=e.get(rw),a=t.getModel(),l=t.getPosition(),d=new Zg(t,5),h=KD(this._getLocationModel(a,l,d.token),d.token).then(c=>js(this,void 0,void 0,function*(){if(!c||d.token.isCancellationRequested)return;Ei(c.ariaMessage);let u;if(c.referenceAt(a.uri,l)){const g=this._getAlternativeCommand(t);g!==this.id&&SF.has(g)&&(u=t.getAction(g))}const f=c.references.length;if(f===0){if(!this._configuration.muteMessage){const g=a.getWordAtPosition(l);is.get(t).showMessage(this._getNoResultFoundMessage(g),l)}}else if(f===1&&u)u.run();else return this._onResult(n,r,t,c)}),c=>{i.error(c)}).finally(()=>{d.dispose()});return o.showWhile(h,250),h}_onResult(e,t,i,n){return js(this,void 0,void 0,function*(){const o=this._getGoToPreference(i);if(!(i instanceof nh)&&(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 js(this,void 0,void 0,function*(){let r;if($W(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:S.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=vl.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),gi(n=>Promise.resolve(t)),this._configuration.openInPeek):t.dispose()}}class lw extends Hu{_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield fI(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(50).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleDefinitions}}const yF=Nu&&!VR?2118:70;Io((mS=class GL extends lw{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GL.id,label:p("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:te.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:yF,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),$e.registerCommandAlias("editor.action.goToDeclaration",GL.id)}},mS.id="editor.action.revealDefinition",mS));Io((_S=class ZL extends lw{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:ZL.id,label:p("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:te.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,yF),weight:100}}),$e.registerCommandAlias("editor.action.openDeclarationToTheSide",ZL.id)}},_S.id="editor.action.revealDefinitionAside",_S));Io((bS=class YL extends lw{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:YL.id,label:p("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:te.and(E.hasDefinitionProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:ae.EditorContextPeek,group:"peek",order:2}}),$e.registerCommandAlias("editor.action.previewDeclaration",YL.id)}},bS.id="editor.action.peekDefinition",bS));class LF extends Hu{_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield CF(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(50).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(50).multipleDeclarations}}Io((CS=class DF extends LF{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:DF.id,label:p("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:te.and(E.hasDeclarationProvider,E.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},CS.id="editor.action.revealDeclaration",CS));Io(class extends LF{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:p("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:te.and(E.hasDeclarationProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ae.EditorContextPeek,group:"peek",order:3}})}});class xF extends Hu{_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield wF(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(50).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleTypeDefinitions}}Io((vS=class kF extends xF{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kF.ID,label:p("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:te.and(E.hasTypeDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}},vS.ID="editor.action.goToTypeDefinition",vS));Io((wS=class IF extends xF{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:IF.ID,label:p("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:te.and(E.hasTypeDefinitionProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ae.EditorContextPeek,group:"peek",order:4}})}},wS.ID="editor.action.peekTypeDefinition",wS));class EF extends Hu{_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield vF(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(50).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(50).multipleImplementations}}Io((SS=class NF extends EF{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:NF.ID,label:p("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:te.and(E.hasImplementationProvider,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}},SS.ID="editor.action.goToImplementation",SS));Io((yS=class TF extends EF{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TF.ID,label:p("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:te.and(E.hasImplementationProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:ae.EditorContextPeek,group:"peek",order:5}})}},yS.ID="editor.action.peekImplementation",yS));class AF extends Hu{_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(50).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(50).multipleReferences}}Io(class extends AF{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:p("goToReferences.label","Go to References"),alias:"Go to References",precondition:te.and(E.hasReferenceProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:E.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield aw(e,t,!0,i),p("ref.title","References"))})}});Io(class extends AF{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:p("references.action.label","Peek References"),alias:"Peek References",precondition:te.and(E.hasReferenceProvider,Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ae.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(yield aw(e,t,!1,i),p("ref.title","References"))})}});class yQ extends Hu{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:p("label.generic","Go to Any Symbol"),alias:"Go to Any Symbol",precondition:te.and(Rn.notInPeekEditor,E.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return js(this,void 0,void 0,function*(){return new An(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(50).multipleReferences}_getAlternativeCommand(){return""}}$e.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:me},{name:"position",description:"The position at which to start",constraint:F.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)=>js(void 0,void 0,void 0,function*(){ut(me.isUri(e)),ut(F.isIPosition(t)),ut(Array.isArray(i)),ut(typeof n>"u"||typeof n=="string"),ut(typeof r>"u"||typeof r=="boolean");const a=s.get(tt),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(ur(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const h=new class extends yQ{_getNoResultFoundMessage(c){return o||super._getNoResultFoundMessage(c)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);d.get(Ge).invokeFunction(h.run.bind(h),l)})})});$e.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:me},{name:"position",description:"The position at which to start",constraint:F.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)=>js(void 0,void 0,void 0,function*(){s.get(Yt).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)})});$e.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{ut(me.isUri(e)),ut(F.isIPosition(t));const i=s.get(tt);return i.openCodeEditor({resource:e},i.getFocusedCodeEditor()).then(n=>{if(!ur(n)||!n.hasModel())return;const o=vl.get(n);if(!o)return;const r=gi(l=>aw(n.getModel(),F.lift(t),!1,l).then(d=>new An(d,p("ref.title","References")))),a=new S(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(a,r,!1))})}});$e.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");ps.appendMenuItems([{id:ae.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:p({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:ae.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:p({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:ae.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:p({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:ae.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:p({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:ae.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:p({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},group:"4_symbol_nav",order:5}}]);var LQ=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},hA=function(s,e){return function(t,i){e(t,i,s)}};let sh=class Rf{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 rF(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown(([o,r])=>{this.startFindDefinitionFromMouse(o,Kn(r))})),this.toUnhook.add(n.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},r=>{this.removeLinkDecorations(),Le(r)})})),this.toUnhook.add(n.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Rf.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 wP(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=gi(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 S(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),new ma().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 h=this.getPreviewValue(l,d,r);let c;r.originSelectionRange?c=S.lift(r.originSelectionRange):c=new S(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const u=this.modeService.getModeIdByFilepathOrFirstLine(l.uri);this.addDecoration(c,new ma().appendCodeblock(u||"",h)),a.dispose()})}}).then(void 0,Le)}getPreviewValue(e,t,i){let n=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(e,t);return n.endLineNumber-n.startLineNumber>=Rf.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+Rf.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n;o++){let r=e.getLineFirstNonWhitespaceColumn(o);if(i===r)break}return new S(t,1,o+1,1)}getPreviewRangeBasedOnBrackets(e,t){const i=Math.min(e.getLineCount(),t+Rf.MAX_SOURCE_PREVIEW_LINES),n=[];let o=!0,r=e.findNextBracket(new F(t,1));for(;r!==null;){if(n.length===0)n.push(r);else{const h=n[n.length-1];if(h.open[0]===r.open[0]&&h.isOpen&&!r.isOpen?n.pop():n.push(r),n.length===0)if(o)o=!1;else return new S(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 S(t,1,i+1,1);r=e.findNextBracket(new F(l,d))}return new S(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))&&Sg.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?fI(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(77)&&!this.isInPeekEditor(i);return new lw({openToSide:t,openInPeek:n,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(i,this.editor)})}isInPeekEditor(e){const t=e.get(ve);return Rn.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};sh.ID="editor.contrib.gotodefinitionatposition";sh.MAX_SOURCE_PREVIEW_LINES=8;sh=LQ([hA(1,Qn),hA(2,Qi)],sh);nt(sh.ID,sh);st((s,e)=>{const t=s.getColor(ik);t&&e.addRule(`.monaco-editor .goto-definition-link { color: ${t} !important; }`)});const e_=Y;class RF extends H{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 Up(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}class gI extends H{constructor(e,t,i){super(),this.actionContainer=U(e,e_("div.action-container")),this.action=U(this.actionContainer,e_("a.action")),this.action.setAttribute("href","#"),this.action.setAttribute("role","button"),t.iconClass&&U(this.action,e_(`span.icon.${t.iconClass}`));const n=U(this.action,e_("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(q(this.actionContainer,ue.MOUSE_DOWN,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this.setEnabled(!0)}static render(e,t,i){return new gI(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"))}}class DQ{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 co=Y;class xQ extends H{constructor(e,t,i){super(),this.model=t,this.domNode=co(".colorpicker-header"),U(e,this.domNode),this.pickedColorNode=U(this.domNode,co(".picked-color"));const n=p("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this.pickedColorNode.setAttribute("title",n);const o=U(this.domNode,co(".original-color"));o.style.backgroundColor=W.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Kd)||W.white,this._register(st((r,a)=>{this.backgroundColor=r.getColor(Kd)||W.white})),this._register(q(this.pickedColorNode,ue.CLICK,()=>this.model.selectNextColorPresentation())),this._register(q(o,ue.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=W.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=W.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:"",this.pickedColorNode.prepend(co(".codicon.codicon-color-mode"))}}class kQ extends H{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=co(".colorpicker-body"),U(e,this.domNode),this.saturationBox=new IQ(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 EQ(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 NQ(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 W(new tr(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new W(new tr(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new W(new tr(i===360?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class IQ extends H{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=co(".saturation-wrap"),U(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",U(this.domNode,this.canvas),this.selection=co(".saturation-selection"),U(this.domNode,this.selection),this.layout(),this._register(GD(this.domNode,n=>this.onMouseDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new Lh);const t=Ii(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,Ou,n=>this.onDidChangePosition(n.posx-t.left,n.posy-t.top),()=>null);const i=jR(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 W(new tr(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=W.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 MF extends H{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=U(e,co(".strip")),this.overlay=U(this.domNode,co(".overlay")),this.slider=U(this.domNode,co(".slider")),this.slider.style.top="0px",this._register(GD(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 Lh),i=Ii(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,Ou,o=>this.onDidChangeTop(o.posy-i.top),()=>null);const n=jR(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 EQ extends MF{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 W(new Be(t,i,n,1)),r=new W(new Be(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class NQ extends MF{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class TQ extends ss{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._register(WR(()=>this.layout()));const o=co(".colorpicker-widget");e.appendChild(o);const r=new xQ(o,this.model,n);this.body=new kQ(o,this.model,this.pixelRatio),this._register(r),this._register(this.body)}layout(){this.body.layout()}}var AQ=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},RQ=function(s,e){return function(t,i){e(t,i,s)}},cA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class MQ{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 XL=class{constructor(e,t,i){this._editor=e,this._hover=t,this._themeService=i}computeSync(e,t){return[]}computeAsync(e,t,i){return cA(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const n=ih.get(this._editor);for(const o of t){if(o.options.description!=="color-detector-color")continue;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 cA(this,void 0,void 0,function*(){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:l}=t.color,d=new Be(Math.round(o*255),Math.round(r*255),Math.round(a*255),l),h=new W(d),c=yield nA(e,t,i,Oe.None),u=new DQ(h,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(h,n),new MQ(this,S.lift(t.range),u,i)})}renderHoverParts(e,t,i){if(e.length===0||!this._editor.hasModel())return H.None;const n=new X,o=e[0],r=this._editor.getModel(),a=o.model,l=n.add(new TQ(t,a,this._editor.getOption(127),this._themeService));let d=new S(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);const h=()=>{let u,f;if(a.presentation.textEdit){u=[a.presentation.textEdit],f=new S(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},c=u=>nA(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,Oe.None).then(f=>{a.colorPresentations=f||[]});return n.add(a.onColorFlushed(u=>{c(u).then(h)})),n.add(a.onDidChangeColor(c)),this._hover.setColorPicker(l),n}};XL=AQ([RQ(2,Dt)],XL);class OF{constructor(e,t,i,n,o){this._computer=e,this._state=0,this._hoverTime=o,this._firstWaitScheduler=new Lt(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new Lt(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new Lt(()=>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=gi(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):Le(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}}class uA{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 LS{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}}/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */function OQ(s){if(Array.isArray(s)){for(var e=0,t=Array(s.length);e<s.length;e++)t[e]=s[e];return t}else return Array.from(s)}var PQ=Object.hasOwnProperty,fA=Object.setPrototypeOf,FQ=Object.isFrozen,BQ=Object.getPrototypeOf,WQ=Object.getOwnPropertyDescriptor,Mn=Object.freeze,ba=Object.seal,VQ=Object.create,PF=typeof Reflect<"u"&&Reflect,MC=PF.apply,QL=PF.construct;MC||(MC=function(e,t,i){return e.apply(t,i)});Mn||(Mn=function(e){return e});ba||(ba=function(e){return e});QL||(QL=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(OQ(t))))});var HQ=Lo(Array.prototype.forEach),gA=Lo(Array.prototype.pop),_f=Lo(Array.prototype.push),Ql=Lo(String.prototype.toLowerCase),pA=Lo(String.prototype.match),Ea=Lo(String.prototype.replace),zQ=Lo(String.prototype.indexOf),UQ=Lo(String.prototype.trim),Or=Lo(RegExp.prototype.test),mA=$Q(TypeError);function Lo(s){return function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return MC(s,e,i)}}function $Q(s){return function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return QL(s,t)}}function ot(s,e){fA&&fA(s,null);for(var t=e.length;t--;){var i=e[t];if(typeof i=="string"){var n=Ql(i);n!==i&&(FQ(e)||(e[t]=n),i=n)}s[i]=!0}return s}function Gl(s){var e=VQ(null),t=void 0;for(t in s)MC(PQ,s,[t])&&(e[t]=s[t]);return e}function t_(s,e){for(;s!==null;){var t=WQ(s,e);if(t){if(t.get)return Lo(t.get);if(typeof t.value=="function")return Lo(t.value)}s=BQ(s)}function i(n){return console.warn("fallback value for",n),null}return i}var _A=Mn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),DS=Mn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xS=Mn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),jQ=Mn(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),kS=Mn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),KQ=Mn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bA=Mn(["#text"]),CA=Mn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),IS=Mn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vA=Mn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),i_=Mn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qQ=ba(/\{\{[\s\S]*|[\s\S]*\}\}/gm),GQ=ba(/<%[\s\S]*|[\s\S]*%>/gm),ZQ=ba(/^data-[\-\w.\u00B7-\uFFFF]/),YQ=ba(/^aria-[\-\w]+$/),XQ=ba(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QQ=ba(/^(?:\w+script|data):/i),JQ=ba(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function Oo(s){if(Array.isArray(s)){for(var e=0,t=Array(s.length);e<s.length;e++)t[e]=s[e];return t}else return Array.from(s)}var eJ=function(){return typeof window>"u"?null:window},tJ=function(e,t){if((typeof e>"u"?"undefined":Mf(e))!=="object"||typeof e.createPolicy!="function")return null;var i=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(i=t.currentScript.getAttribute(n));var o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function FF(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eJ(),e=function(x){return FF(x)};if(e.version="2.3.1",e.removed=[],!s||!s.document||s.document.nodeType!==9)return e.isSupported=!1,e;var t=s.document,i=s.document,n=s.DocumentFragment,o=s.HTMLTemplateElement,r=s.Node,a=s.Element,l=s.NodeFilter,d=s.NamedNodeMap,h=d===void 0?s.NamedNodeMap||s.MozNamedAttrMap:d,c=s.Text,u=s.Comment,f=s.DOMParser,g=s.trustedTypes,m=a.prototype,_=t_(m,"cloneNode"),C=t_(m,"nextSibling"),b=t_(m,"childNodes"),v=t_(m,"parentNode");if(typeof o=="function"){var w=i.createElement("template");w.content&&w.content.ownerDocument&&(i=w.content.ownerDocument)}var y=tJ(g,t),k=y&&Pl?y.createHTML(""):"",L=i,D=L.implementation,N=L.createNodeIterator,B=L.createDocumentFragment,O=L.getElementsByTagName,$=t.importNode,K={};try{K=Gl(i).documentMode?i.documentMode:{}}catch{}var le={};e.isSupported=typeof v=="function"&&D&&typeof D.createHTMLDocument<"u"&&K!==9;var de=qQ,_e=GQ,De=ZQ,we=YQ,Se=QQ,Tt=JQ,bt=XQ,xt=null,Pt=ot({},[].concat(Oo(_A),Oo(DS),Oo(xS),Oo(kS),Oo(bA))),dt=null,Sn=ot({},[].concat(Oo(CA),Oo(IS),Oo(vA),Oo(i_))),No=null,xr=null,Xs=!0,At=!0,To=!1,Pe=!1,be=!1,Ph=!1,qu=!1,va=!1,kr=!1,wa=!0,Pl=!1,am=!0,Fh=!0,Fl=!1,Sa={},Ir=null,Bl=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Gu=null,Zu=ot({},["audio","video","img","source","image","track"]),Bh=null,lm=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yu="http://www.w3.org/1998/Math/MathML",Xu="http://www.w3.org/2000/svg",Ao="http://www.w3.org/1999/xhtml",Wh=Ao,Qu=!1,Ls=null,Wl=i.createElement("form"),Vh=function(x){Ls&&Ls===x||((!x||(typeof x>"u"?"undefined":Mf(x))!=="object")&&(x={}),x=Gl(x),xt="ALLOWED_TAGS"in x?ot({},x.ALLOWED_TAGS):Pt,dt="ALLOWED_ATTR"in x?ot({},x.ALLOWED_ATTR):Sn,Bh="ADD_URI_SAFE_ATTR"in x?ot(Gl(lm),x.ADD_URI_SAFE_ATTR):lm,Gu="ADD_DATA_URI_TAGS"in x?ot(Gl(Zu),x.ADD_DATA_URI_TAGS):Zu,Ir="FORBID_CONTENTS"in x?ot({},x.FORBID_CONTENTS):Bl,No="FORBID_TAGS"in x?ot({},x.FORBID_TAGS):{},xr="FORBID_ATTR"in x?ot({},x.FORBID_ATTR):{},Sa="USE_PROFILES"in x?x.USE_PROFILES:!1,Xs=x.ALLOW_ARIA_ATTR!==!1,At=x.ALLOW_DATA_ATTR!==!1,To=x.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=x.SAFE_FOR_TEMPLATES||!1,be=x.WHOLE_DOCUMENT||!1,va=x.RETURN_DOM||!1,kr=x.RETURN_DOM_FRAGMENT||!1,wa=x.RETURN_DOM_IMPORT!==!1,Pl=x.RETURN_TRUSTED_TYPE||!1,qu=x.FORCE_BODY||!1,am=x.SANITIZE_DOM!==!1,Fh=x.KEEP_CONTENT!==!1,Fl=x.IN_PLACE||!1,bt=x.ALLOWED_URI_REGEXP||bt,Wh=x.NAMESPACE||Ao,Pe&&(At=!1),kr&&(va=!0),Sa&&(xt=ot({},[].concat(Oo(bA))),dt=[],Sa.html===!0&&(ot(xt,_A),ot(dt,CA)),Sa.svg===!0&&(ot(xt,DS),ot(dt,IS),ot(dt,i_)),Sa.svgFilters===!0&&(ot(xt,xS),ot(dt,IS),ot(dt,i_)),Sa.mathMl===!0&&(ot(xt,kS),ot(dt,vA),ot(dt,i_))),x.ADD_TAGS&&(xt===Pt&&(xt=Gl(xt)),ot(xt,x.ADD_TAGS)),x.ADD_ATTR&&(dt===Sn&&(dt=Gl(dt)),ot(dt,x.ADD_ATTR)),x.ADD_URI_SAFE_ATTR&&ot(Bh,x.ADD_URI_SAFE_ATTR),x.FORBID_CONTENTS&&(Ir===Bl&&(Ir=Gl(Ir)),ot(Ir,x.FORBID_CONTENTS)),Fh&&(xt["#text"]=!0),be&&ot(xt,["html","head","body"]),xt.table&&(ot(xt,["tbody"]),delete No.tbody),Mn&&Mn(x),Ls=x)},Ju=ot({},["mi","mo","mn","ms","mtext"]),dm=ot({},["foreignobject","desc","title","annotation-xml"]),Hh=ot({},DS);ot(Hh,xS),ot(Hh,jQ);var ya=ot({},kS);ot(ya,KQ);var hm=function(x){var P=v(x);(!P||!P.tagName)&&(P={namespaceURI:Ao,tagName:"template"});var G=Ql(x.tagName),Z=Ql(P.tagName);if(x.namespaceURI===Xu)return P.namespaceURI===Ao?G==="svg":P.namespaceURI===Yu?G==="svg"&&(Z==="annotation-xml"||Ju[Z]):!!Hh[G];if(x.namespaceURI===Yu)return P.namespaceURI===Ao?G==="math":P.namespaceURI===Xu?G==="math"&&dm[Z]:!!ya[G];if(x.namespaceURI===Ao){if(P.namespaceURI===Xu&&!dm[Z]||P.namespaceURI===Yu&&!Ju[Z])return!1;var se=ot({},["title","style","font","a","script"]);return!ya[G]&&(se[G]||!Hh[G])}return!1},Ds=function(x){_f(e.removed,{element:x});try{x.parentNode.removeChild(x)}catch{try{x.outerHTML=k}catch{x.remove()}}},cm=function(x,P){try{_f(e.removed,{attribute:P.getAttributeNode(x),from:P})}catch{_f(e.removed,{attribute:null,from:P})}if(P.removeAttribute(x),x==="is"&&!dt[x])if(va||kr)try{Ds(P)}catch{}else try{P.setAttribute(x,"")}catch{}},um=function(x){var P=void 0,G=void 0;if(qu)x="<remove></remove>"+x;else{var Z=pA(x,/^[\r\n\t ]+/);G=Z&&Z[0]}var se=y?y.createHTML(x):x;if(Wh===Ao)try{P=new f().parseFromString(se,"text/html")}catch{}if(!P||!P.documentElement){P=D.createDocument(Wh,"template",null);try{P.documentElement.innerHTML=Qu?"":se}catch{}}var xe=P.body||P.documentElement;return x&&G&&xe.insertBefore(i.createTextNode(G),xe.childNodes[0]||null),Wh===Ao?O.call(P,be?"html":"body")[0]:be?P.documentElement:xe},fm=function(x){return N.call(x.ownerDocument||x,x,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},Ze=function(x){return x instanceof c||x instanceof u?!1:typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||!(x.attributes instanceof h)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"},Vl=function(x){return(typeof r>"u"?"undefined":Mf(r))==="object"?x instanceof r:x&&(typeof x>"u"?"undefined":Mf(x))==="object"&&typeof x.nodeType=="number"&&typeof x.nodeName=="string"},j=function(x,P,G){le[x]&&HQ(le[x],function(Z){Z.call(e,P,G,Ls)})},V=function(x){var P=void 0;if(j("beforeSanitizeElements",x,null),Ze(x)||pA(x.nodeName,/[\u0080-\uFFFF]/))return Ds(x),!0;var G=Ql(x.nodeName);if(j("uponSanitizeElement",x,{tagName:G,allowedTags:xt}),!Vl(x.firstElementChild)&&(!Vl(x.content)||!Vl(x.content.firstElementChild))&&Or(/<[/\w]/g,x.innerHTML)&&Or(/<[/\w]/g,x.textContent)||G==="select"&&Or(/<template/i,x.innerHTML))return Ds(x),!0;if(!xt[G]||No[G]){if(Fh&&!Ir[G]){var Z=v(x)||x.parentNode,se=b(x)||x.childNodes;if(se&&Z)for(var xe=se.length,Ie=xe-1;Ie>=0;--Ie)Z.insertBefore(_(se[Ie],!0),C(x))}return Ds(x),!0}return x instanceof a&&!hm(x)||(G==="noscript"||G==="noembed")&&Or(/<\/no(script|embed)/i,x.innerHTML)?(Ds(x),!0):(Pe&&x.nodeType===3&&(P=x.textContent,P=Ea(P,de," "),P=Ea(P,_e," "),x.textContent!==P&&(_f(e.removed,{element:x.cloneNode()}),x.textContent=P)),j("afterSanitizeElements",x,null),!1)},z=function(x,P,G){if(am&&(P==="id"||P==="name")&&(G in i||G in Wl))return!1;if(!(At&&!xr[P]&&Or(De,P))){if(!(Xs&&Or(we,P))){if(!dt[P]||xr[P])return!1;if(!Bh[P]){if(!Or(bt,Ea(G,Tt,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&x!=="script"&&zQ(G,"data:")===0&&Gu[x])){if(!(To&&!Or(Se,Ea(G,Tt,"")))){if(G)return!1}}}}}}return!0},I=function(x){var P=void 0,G=void 0,Z=void 0,se=void 0;j("beforeSanitizeAttributes",x,null);var xe=x.attributes;if(xe){var Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:dt};for(se=xe.length;se--;){P=xe[se];var Ne=P,He=Ne.name,ye=Ne.namespaceURI;if(G=UQ(P.value),Z=Ql(He),Ie.attrName=Z,Ie.attrValue=G,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,j("uponSanitizeAttribute",x,Ie),G=Ie.attrValue,!Ie.forceKeepAttr&&(cm(He,x),!!Ie.keepAttr)){if(Or(/\/>/i,G)){cm(He,x);continue}Pe&&(G=Ea(G,de," "),G=Ea(G,_e," "));var _i=x.nodeName.toLowerCase();if(z(_i,Z,G))try{ye?x.setAttributeNS(ye,He,G):x.setAttribute(He,G),gA(e.removed)}catch{}}}j("afterSanitizeAttributes",x,null)}},T=function A(x){var P=void 0,G=fm(x);for(j("beforeSanitizeShadowDOM",x,null);P=G.nextNode();)j("uponSanitizeShadowNode",P,null),!V(P)&&(P.content instanceof n&&A(P.content),I(P));j("afterSanitizeShadowDOM",x,null)};return e.sanitize=function(A,x){var P=void 0,G=void 0,Z=void 0,se=void 0,xe=void 0;if(Qu=!A,Qu&&(A="<!-->"),typeof A!="string"&&!Vl(A)){if(typeof A.toString!="function")throw mA("toString is not a function");if(A=A.toString(),typeof A!="string")throw mA("dirty is not a string, aborting")}if(!e.isSupported){if(Mf(s.toStaticHTML)==="object"||typeof s.toStaticHTML=="function"){if(typeof A=="string")return s.toStaticHTML(A);if(Vl(A))return s.toStaticHTML(A.outerHTML)}return A}if(Ph||Vh(x),e.removed=[],typeof A=="string"&&(Fl=!1),!Fl)if(A instanceof r)P=um("<!---->"),G=P.ownerDocument.importNode(A,!0),G.nodeType===1&&G.nodeName==="BODY"||G.nodeName==="HTML"?P=G:P.appendChild(G);else{if(!va&&!Pe&&!be&&A.indexOf("<")===-1)return y&&Pl?y.createHTML(A):A;if(P=um(A),!P)return va?null:k}P&&qu&&Ds(P.firstChild);for(var Ie=fm(Fl?A:P);Z=Ie.nextNode();)Z.nodeType===3&&Z===se||V(Z)||(Z.content instanceof n&&T(Z.content),I(Z),se=Z);if(se=null,Fl)return A;if(va){if(kr)for(xe=B.call(P.ownerDocument);P.firstChild;)xe.appendChild(P.firstChild);else xe=P;return wa&&(xe=$.call(t,xe,!0)),xe}var Ne=be?P.outerHTML:P.innerHTML;return Pe&&(Ne=Ea(Ne,de," "),Ne=Ea(Ne,_e," ")),y&&Pl?y.createHTML(Ne):Ne},e.setConfig=function(A){Vh(A),Ph=!0},e.clearConfig=function(){Ls=null,Ph=!1},e.isValidAttribute=function(A,x,P){Ls||Vh({});var G=Ql(A),Z=Ql(x);return z(G,Z,P)},e.addHook=function(A,x){typeof x=="function"&&(le[A]=le[A]||[],_f(le[A],x))},e.removeHook=function(A){le[A]&&gA(le[A])},e.removeHooks=function(A){le[A]&&(le[A]=[])},e.removeAllHooks=function(){le={}},e}var Lr=FF();Lr.version;Lr.isSupported;const iJ=Lr.sanitize;Lr.setConfig;Lr.clearConfig;Lr.isValidAttribute;const wA=Lr.addHook,SA=Lr.removeHook;Lr.removeHooks;Lr.removeAllHooks;let Dr;(function(){function s(e){Dr=e()}s.amd=!0,function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof s=="function"&&s.amd?s(t):(e=typeof globalThis<"u"?globalThis:e||self,e.marked=t())}(this,function(){function e(j,V){for(var z=0;z<V.length;z++){var I=V[z];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(j,I.key,I)}}function t(j,V,z){return z&&e(j,z),j}function i(j,V){if(j){if(typeof j=="string")return n(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 n(j,V)}}function n(j,V){(V==null||V>j.length)&&(V=j.length);for(var z=0,I=new Array(V);z<V;z++)I[z]=j[z];return I}function o(j,V){var z=typeof Symbol<"u"&&j[Symbol.iterator]||j["@@iterator"];if(z)return(z=z.call(j)).next.bind(z);if(Array.isArray(j)||(z=i(j))||V){z&&(j=z);var I=0;return function(){return I>=j.length?{done:!0}:{done:!1,value:j[I++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
  551. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r={exports:{}};function a(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function l(j){r.exports.defaults=j}r.exports={defaults:a(),getDefaults:a,changeDefaults:l};var d=/[&<>"']/,h=/[&<>"']/g,c=/[<>"']|&(?!#?\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(h,g)}else if(c.test(j))return j.replace(u,g);return j}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(j){return j.replace(_,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 b=/(^|[^\[])\^/g;function v(j,V){j=j.source||j,V=V||"";var z={replace:function(T,A){return A=A.source||A,A=A.replace(b,"$1"),j=j.replace(T,A),z},getRegex:function(){return new RegExp(j,V)}};return z}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(j,V,z){if(j){var I;try{I=decodeURIComponent(C(z)).replace(w,"").toLowerCase()}catch{return null}if(I.indexOf("javascript:")===0||I.indexOf("vbscript:")===0||I.indexOf("data:")===0)return null}V&&!y.test(z)&&(z=O(V,z));try{z=encodeURI(z).replace(/%25/g,"%")}catch{return null}return z}var L={},D=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,B=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(j,V){L[" "+j]||(D.test(j)?L[" "+j]=j+"/":L[" "+j]=de(j,"/",!0)),j=L[" "+j];var z=j.indexOf(":")===-1;return V.substring(0,2)==="//"?z?V:j.replace(N,"$1")+V:V.charAt(0)==="/"?z?V:j.replace(B,"$1")+V:j+V}var $={exec:function(){}};function K(j){for(var V=1,z,I;V<arguments.length;V++){z=arguments[V];for(I in z)Object.prototype.hasOwnProperty.call(z,I)&&(j[I]=z[I])}return j}function le(j,V){var z=j.replace(/\|/g,function(A,x,P){for(var G=!1,Z=x;--Z>=0&&P[Z]==="\\";)G=!G;return G?"|":" |"}),I=z.split(/ \|/),T=0;if(I[0].trim()||I.shift(),I[I.length-1].trim()||I.pop(),I.length>V)I.splice(V);else for(;I.length<V;)I.push("");for(;T<I.length;T++)I[T]=I[T].trim().replace(/\\\|/g,"|");return I}function de(j,V,z){var I=j.length;if(I===0)return"";for(var T=0;T<I;){var A=j.charAt(I-T-1);if(A===V&&!z)T++;else if(A!==V&&z)T++;else break}return j.substr(0,I-T)}function _e(j,V){if(j.indexOf(V[1])===-1)return-1;for(var z=j.length,I=0,T=0;T<z;T++)if(j[T]==="\\")T++;else if(j[T]===V[0])I++;else if(j[T]===V[1]&&(I--,I<0))return T;return-1}function De(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 we(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:C,edit:v,cleanUrl:k,resolveUrl:O,noopTest:$,merge:K,splitCells:le,rtrim:de,findClosingBracket:_e,checkSanitizeDeprecation:De,repeatString:we},Tt=r.exports.defaults,bt=Se.rtrim,xt=Se.splitCells,Pt=Se.escape,dt=Se.findClosingBracket;function Sn(j,V,z,I){var T=V.href,A=V.title?Pt(V.title):null,x=j[1].replace(/\\([\[\]])/g,"$1");if(j[0].charAt(0)!=="!"){I.state.inLink=!0;var P={type:"link",raw:z,href:T,title:A,text:x,tokens:I.inlineTokens(x,[])};return I.state.inLink=!1,P}else return{type:"image",raw:z,href:T,title:A,text:Pt(x)}}function No(j,V){var z=j.match(/^(\s+)(?:```)/);if(z===null)return V;var I=z[1];return V.split(`
  552. `).map(function(T){var A=T.match(/^\s+/);if(A===null)return T;var x=A[0];return x.length>=I.length?T.slice(I.length):T}).join(`
  553. `)}var xr=function(){function j(z){this.options=z||Tt}var V=j.prototype;return V.space=function(I){var T=this.rules.block.newline.exec(I);if(T)return T[0].length>1?{type:"space",raw:T[0]}:{raw:`
  554. `}},V.code=function(I){var T=this.rules.block.code.exec(I);if(T){var A=T[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?A:bt(A,`
  555. `)}}},V.fences=function(I){var T=this.rules.block.fences.exec(I);if(T){var A=T[0],x=No(A,T[3]||"");return{type:"code",raw:A,lang:T[2]?T[2].trim():T[2],text:x}}},V.heading=function(I){var T=this.rules.block.heading.exec(I);if(T){var A=T[2].trim();if(/#$/.test(A)){var x=bt(A,"#");(this.options.pedantic||!x||/ $/.test(x))&&(A=x.trim())}var P={type:"heading",raw:T[0],depth:T[1].length,text:A,tokens:[]};return this.lexer.inline(P.text,P.tokens),P}},V.hr=function(I){var T=this.rules.block.hr.exec(I);if(T)return{type:"hr",raw:T[0]}},V.blockquote=function(I){var T=this.rules.block.blockquote.exec(I);if(T){var A=T[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(A,[]),text:A}}},V.list=function(I){var T=this.rules.block.list.exec(I);if(T){var A,x,P,G,Z,se,xe,Ie,Ne,He,ye=T[1].trim(),_i=ye.length>1,at={type:"list",raw:"",ordered:_i,start:_i?+ye.slice(0,-1):"",loose:!1,items:[]};ye=_i?"\\d{1,9}\\"+ye.slice(-1):"\\"+ye,this.options.pedantic&&(ye=_i?ye:"[*+-]");for(var yn=new RegExp("^( {0,3}"+ye+")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))");I&&!(this.rules.block.hr.test(I)||!(T=yn.exec(I)));){Ne=T[2].split(`
  556. `),this.options.pedantic?(G=2,He=Ne[0].trimLeft()):(G=T[2].search(/[^ ]/),G=T[1].length+(G>4?1:G),He=Ne[0].slice(G-T[1].length)),se=!1,A=T[0],!Ne[0]&&/^ *$/.test(Ne[1])&&(A=T[1]+Ne.slice(0,2).join(`
  557. `)+`
  558. `,at.loose=!0,Ne=[]);var zh=new RegExp("^ {0,"+Math.min(3,G-1)+"}(?:[*+-]|\\d{1,9}[.)])");for(Z=1;Z<Ne.length;Z++){if(Ie=Ne[Z],this.options.pedantic&&(Ie=Ie.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),zh.test(Ie)){A=T[1]+Ne.slice(0,Z).join(`
  559. `)+`
  560. `;break}if(!se){Ie.trim()||(se=!0),Ie.search(/[^ ]/)>=G?He+=`
  561. `+Ie.slice(G):He+=`
  562. `+Ie;continue}if(Ie.search(/[^ ]/)>=G||!Ie.trim()){He+=`
  563. `+Ie.slice(G);continue}else{A=T[1]+Ne.slice(0,Z).join(`
  564. `)+`
  565. `;break}}at.loose||(xe?at.loose=!0:/\n *\n *$/.test(A)&&(xe=!0)),this.options.gfm&&(x=/^\[[ xX]\] /.exec(He),x&&(P=x[0]!=="[ ] ",He=He.replace(/^\[[ xX]\] +/,""))),at.items.push({type:"list_item",raw:A,task:!!x,checked:P,loose:!1,text:He}),at.raw+=A,I=I.slice(A.length)}at.items[at.items.length-1].raw=A.trimRight(),at.items[at.items.length-1].text=He.trimRight(),at.raw=at.raw.trimRight();var Ji=at.items.length;for(Z=0;Z<Ji;Z++)this.lexer.state.top=!1,at.items[Z].tokens=this.lexer.blockTokens(at.items[Z].text,[]),at.items[Z].tokens.some(function(ef){return ef.type==="space"})&&(at.loose=!0,at.items[Z].loose=!0);return at}},V.html=function(I){var T=this.rules.block.html.exec(I);if(T){var A={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};return this.options.sanitize&&(A.type="paragraph",A.text=this.options.sanitizer?this.options.sanitizer(T[0]):Pt(T[0]),A.tokens=[],this.lexer.inline(A.text,A.tokens)),A}},V.def=function(I){var T=this.rules.block.def.exec(I);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var A=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:A,raw:T[0],href:T[2],title:T[3]}}},V.table=function(I){var T=this.rules.block.table.exec(I);if(T){var A={type:"table",header:xt(T[1]).map(function(xe){return{text:xe}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]?T[3].replace(/\n$/,"").split(`
  566. `):[]};if(A.header.length===A.align.length){A.raw=T[0];var x=A.align.length,P,G,Z,se;for(P=0;P<x;P++)/^ *-+: *$/.test(A.align[P])?A.align[P]="right":/^ *:-+: *$/.test(A.align[P])?A.align[P]="center":/^ *:-+ *$/.test(A.align[P])?A.align[P]="left":A.align[P]=null;for(x=A.rows.length,P=0;P<x;P++)A.rows[P]=xt(A.rows[P],A.header.length).map(function(xe){return{text:xe}});for(x=A.header.length,G=0;G<x;G++)A.header[G].tokens=[],this.lexer.inlineTokens(A.header[G].text,A.header[G].tokens);for(x=A.rows.length,G=0;G<x;G++)for(se=A.rows[G],Z=0;Z<se.length;Z++)se[Z].tokens=[],this.lexer.inlineTokens(se[Z].text,se[Z].tokens);return A}}},V.lheading=function(I){var T=this.rules.block.lheading.exec(I);if(T){var A={type:"heading",raw:T[0],depth:T[2].charAt(0)==="="?1:2,text:T[1],tokens:[]};return this.lexer.inline(A.text,A.tokens),A}},V.paragraph=function(I){var T=this.rules.block.paragraph.exec(I);if(T){var A={type:"paragraph",raw:T[0],text:T[1].charAt(T[1].length-1)===`
  567. `?T[1].slice(0,-1):T[1],tokens:[]};return this.lexer.inline(A.text,A.tokens),A}},V.text=function(I){var T=this.rules.block.text.exec(I);if(T){var A={type:"text",raw:T[0],text:T[0],tokens:[]};return this.lexer.inline(A.text,A.tokens),A}},V.escape=function(I){var T=this.rules.inline.escape.exec(I);if(T)return{type:"escape",raw:T[0],text:Pt(T[1])}},V.tag=function(I){var T=this.rules.inline.tag.exec(I);if(T)return!this.lexer.state.inLink&&/^<a /i.test(T[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):Pt(T[0]):T[0]}},V.link=function(I){var T=this.rules.inline.link.exec(I);if(T){var A=T[2].trim();if(!this.options.pedantic&&/^</.test(A)){if(!/>$/.test(A))return;var x=bt(A.slice(0,-1),"\\");if((A.length-x.length)%2===0)return}else{var P=dt(T[2],"()");if(P>-1){var G=T[0].indexOf("!")===0?5:4,Z=G+T[1].length+P;T[2]=T[2].substring(0,P),T[0]=T[0].substring(0,Z).trim(),T[3]=""}}var se=T[2],xe="";if(this.options.pedantic){var Ie=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(se);Ie&&(se=Ie[1],xe=Ie[3])}else xe=T[3]?T[3].slice(1,-1):"";return se=se.trim(),/^</.test(se)&&(this.options.pedantic&&!/>$/.test(A)?se=se.slice(1):se=se.slice(1,-1)),Sn(T,{href:se&&se.replace(this.rules.inline._escapes,"$1"),title:xe&&xe.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},V.reflink=function(I,T){var A;if((A=this.rules.inline.reflink.exec(I))||(A=this.rules.inline.nolink.exec(I))){var x=(A[2]||A[1]).replace(/\s+/g," ");if(x=T[x.toLowerCase()],!x||!x.href){var P=A[0].charAt(0);return{type:"text",raw:P,text:P}}return Sn(A,x,A[0],this.lexer)}},V.emStrong=function(I,T,A){A===void 0&&(A="");var x=this.rules.inline.emStrong.lDelim.exec(I);if(x&&!(x[3]&&A.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 P=x[1]||x[2]||"";if(!P||P&&(A===""||this.rules.inline.punctuation.exec(A))){var G=x[0].length-1,Z,se,xe=G,Ie=0,Ne=x[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Ne.lastIndex=0,T=T.slice(-1*I.length+G);(x=Ne.exec(T))!=null;)if(Z=x[1]||x[2]||x[3]||x[4]||x[5]||x[6],!!Z){if(se=Z.length,x[3]||x[4]){xe+=se;continue}else if((x[5]||x[6])&&G%3&&!((G+se)%3)){Ie+=se;continue}if(xe-=se,!(xe>0)){if(se=Math.min(se,se+xe+Ie),Math.min(G,se)%2){var He=I.slice(1,G+x.index+se);return{type:"em",raw:I.slice(0,G+x.index+se+1),text:He,tokens:this.lexer.inlineTokens(He,[])}}var ye=I.slice(2,G+x.index+se-1);return{type:"strong",raw:I.slice(0,G+x.index+se+1),text:ye,tokens:this.lexer.inlineTokens(ye,[])}}}}}},V.codespan=function(I){var T=this.rules.inline.code.exec(I);if(T){var A=T[2].replace(/\n/g," "),x=/[^ ]/.test(A),P=/^ /.test(A)&&/ $/.test(A);return x&&P&&(A=A.substring(1,A.length-1)),A=Pt(A,!0),{type:"codespan",raw:T[0],text:A}}},V.br=function(I){var T=this.rules.inline.br.exec(I);if(T)return{type:"br",raw:T[0]}},V.del=function(I){var T=this.rules.inline.del.exec(I);if(T)return{type:"del",raw:T[0],text:T[2],tokens:this.lexer.inlineTokens(T[2],[])}},V.autolink=function(I,T){var A=this.rules.inline.autolink.exec(I);if(A){var x,P;return A[2]==="@"?(x=Pt(this.options.mangle?T(A[1]):A[1]),P="mailto:"+x):(x=Pt(A[1]),P=x),{type:"link",raw:A[0],text:x,href:P,tokens:[{type:"text",raw:x,text:x}]}}},V.url=function(I,T){var A;if(A=this.rules.inline.url.exec(I)){var x,P;if(A[2]==="@")x=Pt(this.options.mangle?T(A[0]):A[0]),P="mailto:"+x;else{var G;do G=A[0],A[0]=this.rules.inline._backpedal.exec(A[0])[0];while(G!==A[0]);x=Pt(A[0]),A[1]==="www."?P="http://"+x:P=x}return{type:"link",raw:A[0],text:x,href:P,tokens:[{type:"text",raw:x,text:x}]}}},V.inlineText=function(I,T){var A=this.rules.inline.text.exec(I);if(A){var x;return this.lexer.state.inRawBlock?x=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):Pt(A[0]):A[0]:x=Pt(this.options.smartypants?T(A[0]):A[0]),{type:"text",raw:A[0],text:x}}},j}(),Xs=Se.noopTest,At=Se.edit,To=Se.merge,Pe={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)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:Xs,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Pe.def=At(Pe.def).replace("label",Pe._label).replace("title",Pe._title).getRegex(),Pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,Pe.listItemStart=At(/^( *)(bull) */).replace("bull",Pe.bullet).getRegex(),Pe.list=At(Pe.list).replace(/bull/g,Pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Pe.def.source+")").getRegex(),Pe._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",Pe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Pe.html=At(Pe.html,"i").replace("comment",Pe._comment).replace("tag",Pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pe.paragraph=At(Pe._paragraph).replace("hr",Pe.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|textarea|!--)").replace("tag",Pe._tag).getRegex(),Pe.blockquote=At(Pe.blockquote).replace("paragraph",Pe.paragraph).getRegex(),Pe.normal=To({},Pe),Pe.gfm=To({},Pe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Pe.gfm.table=At(Pe.gfm.table).replace("hr",Pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pe._tag).getRegex(),Pe.pedantic=To({},Pe.normal,{html:At(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pe._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:Xs,paragraph:At(Pe.normal._paragraph).replace("hr",Pe.hr).replace("heading",` *#{1,6} *[^
  568. ]`).replace("lheading",Pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Xs,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:Xs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",be.punctuation=At(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,be.escapedEmSt=/\\\*|\\_/g,be._comment=At(Pe._comment).replace("(?:-->|$)","-->").getRegex(),be.emStrong.lDelim=At(be.emStrong.lDelim).replace(/punct/g,be._punctuation).getRegex(),be.emStrong.rDelimAst=At(be.emStrong.rDelimAst,"g").replace(/punct/g,be._punctuation).getRegex(),be.emStrong.rDelimUnd=At(be.emStrong.rDelimUnd,"g").replace(/punct/g,be._punctuation).getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._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])?)+(?![-_])/,be.autolink=At(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=At(be.tag).replace("comment",be._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=At(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=At(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=At(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=To({},be),be.pedantic=To({},be.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:At(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=To({},be.normal,{escape:At(be.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),be.gfm.url=At(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex(),be.breaks=To({},be.gfm,{br:At(be.br).replace("{2,}","*").getRegex(),text:At(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ph={block:Pe,inline:be},qu=xr,va=r.exports.defaults,kr=Ph.block,wa=Ph.inline,Pl=Se.repeatString;function am(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 Fh(j){var V="",z,I,T=j.length;for(z=0;z<T;z++)I=j.charCodeAt(z),Math.random()>.5&&(I="x"+I.toString(16)),V+="&#"+I+";";return V}var Fl=function(){function j(z){this.tokens=[],this.tokens.links=Object.create(null),this.options=z||va,this.options.tokenizer=this.options.tokenizer||new qu,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var I={block:kr.normal,inline:wa.normal};this.options.pedantic?(I.block=kr.pedantic,I.inline=wa.pedantic):this.options.gfm&&(I.block=kr.gfm,this.options.breaks?I.inline=wa.breaks:I.inline=wa.gfm),this.tokenizer.rules=I}j.lex=function(I,T){var A=new j(T);return A.lex(I)},j.lexInline=function(I,T){var A=new j(T);return A.inlineTokens(I)};var V=j.prototype;return V.lex=function(I){I=I.replace(/\r\n|\r/g,`
  569. `).replace(/\t/g," "),this.blockTokens(I,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},V.blockTokens=function(I,T){var A=this;T===void 0&&(T=[]),this.options.pedantic&&(I=I.replace(/^ +$/gm,""));for(var x,P,G,Z;I;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(xe){return(x=xe.call({lexer:A},I,T))?(I=I.substring(x.raw.length),T.push(x),!0):!1}))){if(x=this.tokenizer.space(I)){I=I.substring(x.raw.length),x.type&&T.push(x);continue}if(x=this.tokenizer.code(I)){I=I.substring(x.raw.length),P=T[T.length-1],P&&(P.type==="paragraph"||P.type==="text")?(P.raw+=`
  570. `+x.raw,P.text+=`
  571. `+x.text,this.inlineQueue[this.inlineQueue.length-1].src=P.text):T.push(x);continue}if(x=this.tokenizer.fences(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.heading(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.hr(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.blockquote(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.list(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.html(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.def(I)){I=I.substring(x.raw.length),P=T[T.length-1],P&&(P.type==="paragraph"||P.type==="text")?(P.raw+=`
  572. `+x.raw,P.text+=`
  573. `+x.raw,this.inlineQueue[this.inlineQueue.length-1].src=P.text):this.tokens.links[x.tag]||(this.tokens.links[x.tag]={href:x.href,title:x.title});continue}if(x=this.tokenizer.table(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.lheading(I)){I=I.substring(x.raw.length),T.push(x);continue}if(G=I,this.options.extensions&&this.options.extensions.startBlock&&function(){var xe=1/0,Ie=I.slice(1),Ne=void 0;A.options.extensions.startBlock.forEach(function(He){Ne=He.call({lexer:this},Ie),typeof Ne=="number"&&Ne>=0&&(xe=Math.min(xe,Ne))}),xe<1/0&&xe>=0&&(G=I.substring(0,xe+1))}(),this.state.top&&(x=this.tokenizer.paragraph(G))){P=T[T.length-1],Z&&P.type==="paragraph"?(P.raw+=`
  574. `+x.raw,P.text+=`
  575. `+x.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=P.text):T.push(x),Z=G.length!==I.length,I=I.substring(x.raw.length);continue}if(x=this.tokenizer.text(I)){I=I.substring(x.raw.length),P=T[T.length-1],P&&P.type==="text"?(P.raw+=`
  576. `+x.raw,P.text+=`
  577. `+x.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=P.text):T.push(x);continue}if(I){var se="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(se);break}else throw new Error(se)}}return this.state.top=!0,T},V.inline=function(I,T){this.inlineQueue.push({src:I,tokens:T})},V.inlineTokens=function(I,T){var A=this;T===void 0&&(T=[]);var x,P,G,Z=I,se,xe,Ie;if(this.tokens.links){var Ne=Object.keys(this.tokens.links);if(Ne.length>0)for(;(se=this.tokenizer.rules.inline.reflinkSearch.exec(Z))!=null;)Ne.includes(se[0].slice(se[0].lastIndexOf("[")+1,-1))&&(Z=Z.slice(0,se.index)+"["+Pl("a",se[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(se=this.tokenizer.rules.inline.blockSkip.exec(Z))!=null;)Z=Z.slice(0,se.index)+"["+Pl("a",se[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(se=this.tokenizer.rules.inline.escapedEmSt.exec(Z))!=null;)Z=Z.slice(0,se.index)+"++"+Z.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;I;)if(xe||(Ie=""),xe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ye){return(x=ye.call({lexer:A},I,T))?(I=I.substring(x.raw.length),T.push(x),!0):!1}))){if(x=this.tokenizer.escape(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.tag(I)){I=I.substring(x.raw.length),P=T[T.length-1],P&&x.type==="text"&&P.type==="text"?(P.raw+=x.raw,P.text+=x.text):T.push(x);continue}if(x=this.tokenizer.link(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.reflink(I,this.tokens.links)){I=I.substring(x.raw.length),P=T[T.length-1],P&&x.type==="text"&&P.type==="text"?(P.raw+=x.raw,P.text+=x.text):T.push(x);continue}if(x=this.tokenizer.emStrong(I,Z,Ie)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.codespan(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.br(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.del(I)){I=I.substring(x.raw.length),T.push(x);continue}if(x=this.tokenizer.autolink(I,Fh)){I=I.substring(x.raw.length),T.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(I,Fh))){I=I.substring(x.raw.length),T.push(x);continue}if(G=I,this.options.extensions&&this.options.extensions.startInline&&function(){var ye=1/0,_i=I.slice(1),at=void 0;A.options.extensions.startInline.forEach(function(yn){at=yn.call({lexer:this},_i),typeof at=="number"&&at>=0&&(ye=Math.min(ye,at))}),ye<1/0&&ye>=0&&(G=I.substring(0,ye+1))}(),x=this.tokenizer.inlineText(G,am)){I=I.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(Ie=x.raw.slice(-1)),xe=!0,P=T[T.length-1],P&&P.type==="text"?(P.raw+=x.raw,P.text+=x.text):T.push(x);continue}if(I){var He="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return T},t(j,null,[{key:"rules",get:function(){return{block:kr,inline:wa}}}]),j}(),Sa=r.exports.defaults,Ir=Se.cleanUrl,Bl=Se.escape,Gu=function(){function j(z){this.options=z||Sa}var V=j.prototype;return V.code=function(I,T,A){var x=(T||"").match(/\S*/)[0];if(this.options.highlight){var P=this.options.highlight(I,x);P!=null&&P!==I&&(A=!0,I=P)}return I=I.replace(/\n$/,"")+`
  578. `,x?'<pre><code class="'+this.options.langPrefix+Bl(x,!0)+'">'+(A?I:Bl(I,!0))+`</code></pre>
  579. `:"<pre><code>"+(A?I:Bl(I,!0))+`</code></pre>
  580. `},V.blockquote=function(I){return`<blockquote>
  581. `+I+`</blockquote>
  582. `},V.html=function(I){return I},V.heading=function(I,T,A,x){return this.options.headerIds?"<h"+T+' id="'+this.options.headerPrefix+x.slug(A)+'">'+I+"</h"+T+`>
  583. `:"<h"+T+">"+I+"</h"+T+`>
  584. `},V.hr=function(){return this.options.xhtml?`<hr/>
  585. `:`<hr>
  586. `},V.list=function(I,T,A){var x=T?"ol":"ul",P=T&&A!==1?' start="'+A+'"':"";return"<"+x+P+`>
  587. `+I+"</"+x+`>
  588. `},V.listitem=function(I){return"<li>"+I+`</li>
  589. `},V.checkbox=function(I){return"<input "+(I?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},V.paragraph=function(I){return"<p>"+I+`</p>
  590. `},V.table=function(I,T){return T&&(T="<tbody>"+T+"</tbody>"),`<table>
  591. <thead>
  592. `+I+`</thead>
  593. `+T+`</table>
  594. `},V.tablerow=function(I){return`<tr>
  595. `+I+`</tr>
  596. `},V.tablecell=function(I,T){var A=T.header?"th":"td",x=T.align?"<"+A+' align="'+T.align+'">':"<"+A+">";return x+I+"</"+A+`>
  597. `},V.strong=function(I){return"<strong>"+I+"</strong>"},V.em=function(I){return"<em>"+I+"</em>"},V.codespan=function(I){return"<code>"+I+"</code>"},V.br=function(){return this.options.xhtml?"<br/>":"<br>"},V.del=function(I){return"<del>"+I+"</del>"},V.link=function(I,T,A){if(I=Ir(this.options.sanitize,this.options.baseUrl,I),I===null)return A;var x='<a href="'+Bl(I)+'"';return T&&(x+=' title="'+T+'"'),x+=">"+A+"</a>",x},V.image=function(I,T,A){if(I=Ir(this.options.sanitize,this.options.baseUrl,I),I===null)return A;var x='<img src="'+I+'" alt="'+A+'"';return T&&(x+=' title="'+T+'"'),x+=this.options.xhtml?"/>":">",x},V.text=function(I){return I},j}(),Zu=function(){function j(){}var V=j.prototype;return V.strong=function(I){return I},V.em=function(I){return I},V.codespan=function(I){return I},V.del=function(I){return I},V.html=function(I){return I},V.text=function(I){return I},V.link=function(I,T,A){return""+A},V.image=function(I,T,A){return""+A},V.br=function(){return""},j}(),Bh=function(){function j(){this.seen={}}var V=j.prototype;return V.serialize=function(I){return I.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},V.getNextSafeSlug=function(I,T){var A=I,x=0;if(this.seen.hasOwnProperty(A)){x=this.seen[I];do x++,A=I+"-"+x;while(this.seen.hasOwnProperty(A))}return T||(this.seen[I]=x,this.seen[A]=0),A},V.slug=function(I,T){T===void 0&&(T={});var A=this.serialize(I);return this.getNextSafeSlug(A,T.dryrun)},j}(),lm=Gu,Yu=Zu,Xu=Bh,Ao=r.exports.defaults,Wh=Se.unescape,Qu=function(){function j(z){this.options=z||Ao,this.options.renderer=this.options.renderer||new lm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Yu,this.slugger=new Xu}j.parse=function(I,T){var A=new j(T);return A.parse(I)},j.parseInline=function(I,T){var A=new j(T);return A.parseInline(I)};var V=j.prototype;return V.parse=function(I,T){T===void 0&&(T=!0);var A="",x,P,G,Z,se,xe,Ie,Ne,He,ye,_i,at,yn,zh,Ji,ef,PI,tf,Ow,FI=I.length;for(x=0;x<FI;x++){if(ye=I[x],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[ye.type]&&(Ow=this.options.extensions.renderers[ye.type].call({parser:this},ye),Ow!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(ye.type))){A+=Ow||"";continue}switch(ye.type){case"space":continue;case"hr":{A+=this.renderer.hr();continue}case"heading":{A+=this.renderer.heading(this.parseInline(ye.tokens),ye.depth,Wh(this.parseInline(ye.tokens,this.textRenderer)),this.slugger);continue}case"code":{A+=this.renderer.code(ye.text,ye.lang,ye.escaped);continue}case"table":{for(Ne="",Ie="",Z=ye.header.length,P=0;P<Z;P++)Ie+=this.renderer.tablecell(this.parseInline(ye.header[P].tokens),{header:!0,align:ye.align[P]});for(Ne+=this.renderer.tablerow(Ie),He="",Z=ye.rows.length,P=0;P<Z;P++){for(xe=ye.rows[P],Ie="",se=xe.length,G=0;G<se;G++)Ie+=this.renderer.tablecell(this.parseInline(xe[G].tokens),{header:!1,align:ye.align[G]});He+=this.renderer.tablerow(Ie)}A+=this.renderer.table(Ne,He);continue}case"blockquote":{He=this.parse(ye.tokens),A+=this.renderer.blockquote(He);continue}case"list":{for(_i=ye.ordered,at=ye.start,yn=ye.loose,Z=ye.items.length,He="",P=0;P<Z;P++)Ji=ye.items[P],ef=Ji.checked,PI=Ji.task,zh="",Ji.task&&(tf=this.renderer.checkbox(ef),yn?Ji.tokens.length>0&&Ji.tokens[0].type==="paragraph"?(Ji.tokens[0].text=tf+" "+Ji.tokens[0].text,Ji.tokens[0].tokens&&Ji.tokens[0].tokens.length>0&&Ji.tokens[0].tokens[0].type==="text"&&(Ji.tokens[0].tokens[0].text=tf+" "+Ji.tokens[0].tokens[0].text)):Ji.tokens.unshift({type:"text",text:tf}):zh+=tf),zh+=this.parse(Ji.tokens,yn),He+=this.renderer.listitem(zh,PI,ef);A+=this.renderer.list(He,_i,at);continue}case"html":{A+=this.renderer.html(ye.text);continue}case"paragraph":{A+=this.renderer.paragraph(this.parseInline(ye.tokens));continue}case"text":{for(He=ye.tokens?this.parseInline(ye.tokens):ye.text;x+1<FI&&I[x+1].type==="text";)ye=I[++x],He+=`
  598. `+(ye.tokens?this.parseInline(ye.tokens):ye.text);A+=T?this.renderer.paragraph(He):He;continue}default:{var BI='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(BI);return}else throw new Error(BI)}}}return A},V.parseInline=function(I,T){T=T||this.renderer;var A="",x,P,G,Z=I.length;for(x=0;x<Z;x++){if(P=I[x],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[P.type]&&(G=this.options.extensions.renderers[P.type].call({parser:this},P),G!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(P.type))){A+=G||"";continue}switch(P.type){case"escape":{A+=T.text(P.text);break}case"html":{A+=T.html(P.text);break}case"link":{A+=T.link(P.href,P.title,this.parseInline(P.tokens,T));break}case"image":{A+=T.image(P.href,P.title,P.text);break}case"strong":{A+=T.strong(this.parseInline(P.tokens,T));break}case"em":{A+=T.em(this.parseInline(P.tokens,T));break}case"codespan":{A+=T.codespan(P.text);break}case"br":{A+=T.br();break}case"del":{A+=T.del(this.parseInline(P.tokens,T));break}case"text":{A+=T.text(P.text);break}default:{var se='Token with "'+P.type+'" type was not found.';if(this.options.silent){console.error(se);return}else throw new Error(se)}}}return A},j}(),Ls=Fl,Wl=Qu,Vh=xr,Ju=Gu,dm=Zu,Hh=Bh,ya=Se.merge,hm=Se.checkSanitizeDeprecation,Ds=Se.escape,cm=r.exports.getDefaults,um=r.exports.changeDefaults,fm=r.exports.defaults;function Ze(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=ya({},Ze.defaults,V||{}),hm(V),z){var I=V.highlight,T;try{T=Ls.lex(j,V)}catch(G){return z(G)}var A=function(Z){var se;if(!Z)try{V.walkTokens&&Ze.walkTokens(T,V.walkTokens),se=Wl.parse(T,V)}catch(xe){Z=xe}return V.highlight=I,Z?z(Z):z(null,se)};if(!I||I.length<3||(delete V.highlight,!T.length))return A();var x=0;Ze.walkTokens(T,function(G){G.type==="code"&&(x++,setTimeout(function(){I(G.text,G.lang,function(Z,se){if(Z)return A(Z);se!=null&&se!==G.text&&(G.text=se,G.escaped=!0),x--,x===0&&A()})},0))}),x===0&&A();return}try{var P=Ls.lex(j,V);return V.walkTokens&&Ze.walkTokens(P,V.walkTokens),Wl.parse(P,V)}catch(G){if(G.message+=`
  599. Please report this to https://github.com/markedjs/marked.`,V.silent)return"<p>An error occurred:</p><pre>"+Ds(G.message+"",!0)+"</pre>";throw G}}Ze.options=Ze.setOptions=function(j){return ya(Ze.defaults,j),um(Ze.defaults),Ze},Ze.getDefaults=cm,Ze.defaults=fm,Ze.use=function(){for(var j=this,V=arguments.length,z=new Array(V),I=0;I<V;I++)z[I]=arguments[I];var T=ya.apply(void 0,[{}].concat(z)),A=Ze.defaults.extensions||{renderers:{},childTokens:{}},x;z.forEach(function(P){if(P.extensions&&(x=!0,P.extensions.forEach(function(Z){if(!Z.name)throw new Error("extension name required");if(Z.renderer){var se=A.renderers?A.renderers[Z.name]:null;se?A.renderers[Z.name]=function(){for(var xe=arguments.length,Ie=new Array(xe),Ne=0;Ne<xe;Ne++)Ie[Ne]=arguments[Ne];var He=Z.renderer.apply(this,Ie);return He===!1&&(He=se.apply(this,Ie)),He}:A.renderers[Z.name]=Z.renderer}if(Z.tokenizer){if(!Z.level||Z.level!=="block"&&Z.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");A[Z.level]?A[Z.level].unshift(Z.tokenizer):A[Z.level]=[Z.tokenizer],Z.start&&(Z.level==="block"?A.startBlock?A.startBlock.push(Z.start):A.startBlock=[Z.start]:Z.level==="inline"&&(A.startInline?A.startInline.push(Z.start):A.startInline=[Z.start]))}Z.childTokens&&(A.childTokens[Z.name]=Z.childTokens)})),P.renderer&&function(){var Z=Ze.defaults.renderer||new Ju,se=function(Ne){var He=Z[Ne];Z[Ne]=function(){for(var ye=arguments.length,_i=new Array(ye),at=0;at<ye;at++)_i[at]=arguments[at];var yn=P.renderer[Ne].apply(Z,_i);return yn===!1&&(yn=He.apply(Z,_i)),yn}};for(var xe in P.renderer)se(xe);T.renderer=Z}(),P.tokenizer&&function(){var Z=Ze.defaults.tokenizer||new Vh,se=function(Ne){var He=Z[Ne];Z[Ne]=function(){for(var ye=arguments.length,_i=new Array(ye),at=0;at<ye;at++)_i[at]=arguments[at];var yn=P.tokenizer[Ne].apply(Z,_i);return yn===!1&&(yn=He.apply(Z,_i)),yn}};for(var xe in P.tokenizer)se(xe);T.tokenizer=Z}(),P.walkTokens){var G=Ze.defaults.walkTokens;T.walkTokens=function(Z){P.walkTokens.call(j,Z),G&&G(Z)}}x&&(T.extensions=A),Ze.setOptions(T)})},Ze.walkTokens=function(j,V){for(var z=function(){var x=T.value;switch(V(x),x.type){case"table":{for(var P=o(x.header),G;!(G=P()).done;){var Z=G.value;Ze.walkTokens(Z.tokens,V)}for(var se=o(x.rows),xe;!(xe=se()).done;)for(var Ie=xe.value,Ne=o(Ie),He;!(He=Ne()).done;){var ye=He.value;Ze.walkTokens(ye.tokens,V)}break}case"list":{Ze.walkTokens(x.items,V);break}default:Ze.defaults.extensions&&Ze.defaults.extensions.childTokens&&Ze.defaults.extensions.childTokens[x.type]?Ze.defaults.extensions.childTokens[x.type].forEach(function(_i){Ze.walkTokens(x[_i],V)}):x.tokens&&Ze.walkTokens(x.tokens,V)}},I=o(j),T;!(T=I()).done;)z()},Ze.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=ya({},Ze.defaults,V||{}),hm(V);try{var z=Ls.lexInline(j,V);return V.walkTokens&&Ze.walkTokens(z,V.walkTokens),Wl.parseInline(z,V)}catch(I){if(I.message+=`
  600. Please report this to https://github.com/markedjs/marked.`,V.silent)return"<p>An error occurred:</p><pre>"+Ds(I.message+"",!0)+"</pre>";throw I}},Ze.Parser=Wl,Ze.parser=Wl.parse,Ze.Renderer=Ju,Ze.TextRenderer=dm,Ze.Lexer=Ls,Ze.lexer=Ls.lex,Ze.Tokenizer=Vh,Ze.Slugger=Hh,Ze.parse=Ze;var Vl=Ze;return Vl})})();Dr.Parser;Dr.parser;var nJ=Dr.Renderer;Dr.TextRenderer;Dr.Lexer;Dr.lexer;Dr.Tokenizer;Dr.Slugger;var sJ=Dr.parse;function oJ(s,e={},t={}){var i;const n=new X;let o=!1;const r=n.add(new ln),a=Zk(e),l=function(m){let _;try{_=$1(decodeURIComponent(m))}catch{}return _?(_=cW(_,C=>{if(s.uris&&s.uris[C])return me.revive(s.uris[C])}),encodeURIComponent(JSON.stringify(_))):m},d=function(m,_){const C=s.uris&&s.uris[m];if(!C)return m;let b=me.revive(C);return _?m.startsWith(Te.data+":")?m:UR.asBrowserUri(b).toString(!0):me.parse(m).toString()===b.toString()?m:(b.query&&(b=b.with({query:l(b.query)})),b.toString())};let h;const c=new Promise(m=>h=m),u=new nJ;if(u.image=(m,_,C)=>{let b=[],v=[];if(m){({href:m,dimensions:b}=IG(m)),m=d(m,!0);try{const w=me.parse(m);e.baseUrl&&w.scheme===Te.file&&(m=sE(e.baseUrl,m).toString())}catch{}v.push(`src="${m}"`)}return C&&v.push(`alt="${C}"`),_&&v.push(`title="${_}"`),b.length&&(v=v.concat(b)),"<img "+v.join(" ")+">"},u.link=(m,_,C)=>(m===C&&(C=oS(C)),m=d(m,!1),e.baseUrl&&(/^\w[\w\d+.-]*:/.test(m)||(m=sE(e.baseUrl,m).toString())),_=oS(_),m=oS(m),!m||m.match(/^data:|javascript:/i)||m.match(/^command:/i)&&!s.isTrusted||m.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?C:(m=m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="#" data-href="${m}" title="${_||m}">${C}</a>`)),u.paragraph=m=>`<p>${m}</p>`,e.codeBlockRenderer&&(u.code=(m,_)=>{const C=e.codeBlockRenderer(_,m),b=v2.nextId();return KD(Promise.all([C,c]),r.token).then(v=>{var w;if(!o&&v){const y=a.querySelector(`div[data-code="${b}"]`);y&&al(y,v[0]),(w=e.asyncRenderCallback)===null||w===void 0||w.call(e)}}).catch(()=>{}),`<div class="code" data-code="${b}">${QD(m)}</div>`}),e.actionHandler){const m=e.actionHandler.disposables.add(new mt(a,"click")),_=e.actionHandler.disposables.add(new mt(a,"auxclick"));e.actionHandler.disposables.add(he.any(m.event,_.event)(C=>{const b=new cs(C);if(!b.leftButton&&!b.middleButton)return;let v=b.target;if(!(v.tagName!=="A"&&(v=v.parentElement,!v||v.tagName!=="A")))try{const w=v.dataset.href;w&&e.actionHandler.callback(w,b)}catch(w){Le(w)}finally{b.preventDefault()}}))}s.supportHtml||(t.sanitizer=m=>(s.isTrusted?m.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(i=s.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),s.supportThemeIcons&&(f=RK(f));let g=sJ(f,t);if(s.supportThemeIcons&&(g=Rd(g).map(_=>typeof _=="string"?_:_.outerHTML).join("")),a.innerHTML=rJ(s,g),h(),e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=n.add(q(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{o=!0,r.cancel(),n.dispose()}}}function rJ(s,e){const{config:t,allowedSchemes:i}=aJ(s);wA("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const n=document.createElement("a");wA("afterSanitizeAttributes",o=>{for(const r of["href","src"])o.hasAttribute(r)&&(n.href=o.getAttribute(r),i.includes(n.protocol.replace(/:$/,""))||o.removeAttribute(r))});try{return iJ(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{SA("uponSanitizeAttribute"),SA("afterSanitizeAttributes")}}function aJ(s){const e=[Te.http,Te.https,Te.mailto,Te.data,Te.file,Te.vscodeFileResource,Te.vscodeRemote,Te.vscodeRemoteResource];return s.isTrusted&&e.push(Te.command),{config:{ALLOWED_TAGS:["ul","li","p","b","i","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"],ALLOWED_ATTR:["href","data-href","target","title","src","alt","class","style","data-code","width","height","align"],ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}var lJ=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},yA=function(s,e){return function(t,i){e(t,i,s)}},dJ=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},ES;let wl=class BF{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){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new X;return{element:n.add(oJ(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i)).element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{baseUrl:this._options.baseUrl,codeBlockRenderer:(i,n)=>dJ(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.getLanguageId()),d||(d="plaintext"),this._modeService.triggerMode(d);const h=(r=yield Rt.getPromise(d))!==null&&r!==void 0?r:void 0,c=document.createElement("span");if(c.innerHTML=(l=(a=BF._ttpTokenizer)===null||a===void 0?void 0:a.createHTML(n,this._modeService.languageIdCodec,h))!==null&&l!==void 0?l:bP(n,this._modeService.languageIdCodec,h),this._options.editor){const u=this._options.editor.getOption(43);Ui.applyFontInfoSlow(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return c}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>this._openerService.open(i,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:e.isTrusted}).catch(Le),disposables:t}}}};wl._ttpTokenizer=(ES=window.trustedTypes)===null||ES===void 0?void 0:ES.createPolicy("tokenizeToString",{createHTML(s,e,t){return bP(s,e,t)}});wl=lJ([yA(1,Qi),yA(2,Co)],wl);function WF(s,e,t){const n=wg.ordered(s).map(o=>Promise.resolve(o.provideHover(s,e,t)).then(r=>r&&hJ(r)?r:void 0,r=>{Di(r)}));return Promise.all(n).then(vh)}vr("_executeHoverProvider",(s,e)=>WF(s,e,Oe.None));function hJ(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}var cJ=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},NS=function(s,e){return function(t,i){e(t,i,s)}},uJ=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const LA=Y;class n_{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 JL=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 n_(this,e.range,[new ma().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 h of t){const c=h.range.startLineNumber===n?h.range.startColumn:1,u=h.range.endLineNumber===n?h.range.endColumn:o,f=h.options.hoverMessage;if(!f||dg(f))continue;const g=new S(e.range.startLineNumber,c,e.range.startLineNumber,u);r.push(new n_(this,g,bx(f)))}const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});return typeof d=="number"&&a>=d&&r.push(new n_(this,e.range,[{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 uJ(this,void 0,void 0,function*(){if(!this._editor.hasModel()||e.type!==1)return Promise.resolve([]);const n=this._editor.getModel();if(!wg.has(n))return Promise.resolve([]);const o=yield WF(n,new F(e.range.startLineNumber,e.range.startColumn),i),r=[];for(const a of o){if(dg(a.contents))continue;const l=a.range?S.lift(a.range):e.range;r.push(new n_(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(dg(r))continue;const a=LA("div.hover-row.markdown-hover"),l=U(a,LA("div.hover-contents")),d=n.add(new wl({editor:this._editor},this._modeService,this._openerService));n.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",this._hover.onContentsChanged()}));const h=n.add(d.render(r));l.appendChild(h.element),t.appendChild(a)}return n}};JL=cJ([NS(2,Qi),NS(3,Co),NS(4,Vt)],JL);var VF=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},HF=function(s,e){return function(t,i){e(t,i,s)}};class DA{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let eD=class zF{constructor(e,t){this._markerService=t,this._onDidChange=new M,this.onDidChange=this._onDidChange.event,this._dispoables=new X,this._markers=[],this._nextIdx=-1,me.isUri(e)?this._resourceFilter=n=>n.toString()===e.toString():e&&(this._resourceFilter=e);const i=()=>{this._markers=this._markerService.read({resource:me.isUri(e)?e:void 0,severities:Mt.Error|Mt.Warning|Mt.Info}),typeof e=="function"&&(this._markers=this._markers.filter(n=>this._resourceFilter(n.resource))),this._markers.sort(zF._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 DA(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=mx(this._markers,{resource:e.uri},(r,a)=>bg(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;r<this._markers.length;r++){let a=S.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new S(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(S.containsPosition(this._markers[i],t))return new DA(this._markers[i],i+1,this._markers.length)}}static _compareMarker(e,t){let i=bg(e.resource.toString(),t.resource.toString());return i===0&&(i=Mt.compare(e.severity,t.severity)),i===0&&(i=S.compareRangesUsingStarts(e,t)),i}};eD=VF([HF(1,Xp)],eD);const UF=Je("IMarkerNavigationService");let tD=class{constructor(e){this._markerService=e,this._provider=new jn}getMarkerList(e){for(let t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new eD(e,this._markerService)}};tD=VF([HF(0,Xp)],tD);Il(UF,tD,!0);var iD;(function(s){function e(t){switch(t){case Wt.Ignore:return"severity-ignore "+ie.info.classNames;case Wt.Info:return ie.info.classNames;case Wt.Warning:return ie.warning.classNames;case Wt.Error:return ie.error.classNames;default:return""}}s.className=e})(iD||(iD={}));st((s,e)=>{const t=s.getColor(w6);if(t){const o=ie.error.cssSelector;e.addRule(`
  601. .monaco-editor .zone-widget ${o},
  602. .markers-panel .marker-icon${o},
  603. .text-search-provider-messages .providerMessage ${o},
  604. .extensions-viewlet > .extensions ${o} {
  605. color: ${t};
  606. }
  607. `)}const i=s.getColor(S6);if(i){const o=ie.warning.cssSelector;e.addRule(`
  608. .monaco-editor .zone-widget ${o},
  609. .markers-panel .marker-icon${o},
  610. .extensions-viewlet > .extensions ${o},
  611. .extension-editor ${o},
  612. .text-search-provider-messages .providerMessage ${o},
  613. .preferences-editor ${o} {
  614. color: ${i};
  615. }
  616. `)}const n=s.getColor(y6);if(n){const o=ie.info.cssSelector;e.addRule(`
  617. .monaco-editor .zone-widget ${o},
  618. .markers-panel .marker-icon${o},
  619. .extensions-viewlet > .extensions ${o},
  620. .text-search-provider-messages .providerMessage ${o},
  621. .extension-editor ${o} {
  622. color: ${n};
  623. }
  624. `)}});var fJ=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},ec=function(s,e){return function(t,i){e(t,i,s)}};class gJ{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(ii(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new dk(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(){qe(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=cr(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Li(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=U(this._codeLink,Y("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Li(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Tn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(58)*.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=`${pF(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);let _=document.createElement("span");_.innerText=f.message,g.appendChild(m),g.appendChild(_),this._lines+=1,u.appendChild(g)}}const d=this._editor.getOption(43),h=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),c=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:c})}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 Mt.Error:t=p("Error","Error");break;case Mt.Warning:t=p("Warning","Warning");break;case Mt.Info:t=p("Info","Info");break;case Mt.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 _u=class $F extends RC{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},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=Mt.Warning,this._backgroundColor=W.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(bJ);let t=nD,i=pJ;this._severity===Mt.Warning?(t=sD,i=mJ):this._severity===Mt.Info&&(t=oD,i=_J);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(uF),secondaryHeadingColor:e.getColor(fF)})}_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($F.TitleMenu,this._contextKeyService);XX(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=U(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 gJ(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=S.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(qs(a.uri),l)}this._icon.className=`codicon ${iD.className(Mt.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()}};_u.TitleMenu=new ae("gotoErrorTitleMenu");_u=fJ([ec(1,Dt),ec(2,Co),ec(3,yh),ec(4,Ge),ec(5,ve),ec(6,qp)],_u);let xA=Mg(ig,WO),kA=Mg(sa,Lv),IA=Mg(mo,Xx);const nD=R("editorMarkerNavigationError.background",{dark:xA,light:xA,hc:Zt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),pJ=R("editorMarkerNavigationError.headerBackground",{dark:wt(nD,.1),light:wt(nD,.1),hc:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),sD=R("editorMarkerNavigationWarning.background",{dark:kA,light:kA,hc:Zt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),mJ=R("editorMarkerNavigationWarning.headerBackground",{dark:wt(sD,.1),light:wt(sD,.1),hc:"#0C141F"},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),oD=R("editorMarkerNavigationInfo.background",{dark:IA,light:IA,hc:Zt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),_J=R("editorMarkerNavigationInfo.headerBackground",{dark:wt(oD,.1),light:wt(oD,.1),hc:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),bJ=R("editorMarkerNavigation.background",{dark:ms,light:ms,hc:ms},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));st((s,e)=>{const t=s.getColor(Vp);t&&e.addRule(`.monaco-editor .marker-widget a.code-link span { color: ${t}; }`);const i=s.getColor(Hp);i&&e.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${i}; }`)});var CJ=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},s_=function(s,e){return function(t,i){e(t,i,s)}},jF=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Sl=class K_{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=KF.bindTo(this._contextKeyService)}static get(e){return e.getContribution(K_.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(_u,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)||!S.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:S.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 F(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){return jF(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&&(K_.get(n).close(),K_.get(n).nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}})}};Sl.ID="editor.contrib.markerController";Sl=CJ([s_(1,UF),s_(2,ve),s_(3,tt),s_(4,Ge)],Sl);class dw extends oe{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){return jF(this,void 0,void 0,function*(){t.hasModel()&&Sl.get(t).nagivate(this._next,this._multiFile)})}}class aa extends dw{constructor(){super(!0,!1,{id:aa.ID,label:aa.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:578,weight:100},menuOpts:{menuId:_u.TitleMenu,title:aa.LABEL,icon:Oi("marker-navigation-next",ie.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}aa.ID="editor.action.marker.next";aa.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class bu extends dw{constructor(){super(!1,!1,{id:bu.ID,label:bu.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:1602,weight:100},menuOpts:{menuId:_u.TitleMenu,title:aa.LABEL,icon:Oi("marker-navigation-previous",ie.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}bu.ID="editor.action.marker.prev";bu.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class vJ extends dw{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:E.focus,primary:66,weight:100},menuOpts:{menuId:ae.MenubarGoMenu,title:p({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class wJ extends dw{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:E.focus,primary:1090,weight:100},menuOpts:{menuId:ae.MenubarGoMenu,title:p({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}nt(Sl.ID,Sl);ee(aa);ee(bu);ee(vJ);ee(wJ);const KF=new re("markersNavigationVisible",!1),SJ=Mi.bindToContribution(Sl.get);J(new SJ({id:"closeMarkersNavigation",precondition:KF,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:E.focus,primary:9,secondary:[1033]}}));var yJ=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},EA=function(s,e){return function(t,i){e(t,i,s)}};const ks=Y;class LJ{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 NA={type:1,filter:{include:We.QuickFix}};let rD=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,h=this._markerDecorationsService.getMarker(i.uri,a);if(!h)continue;const c=new S(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new LJ(this,c,h))}return r}renderHoverParts(e,t,i){if(!e.length)return H.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)=>Mt.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(o,i,n),n}renderMarkerHover(e,t){const i=ks("div.hover-row"),n=U(i,ks("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=U(n,ks("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,o||a)if(a&&typeof a!="string"){const h=ks("span");if(o){const g=U(h,ks("span"));g.innerText=o}const c=U(h,ks("a.code-link"));c.setAttribute("href",a.target.toString()),t.add(q(c,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const u=U(c,ks("span"));u.innerText=a.value;const f=U(n,h);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const h=U(n,ks("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Tn(l))for(const{message:h,resource:c,startLineNumber:u,startColumn:f}of l){const g=U(n,ks("div"));g.style.marginTop="8px";const m=U(g,ks("a"));m.innerText=`${qs(c)}(${u}, ${f}): `,m.style.cursor="pointer",t.add(q(m,"click",C=>{C.stopPropagation(),C.preventDefault(),this._openerService&&this._openerService.open(c,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(Le)}));const _=U(g,ks("span"));_.innerText=h,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((e.marker.severity===Mt.Error||e.marker.severity===Mt.Warning||e.marker.severity===Mt.Info)&&t.addAction({label:p("view problem","View Problem"),commandId:aa.ID,run:()=>{this._hover.hide(),Sl.get(this._editor).showAtMarker(e.marker),this._editor.focus()}}),!this._editor.getOption(80)){const n=t.append(ks("div"));this.recentMarkerCodeActionsInfo&&(IC.makeKey(this.recentMarkerCodeActionsInfo.marker)===IC.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?H.None:i.add(Bd(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(e.marker);i.add(Ve(()=>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(Ve(()=>{l||a.dispose()})),t.addAction({label:p("quick fixes","Quick Fix..."),commandId:Vu.Id,run:d=>{l=!0;const h=th.get(this._editor),c=Ii(d);this._hover.hide(),h.showCodeActions(NA,a,{x:c.left+6,y:c.top+c.height+6})}})},Le)}}getCodeActions(e){return gi(t=>dI(this._editor.getModel(),new S(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),NA,xh.None,t))}};rD=yJ([EA(2,Ex),EA(3,Co)],rD);st((s,e)=>{const t=s.getColor(Vp);t&&e.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${t}; }`);const i=s.getColor(Hp);i&&e.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)});const qF="editor.action.inlineSuggest.commit";class GF{constructor(e,t,i=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=i}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return xJ(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(`
  625. `)}))).substring(this.parts[0].column-1)}}class DJ{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
  626. `&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}function xJ(s,e){const t=new DJ(s),i=e.map(n=>{const o=S.lift(n.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:n.text}});i.sort((n,o)=>o.startOffset-n.startOffset);for(const n of i)s=s.substring(0,n.startOffset)+n.text+s.substring(n.endOffset);return s}class TA{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}}class ZF extends H{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(105)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}function kJ(s,e){return s===e?!0:!s||!e?!1:s.range.equalsRange(e.range)&&s.text===e.text&&s.command===e.command}function YF(s,e,t,i,n=0){if(s.range.startLineNumber!==s.range.endLineNumber)return;const o=e.getLineContent(s.range.startLineNumber),r=ht(o).length;if(s.range.startColumn-1<=r){const f=ht(s.text).length,g=o.substring(s.range.startColumn-1,r),m=S.fromPositions(s.range.getStartPosition().delta(0,g.length),s.range.getEndPosition()),_=s.text.startsWith(g)?s.text.substring(g.length):s.text.substring(f);s={range:m,text:_,command:s.command}}const l=e.getValueInRange(s.range),d=IJ(l,s.text);if(!d)return;const h=s.range.startLineNumber,c=new Array;if(t==="prefix"){const f=d.filter(g=>g.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==l.length)return}const u=s.text.length-n;for(const f of d){const g=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&g<i.column||f.originalLength>0)return;if(f.modifiedLength===0)continue;const m=f.modifiedStart+f.modifiedLength,_=Math.max(f.modifiedStart,Math.min(m,u)),C=s.text.substring(f.modifiedStart,_),b=s.text.substring(_,Math.max(f.modifiedStart,m));if(C.length>0){const v=cr(C);c.push(new TA(g,v,!1))}if(b.length>0){const v=cr(b);c.push(new TA(g,v,!0))}}return new GF(h,c,0)}let Po;function IJ(s,e){if((Po==null?void 0:Po.originalValue)===s&&(Po==null?void 0:Po.newValue)===e)return Po==null?void 0:Po.changes;{const t=EJ(s,e);return Po={originalValue:s,newValue:e,changes:t},t}}function EJ(s,e){if(s.length>5e3||e.length>5e3)return;function t(l){let d=0;for(let h=0,c=l.length;h<c;h++){const u=l.charCodeAt(h);u>d&&(d=u)}return d}const i=Math.max(t(s),t(e));function n(l){if(l<0)throw new Error("unexpected");return i+l+1}function o(l){let d=0,h=0;const c=new Int32Array(l.length);for(let u=0,f=l.length;u<f;u++){const g=h*100+d;l[u]==="("?(c[u]=n(2*g),d++):l[u]===")"?(c[u]=n(2*g+1),d===1&&h++,d=Math.max(d-1,0)):c[u]=l.charCodeAt(u)}return c}const r=o(s),a=o(e);return new Yo({getElements:()=>r},{getElements:()=>a}).ComputeDiff(!1).changes}var NJ=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},TJ=function(s,e){return function(t,i){e(t,i,s)}},Gr=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let aD=class extends H{constructor(e,t,i){super(),this.editor=e,this.cache=t,this.commandService=i,this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.completionSession=this._register(new dn),this.active=!1,this.disposed=!1,this._register(i.onDidExecuteCommand(n=>{new Set([Tx.id,Ax.id,zc.Tab.id,zc.DeleteLeft.id,zc.DeleteRight.id,qF,"acceptSelectedSuggestion"]).has(n.commandId)&&e.hasTextFocus()&&this.handleUserInput()})),this._register(this.editor.onDidType(n=>{this.handleUserInput()})),this._register(this.editor.onDidChangeCursorPosition(n=>{this.session&&!this.session.isValid&&this.hide()})),this._register(Ve(()=>{this.disposed=!0})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.hide()}))}handleUserInput(){this.session&&!this.session.isValid&&this.hide(),setTimeout(()=>{this.disposed||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}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(54).enabled&&(this.session&&this.session.isValid||this.trigger(ls.Automatic))}trigger(e){if(this.completionSession.value){e===ls.Explicit&&this.completionSession.value.ensureUpdateWithExplicitContext();return}this.completionSession.value=new AJ(this.editor,this.editor.getPosition(),()=>this.active,this.commandService,this.cache,e),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 Gr(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})}};aD=NJ([TJ(2,Yt)],aD);class AJ extends ZF{constructor(e,t,i,n,o,r){super(e),this.triggerPosition=t,this.shouldUpdate=i,this.commandService=n,this.cache=o,this.initialTriggerKind=r,this.minReservedLineCount=0,this.updateOperation=this._register(new dn),this.updateSoon=this._register(new Lt(()=>{let l=this.initialTriggerKind;return this.initialTriggerKind=ls.Automatic,this.update(l)},50)),this.currentlySelectedCompletionId=void 0;let a;this._register(this.onDidChange(()=>{const l=this.currentCompletion;if(l&&l.sourceInlineCompletion!==a){a=l.sourceInlineCompletion;const d=l.sourceProvider;d.handleItemDidShow&&d.handleItemDidShow(l.sourceInlineCompletions,a)}})),this._register(Ve(()=>{this.cache.clear()})),this._register(this.editor.onDidChangeCursorPosition(l=>{this.cache.value&&this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeModelContent(l=>{this.scheduleAutomaticUpdate()})),this._register(hx.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 Gr(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 Gr(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 Gr(this,void 0,void 0,function*(){this.updateOperation.value?this.updateOperation.value.triggerKind===ls.Explicit?yield this.updateOperation.value.promise:yield this.update(ls.Explicit):((e=this.cache.value)===null||e===void 0?void 0:e.triggerKind)!==ls.Explicit&&(yield this.update(ls.Explicit))})}hasMultipleInlineCompletions(){var e;return Gr(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(54).mode;return e?YF(e,this.editor.getModel(),t,this.editor.getPosition()):void 0}get currentCompletion(){const e=this.currentCachedCompletion;if(e)return e.toLiveInlineCompletion()}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule()}update(e){return Gr(this,void 0,void 0,function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),i=gi(o=>Gr(this,void 0,void 0,function*(){let r;try{r=yield QF(t,this.editor.getModel(),{triggerKind:e,selectedSuggestionInfo:void 0},o)}catch(a){Le(a);return}o.isCancellationRequested||(this.cache.setValue(this.editor,r,e),this.onDidChangeEmitter.fire())})),n=new XF(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.clearAndLeak();this.editor.executeEdits("inlineSuggestion.accept",[Ut.replaceMove(e.range,e.text)]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally(()=>{t==null||t.dispose()}).then(void 0,Di):t==null||t.dispose(),this.onDidChangeEmitter.fire()}}class XF{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class RJ extends H{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(Ve(()=>{e.deltaDecorations(o,[])})),this.completions=t.items.map((r,a)=>new MJ(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){Le(new Error("Decoration has no range"));continue}l.synchronizedRange.equalsRange(d)||(r=!0,l.synchronizedRange=d)}r&&i()})),this._register(t)}}class MJ{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}toLiveInlineCompletion(){return{text:this.inlineCompletion.text,range:this.synchronizedRange,command:this.inlineCompletion.command,sourceProvider:this.inlineCompletion.sourceProvider,sourceInlineCompletions:this.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:this.inlineCompletion.sourceInlineCompletion}}}function OJ(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new S(s.lineNumber,t.startColumn,s.lineNumber,i):S.fromPositions(s,s.with(void 0,i))}function QF(s,e,t,i=Oe.None){return Gr(this,void 0,void 0,function*(){const n=OJ(s,e),o=hx.all(e),r=yield Promise.all(o.map(l=>Gr(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 h of d.items.map(c=>({text:c.text,range:c.range?S.lift(c.range):n,command:c.command,sourceProvider:l.provider,sourceInlineCompletions:d,sourceInlineCompletion:c})))h.range.startLineNumber===h.range.endLineNumber&&a.set(JSON.stringify({text:h.text,range:h.range}),h)}return{items:[...a.values()],dispose:()=>{for(const l of r)l.dispose()}}})}function OC(s,e){if(!e)return e;const t=s.getValueInRange(e.range),i=Zc(t,e.text),n=s.getOffsetAt(e.range.getStartPosition())+i,o=s.getPositionAt(n),r=t.substr(i),a=fb(r,e.text),l=s.getPositionAt(Math.max(n,s.getOffsetAt(e.range.getEndPosition())-a));return{range:S.fromPositions(o,l),text:e.text.substr(i,e.text.length-i-a)}}class Ns{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=Ns._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Ns.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ns.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Ns.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Ns.isVariableCharacter(i)||Ns.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 Ns._table[i]>"u"&&!Ns.isDigitCharacter(i)&&!Ns.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}Ns._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class zu{constructor(){this._children=[]}appendChild(e){return e instanceof In&&this._children[this._children.length-1]instanceof In?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 hw)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class In extends zu{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new In(this.value)}}class JF extends zu{}class Fs extends JF{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 sm?this._children[0]:void 0}clone(){let e=new Fs(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class sm extends zu{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof In&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new sm;return this.options.forEach(e.appendChild,e),e}}class pI extends zu{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 no&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof no){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){let e=new pI;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 no extends zu{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 no(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class gp extends JF{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 In(t)],!0):!1}clone(){const e=new gp(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function AA(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class hw extends zu{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof Fs&&(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 AA([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Fs&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gp&&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 hw;return this._children=this.children.map(t=>t.clone()),e}walk(e){AA(this.children,e)}}class cw{constructor(){this._scanner=new Ns,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 hw;for(;this._parse(n););const o=new Map,r=[];let a=0;n.walk(l=>(l instanceof Fs&&(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 h=new Fs(l.index);h.transform=l.transform;for(const c of d)h.appendChild(c.clone());n.replace(l,[h])}}return i||(i=a>0&&t),!o.has(0)&&i&&n.appendChild(new Fs(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 In(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 Fs(Number(t)):new gp(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 Fs(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new In("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new sm;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 In(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 gp(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new In("${"+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 pI,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 In(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 no(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new no(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 no(Number(n),o)),!0)}else if(this._accept(11)){let o=this._until(4);if(o)return e.appendChild(new no(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){let o=this._until(4);if(o)return e.appendChild(new no(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 no(Number(n),void 0,o,r)),!0}}else{let o=this._until(4);if(o)return e.appendChild(new no(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new In(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}const bi=new Uint8Array(16),en=[];for(let s=0;s<256;s++)en.push(s.toString(16).padStart(2,"0"));let lD;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?lD=crypto.getRandomValues.bind(crypto):lD=function(s){for(let e=0;e<s.length;e++)s[e]=Math.floor(Math.random()*256);return s};function PJ(){lD(bi),bi[6]=bi[6]&15|64,bi[8]=bi[8]&63|128;let s=0,e="";return e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e+="-",e+=en[bi[s++]],e+=en[bi[s++]],e+="-",e+=en[bi[s++]],e+=en[bi[s++]],e+="-",e+=en[bi[s++]],e+=en[bi[s++]],e+="-",e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e+=en[bi[s++]],e}const RA="code-workspace";function MA(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&me.isUri(e.uri)}function FJ(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}}class BJ{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 WJ{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=ht(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(d=>d===e?!1:(d instanceof In&&(a=ht(cr(d.value).pop())),!0));const l=Zc(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(d,h,c)=>`${h}${a.substr(l)}${c}`)}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 VJ{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return bd(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=bd(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return RR(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(sx(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class HJ{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=>!eM(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}class zJ{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=Qe.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 ir{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return ir.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return ir.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return ir.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return ir.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3))}}ir.dayNames=[p("Sunday","Sunday"),p("Monday","Monday"),p("Tuesday","Tuesday"),p("Wednesday","Wednesday"),p("Thursday","Thursday"),p("Friday","Friday"),p("Saturday","Saturday")];ir.dayNamesShort=[p("SundayShort","Sun"),p("MondayShort","Mon"),p("TuesdayShort","Tue"),p("WednesdayShort","Wed"),p("ThursdayShort","Thu"),p("FridayShort","Fri"),p("SaturdayShort","Sat")];ir.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")];ir.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 UJ{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=FJ(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(MA(e))return bd(e.uri.path);let t=bd(e.configPath.path);return t.endsWith(RA)&&(t=t.substr(0,t.length-RA.length-1)),t}_resoveWorkspacePath(e){if(MA(e))return VL(e.uri.fsPath);let t=bd(e.configPath.path),i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?VL(i):"/"}}class $J{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 PJ()}}st((s,e)=>{function t(i){const n=s.getColor(i);return n?n.toString():"transparent"}e.addRule(`.monaco-editor .snippet-placeholder { background-color: ${t(h6)}; outline-color: ${t(c6)}; }`),e.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${t(u6)}; outline-color: ${t(f6)}; }`)});class Ts{constructor(e,t,i,n){this._editor=e,this._snippet=t,this._offset=i,this._snippetLineLeadingWhitespace=n,this._nestingLevel=1,this._placeholderGroups=IE(t.placeholders,Fs.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=S.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?Ts._decor.inactiveFinal:Ts._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 h=1;h<d.length;h++)d[h]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+d[h]);n.push(Ut.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 ne(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?Ts._decor.activeFinal:Ts._decor.active),o.add(a);for(const h of this._snippet.enclosingPlaceholders(a)){const c=this._placeholderDecorations.get(h);n.changeDecorationOptions(c,h.isFinalTabstop?Ts._decor.activeFinal:Ts._decor.active),o.add(h)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?Ts._decor.inactiveFinal:Ts._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Fs){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),h=o._snippet.fullLen(l),c=S.fromPositions(t.getPositionAt(o._offset+d),t.getPositionAt(o._offset+d+h)),u=i.addDecoration(c,Ts._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=IE(this._snippet.placeholders,Fs.compareByIndex)})}}Ts._decor={active:Ee.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ee.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ee.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ee.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const OA={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class Uo{constructor(e,t,i=OA){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=ht(r,0,t.column-1);let l;return i.walk(d=>{if(!(d instanceof In)||d.parent instanceof sm)return!0;const h=d.value.split(/\r\n|\r|\n/);if(n){const u=i.offset(d);if(u===0)h[0]=e.normalizeIndentation(h[0]);else{l=l??i.toString();let f=l.charCodeAt(u-1);(f===10||f===13)&&(h[0]=e.normalizeIndentation(a+h[0]))}for(let f=1;f<h.length;f++)h[f]=e.normalizeIndentation(a+h[f])}const c=h.join(e.getEOL());return c!==d.value&&(d.parent.replace(d,[new In(c)]),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=ne.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=[],h=[];if(!e.hasModel())return{edits:d,snippets:h};const c=e.getModel(),u=e.invokeWithinContext(w=>w.get(nO)),f=e.invokeWithinContext(w=>new VJ(w.get(qp),c)),g=()=>a;let m=0,_=c.getValueInRange(Uo.adjustSelection(c,e.getSelection(),i,0)),C=c.getValueInRange(Uo.adjustSelection(c,e.getSelection(),0,n)),b=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const v=e.getSelections().map((w,y)=>({selection:w,idx:y})).sort((w,y)=>S.compareRangesUsingStarts(w.selection,y.selection));for(const{selection:w,idx:y}of v){let k=Uo.adjustSelection(c,w,i,0),L=Uo.adjustSelection(c,w,0,n);_!==c.getValueInRange(k)&&(k=w),C!==c.getValueInRange(L)&&(L=w);const D=w.setStartPosition(k.startLineNumber,k.startColumn).setEndPosition(L.endLineNumber,L.endColumn),N=new cw().parse(t,!0,o),B=D.getStartPosition(),O=Uo.adjustWhitespace(c,B,N,r||y>0&&b!==c.getLineFirstNonWhitespaceColumn(w.positionLineNumber),!0);N.resolveVariables(new BJ([f,new HJ(g,y,v.length,e.getOption(70)==="spread"),new WJ(c,w,y,l),new zJ(c,w),new ir,new UJ(u),new $J]));const $=c.getOffsetAt(B)+m;m+=N.toString().length-c.getValueLengthInRange(D),d[y]=Ut.replace(D,N.toString()),d[y].identifier={major:y,minor:0},h[y]=new Ts(e,N,$,O)}return{edits:d,snippets:h}}dispose(){qe(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=Uo.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=>ne.fromPositions(n.range.getEndPosition()))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=OA){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Uo.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=>ne.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(S.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(S.compareRangesUsingStarts);for(let[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(S.compareRangesUsingStarts);for(let o=0;o<n.length;o++)if(!n[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}}var ug=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Fe={Visible:new re("suggestWidgetVisible",!1,p("suggestWidgetVisible","Whether suggestion are visible")),DetailsVisible:new re("suggestWidgetDetailsVisible",!1,p("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new re("suggestWidgetMultipleSuggestions",!1,p("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new re("suggestionMakesTextEdit",!0,p("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new re("acceptSuggestionOnEnter",!0,p("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new re("suggestionHasInsertAndReplaceRange",!1,p("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new re("suggestionInsertMode",void 0,{type:"string",description:p("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new re("suggestionCanResolve",!1,p("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},yl=new ae("suggestWidgetStatusBar");class jJ{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=_o.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(),S.isIRange(t.range)?(this.editStart=new F(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new F(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new F(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||S.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new F(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new F(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new F(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||S.spansMultipleLines(t.range.insert)||S.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 ug(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=>{br(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class PC{constructor(e=2,t=new Set,i=new Set,n=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=n}}PC.default=new PC;let KJ;function qJ(){return KJ}class GJ{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function e4(s,e,t=PC.default,i={triggerKind:0},n=Oe.None){return ug(this,void 0,void 0,function*(){const o=new dr(!0);e=e.clone();const r=s.getWordAtPosition(e),a=r?new S(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn):S.fromPositions(e),l={replace:a,insert:a.setEndPosition(e.lineNumber,e.column)},d=[],h=new X,c=[];let u=!1;const f=(m,_,C)=>{var b,v,w;if(_){for(let y of _.suggestions)if(!t.kindFilter.has(y.kind)){if(!t.showDeprecated&&(!((b=y==null?void 0:y.tags)===null||b===void 0)&&b.includes(1)))continue;y.range||(y.range=l),y.sortText||(y.sortText=typeof y.label=="string"?y.label:y.label.label),!u&&y.insertTextRules&&y.insertTextRules&4&&(u=cw.guessNeedsClipboard(y.insertText)),d.push(new jJ(e,y,_,m))}VD(_)&&h.add(_),c.push({providerName:(v=m._debugDisplayName)!==null&&v!==void 0?v:"unkown_provider",elapsedProvider:(w=_.duration)!==null&&w!==void 0?w:-1,elapsedOverall:C.elapsed()})}},g=ug(this,void 0,void 0,function*(){});for(let m of ro.orderedGroups(s)){let _=d.length;if(yield Promise.all(m.map(C=>ug(this,void 0,void 0,function*(){if(!(t.providerFilter.size>0&&!t.providerFilter.has(C)))try{const b=new dr(!0),v=yield C.provideCompletionItems(s,e,i,n);f(C,v,b)}catch(b){Di(b)}}))),_!==d.length||n.isCancellationRequested)break}return yield g,n.isCancellationRequested?(h.dispose(),Promise.reject(Au())):new GJ(d.sort(t4(t.snippetSortOrder)),u,{entries:c,elapsed:o.elapsed()},h)})}function mI(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 ZJ(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return mI(s,e)}function YJ(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return mI(s,e)}const uw=new Map;uw.set(0,ZJ);uw.set(2,YJ);uw.set(1,mI);function t4(s){return uw.get(s)}$e.registerCommand("_executeCompletionItemProvider",(s,...e)=>ug(void 0,void 0,void 0,function*(){const[t,i,n,o]=e;ut(me.isUri(t)),ut(F.isIPosition(i)),ut(typeof n=="string"||!n),ut(typeof o=="number"||!o);const r=yield s.get(Qn).createModelReference(t);try{const a={incomplete:!1,suggestions:[]},l=[],d=yield e4(r.object.textEditorModel,F.lift(i),void 0,{triggerCharacter:n,triggerKind:n?1:0});for(const h of d.items)l.length<(o??0)&&l.push(h.resolve(Oe.None)),a.incomplete=a.incomplete||h.container.incomplete,a.suggestions.push(h.completion);try{return yield Promise.all(l),a}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{r.dispose()}}));const dD=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};ro.register("*",dD);function XJ(s,e){setTimeout(()=>{dD.onlyOnceSuggestions.push(...e),s.getContribution("editor.contrib.suggestController").triggerSuggest(new Set().add(dD))},0)}var QJ=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},PA=function(s,e){return function(t,i){e(t,i,s)}};const FA={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Ri=class Of{constructor(e,t,i){this._editor=e,this._logService=t,this._snippetListener=new X,this._modelVersionId=-1,this._inSnippet=Of.InSnippetMode.bindTo(i),this._hasNextTabstop=Of.HasNextTabstop.bindTo(i),this._hasPrevTabstop=Of.HasPrevTabstop.bindTo(i)}static get(e){return e.getContribution(Of.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"?FA:Object.assign(Object.assign({},FA),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 Uo(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=>ne.fromPositions(i.getStartPosition())));const[t]=e.options;XJ(this._editor,e.options.map((i,n)=>({kind:13,label:i.value,insertText:i.value,sortText:"a".repeat(n+1),range:S.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()}};Ri.ID="snippetController2";Ri.InSnippetMode=new re("inSnippetMode",!1,p("inSnippetMode","Whether the editor in current in snippet mode"));Ri.HasNextTabstop=new re("hasNextTabstop",!1,p("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));Ri.HasPrevTabstop=new re("hasPrevTabstop",!1,p("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));Ri=QJ([PA(1,Cr),PA(2,ve)],Ri);nt(Ri.ID,Ri);const fw=Mi.bindToContribution(Ri.get);J(new fw({id:"jumpToNextSnippetPlaceholder",precondition:te.and(Ri.InSnippetMode,Ri.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:130,kbExpr:E.editorTextFocus,primary:2}}));J(new fw({id:"jumpToPrevSnippetPlaceholder",precondition:te.and(Ri.InSnippetMode,Ri.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:130,kbExpr:E.editorTextFocus,primary:1026}}));J(new fw({id:"leaveSnippet",precondition:Ri.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:130,kbExpr:E.editorTextFocus,primary:9,secondary:[1033]}}));J(new fw({id:"acceptSnippet",precondition:Ri.InSnippetMode,handler:s=>s.finish()}));var JJ=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},BA=function(s,e){return function(t,i){e(t,i,s)}};class _I{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 i4 extends _I{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class eee extends _I{constructor(){super("recentlyUsed"),this._cache=new kl(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);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 h=`${e.getLanguageId()}/${i[d].textLabel}`,c=this._cache.peek(h);if(c&&c.touch>l&&c.type===i[d].completion.kind&&c.insertText===i[d].completion.insertText&&(l=c.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:CM(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class tee extends _I{constructor(){super("recentlyUsedByPrefix"),this._trie=Mc.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${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.getLanguageId()}/${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:CM(i.type),this._trie.set(t,i)}}}let pp=class q_{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new X,this._persistSoon=new Lt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===EC.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;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==n){this._saveState();const o=q_._strategyCtors.get(n)||i4;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${q_._storagePrefix}/${n}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}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(`${q_._storagePrefix}/${this._strategy.name}`,i,t,1)}}};pp._strategyCtors=new Map([["recentlyUsedByPrefix",tee],["recentlyUsed",eee],["first",i4]]);pp._storagePrefix="suggest/memories";pp=JJ([BA(0,yr),BA(1,Vt)],pp);const n4=Je("ISuggestMemories");Il(n4,pp,!0);var iee=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},nee=function(s,e){return function(t,i){e(t,i,s)}};let mp=class s4{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=s4.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(110)&&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(110)==="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)}};mp.AtEnd=new re("atEndOfWord",!1);mp=iee([nee(1,ve)],mp);var see=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},oee=function(s,e){return function(t,i){e(t,i,s)}};let oh=class G_{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=G_.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(G_._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=G_._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};oh.OtherSuggestions=new re("hasOtherSuggestions",!1);oh=see([oee(1,ve)],oh);class ree{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||!Tn(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new bc;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()}}var aee=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Vn{provideSelectionRanges(e,t){return aee(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=>Vn._bracketsRightYield(a,0,e,n,r)),yield new Promise(a=>Vn._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>=Vn._maxRounds){e();break}if(!n){e();break}let l=i.findNextBracket(n);if(!l){e();break}if(Date.now()-a>Vn._maxDuration){setTimeout(()=>Vn._bracketsRightYield(e,t+1,i,n,o));break}const h=l.close[0];if(l.isOpen){let c=r.has(h)?r.get(h):0;r.set(h,c+1)}else{let c=r.has(h)?r.get(h):0;if(c-=1,r.set(h,Math.max(0,c)),c<0){let u=o.get(h);u||(u=new jn,o.set(h,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>=Vn._maxRounds&&o.size===0){e();break}if(!n){e();break}let d=i.findPrevBracket(n);if(!d){e();break}if(Date.now()-l>Vn._maxDuration){setTimeout(()=>Vn._bracketsLeftYield(e,t+1,i,n,o,r));break}const c=d.close[0];if(d.isOpen){let u=a.has(c)?a.get(c):0;if(u-=1,a.set(c,Math.max(0,u)),u<0){let f=o.get(c);if(f){let g=f.shift();f.size===0&&o.delete(c);const m=S.fromPositions(d.range.getEndPosition(),g.getStartPosition()),_=S.fromPositions(d.range.getStartPosition(),g.getEndPosition());r.push({range:m}),r.push({range:_}),Vn._addBracketLeading(i,_,r)}}}else{let u=a.has(c)?a.get(c):0;a.set(c,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:S.fromPositions(new F(n,o),t.getEndPosition())}),i.push({range:S.fromPositions(new F(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:S.fromPositions(new F(r,a),t.getEndPosition())}),i.push({range:S.fromPositions(new F(r,1),t.getEndPosition())}))}}}Vn._maxDuration=30;Vn._maxRounds=2;var 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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Go{static create(e,t){return lee(this,void 0,void 0,function*(){if(!t.getOption(105).localityBonus||!t.hasModel())return Go.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Go.None;const[o]=yield new Vn().provideSelectionRanges(i,[n]);if(o.length===0)return Go.None;const r=yield e.computeWordRanges(i.uri,o[0].range);if(!r)return Go.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends Go{distance(l,d){if(!n.equals(t.getPosition()))return 0;if(d.kind===17)return 2<<20;let h=typeof d.label=="string"?d.label:d.label.label,c=r[h];if(BM(c))return 2<<20;let u=mx(c,S.fromPositions(l),S.compareRangesUsingStarts),f=u>=0?c[u]:c[Math.max(0,~u-1)],g=o.length;for(const m of o){if(!S.containsRange(m.range,f))break;g-=1}return g}}})}}Go.None=new class extends Go{distance(){return 0}};class ld{constructor(e,t,i,n,o,r,a){this.clipboardText=a,this._snippetCompareFn=ld._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,r==="top"?this._snippetCompareFn=ld._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=ld._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?cu:kK;for(let d=0;d<r.length;d++){const h=r[d];if(h.isInvalid)continue;this._providerInfo.set(h.provider,!!h.container.incomplete);const c=h.position.column-h.editStart.column,u=c+i-(h.position.column-this._column);if(n.length!==u&&(n=u===0?"":t.slice(-u),o=n.toLowerCase()),h.word=n,u===0)h.score=_o.Default;else{let f=0;for(;f<c;){const g=n.charCodeAt(f);if(g===32||g===9)f+=1;else break}if(f>=u)h.score=_o.Default;else if(typeof h.completion.filterText=="string"){let g=l(n,o,f,h.completion.filterText,h.filterTextLow,0,!1);if(!g)continue;U1(h.completion.filterText,h.textLabel)===0?h.score=g:(h.score=yK(n,o,f,h.textLabel,h.labelLow,0),h.score[0]=g[0])}else{let g=l(n,o,f,h.textLabel,h.labelLow,0,!1);if(!g)continue;h.score=g}}h.idx=d,h.distance=this._wordDistance.distance(h.position,h.completion),a.push(h),e.push(h.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?ry(e.length-.85,e,(d,h)=>d-h):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 ld._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 ld._compareCompletionItems(e,t)}}var dee=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},tc=function(s,e){return function(t,i){e(t,i,s)}},hee=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class ic{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 cee(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowQuickSuggestions");return i!==void 0?!!i:!1}function uee(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters");return i!==void 0?!!i:!1}let hD=class o4{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 hn,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 ne(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(ro.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._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{l||this._refilterCompletionItems()})),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){qe(this._triggerCharacterListener),qe([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(79),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&this._quickSuggestDelay!==0||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(80)||!this._editor.hasModel()||!this._editor.getOption(108))return;const e=new Map;for(const i of ro.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(qJ()),e.set(n,o)),o.add(i)}const t=i=>{if(!uee(this._editor,this._contextKeyService,this._configurationService)||ic.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";Yc(i.charCodeAt(i.length-1))?Si(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()||!ro.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._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._state===0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._state!==0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._state===0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){this._editor.getOption(78)!==!1&&(this._editor.getOption(105).snippetsPreventQuickSuggestions&&Ri.get(this._editor).isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._state!==0||!ic.shouldAutoTrigger(this._editor)||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(78);if(i!==!1){if(i!==!0){e.tokenizeIfCheap(t.lineNumber);const n=e.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(!(i.other&&o===0||i.comments&&o===1||i.strings&&o===2))return}cee(this._editor,this._contextKeyService,this._configurationService)&&ro.has(e)&&this.trigger({auto:!0,shy:!1})}},this._quickSuggestDelay)))}_refilterCompletionItems(){Promise.resolve().then(()=>{if(this._state===0||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new ic(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 ic(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 ln;const h=this._editor.getOption(100);let c=1;switch(h){case"top":c=0;break;case"bottom":c=2;break}const{itemKind:u,showDeprecated:f}=o4._createSuggestFilter(this._editor),g=Go.create(this._editorWorkerService,this._editor),m=e4(r,this._editor.getPosition(),new PC(c,u,i,f),d,this._requestToken.token);Promise.all([m,g]).then(([_,C])=>hee(this,void 0,void 0,function*(){var b;if((b=this._requestToken)===null||b===void 0||b.dispose(),!this._editor.hasModel())return;let v=n==null?void 0:n.clipboardText;if(!v&&_.needsClipboard&&(v=yield this._clipboardService.readText()),this._state===0)return;const w=this._editor.getModel();let y=_.items;if(n){const L=t4(c);y=y.concat(n.items).sort(L)}const k=new ic(w,this._editor.getPosition(),a,e.shy);this._completionModel=new ld(y,this._context.column,{leadingLineContent:k.leadingLineContent,characterCountDelta:k.column-this._context.column},C,this._editor.getOption(105),this._editor.getOption(100),v),this._completionDisposables.add(_.disposable),this._onNewContext(k),this._reportDurationsTelemetry(_.durations)})).catch(Le)}_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(100)==="none"&&t.add(27);const n=e.getOption(105);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(ht(e.leadingLineContent)!==ht(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(ro.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(ic.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})}}}}};hD=dee([tc(1,Ys),tc(2,Al),tc(3,El),tc(4,Cr),tc(5,ve),tc(6,Vt)],hD);class gw{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)>gw._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()}}gw._maxSelectionLength=51200;var fee=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},TS=function(s,e){return function(t,i){e(t,i,s)}};class bI extends mu{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,bI.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let cD=class{constructor(e,t,i,n){this._menuService=i,this._contextKeyService=n,this._menuDisposables=new X,this.element=U(e,Y(".suggest-status-bar"));const o=r=>r instanceof Ud?t.createInstance(bI,r,void 0):void 0;this._leftActions=new pa(this.element,{actionViewItemProvider:o}),this._rightActions=new pa(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(yl,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()}};cD=fee([TS(1,Ge),TS(2,yh),TS(3,ve)],cD);const gee=R("symbolIcon.arrayForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),pee=R("symbolIcon.booleanForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mee=R("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.")),_ee=R("symbolIcon.colorForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),bee=R("symbolIcon.constantForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Cee=R("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.")),vee=R("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.")),wee=R("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.")),See=R("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.")),yee=R("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.")),Lee=R("symbolIcon.fileForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dee=R("symbolIcon.folderForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),xee=R("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.")),kee=R("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.")),Iee=R("symbolIcon.keyForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Eee=R("symbolIcon.keywordForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Nee=R("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.")),Tee=R("symbolIcon.moduleForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Aee=R("symbolIcon.namespaceForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ree=R("symbolIcon.nullForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Mee=R("symbolIcon.numberForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Oee=R("symbolIcon.objectForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Pee=R("symbolIcon.operatorForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Fee=R("symbolIcon.packageForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Bee=R("symbolIcon.propertyForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Wee=R("symbolIcon.referenceForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Vee=R("symbolIcon.snippetForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Hee=R("symbolIcon.stringForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),zee=R("symbolIcon.structForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Uee=R("symbolIcon.textForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$ee=R("symbolIcon.typeParameterForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),jee=R("symbolIcon.unitForeground",{dark:ge,light:ge,hc:ge},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Kee=R("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."));st((s,e)=>{const t=s.getColor(gee);t&&e.addRule(`${ie.symbolArray.cssSelector} { color: ${t}; }`);const i=s.getColor(pee);i&&e.addRule(`${ie.symbolBoolean.cssSelector} { color: ${i}; }`);const n=s.getColor(mee);n&&e.addRule(`${ie.symbolClass.cssSelector} { color: ${n}; }`);const o=s.getColor(Nee);o&&e.addRule(`${ie.symbolMethod.cssSelector} { color: ${o}; }`);const r=s.getColor(_ee);r&&e.addRule(`${ie.symbolColor.cssSelector} { color: ${r}; }`);const a=s.getColor(bee);a&&e.addRule(`${ie.symbolConstant.cssSelector} { color: ${a}; }`);const l=s.getColor(Cee);l&&e.addRule(`${ie.symbolConstructor.cssSelector} { color: ${l}; }`);const d=s.getColor(vee);d&&e.addRule(`
  627. ${ie.symbolValue.cssSelector},${ie.symbolEnum.cssSelector} { color: ${d}; }`);const h=s.getColor(wee);h&&e.addRule(`${ie.symbolEnumMember.cssSelector} { color: ${h}; }`);const c=s.getColor(See);c&&e.addRule(`${ie.symbolEvent.cssSelector} { color: ${c}; }`);const u=s.getColor(yee);u&&e.addRule(`${ie.symbolField.cssSelector} { color: ${u}; }`);const f=s.getColor(Lee);f&&e.addRule(`${ie.symbolFile.cssSelector} { color: ${f}; }`);const g=s.getColor(Dee);g&&e.addRule(`${ie.symbolFolder.cssSelector} { color: ${g}; }`);const m=s.getColor(xee);m&&e.addRule(`${ie.symbolFunction.cssSelector} { color: ${m}; }`);const _=s.getColor(kee);_&&e.addRule(`${ie.symbolInterface.cssSelector} { color: ${_}; }`);const C=s.getColor(Iee);C&&e.addRule(`${ie.symbolKey.cssSelector} { color: ${C}; }`);const b=s.getColor(Eee);b&&e.addRule(`${ie.symbolKeyword.cssSelector} { color: ${b}; }`);const v=s.getColor(Tee);v&&e.addRule(`${ie.symbolModule.cssSelector} { color: ${v}; }`);const w=s.getColor(Aee);w&&e.addRule(`${ie.symbolNamespace.cssSelector} { color: ${w}; }`);const y=s.getColor(Ree);y&&e.addRule(`${ie.symbolNull.cssSelector} { color: ${y}; }`);const k=s.getColor(Mee);k&&e.addRule(`${ie.symbolNumber.cssSelector} { color: ${k}; }`);const L=s.getColor(Oee);L&&e.addRule(`${ie.symbolObject.cssSelector} { color: ${L}; }`);const D=s.getColor(Pee);D&&e.addRule(`${ie.symbolOperator.cssSelector} { color: ${D}; }`);const N=s.getColor(Fee);N&&e.addRule(`${ie.symbolPackage.cssSelector} { color: ${N}; }`);const B=s.getColor(Bee);B&&e.addRule(`${ie.symbolProperty.cssSelector} { color: ${B}; }`);const O=s.getColor(Wee);O&&e.addRule(`${ie.symbolReference.cssSelector} { color: ${O}; }`);const $=s.getColor(Vee);$&&e.addRule(`${ie.symbolSnippet.cssSelector} { color: ${$}; }`);const K=s.getColor(Hee);K&&e.addRule(`${ie.symbolString.cssSelector} { color: ${K}; }`);const le=s.getColor(zee);le&&e.addRule(`${ie.symbolStruct.cssSelector} { color: ${le}; }`);const de=s.getColor(Uee);de&&e.addRule(`${ie.symbolText.cssSelector} { color: ${de}; }`);const _e=s.getColor($ee);_e&&e.addRule(`${ie.symbolTypeParameter.cssSelector} { color: ${_e}; }`);const De=s.getColor(jee);De&&e.addRule(`${ie.symbolUnit.cssSelector} { color: ${De}; }`);const we=s.getColor(Kee);we&&e.addRule(`${ie.symbolVariable.cssSelector} { color: ${we}; }`)});class r4{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 _t(0,0),this._minSize=new _t(0,0),this._maxSize=new _t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Wi(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Wi(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Wi(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:cC.North}),this._southSash=new Wi(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:cC.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(he.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(he.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(he.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(he.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 _t(t,e);_t.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 qee=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},Gee=function(s,e){return function(t,i){e(t,i,s)}};function CI(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let uD=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 _t(330,0),this.domNode=Y(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(wl,{editor:e}),this._body=Y(".body"),this._scrollbar=new Up(this._body,{}),U(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=U(this._body,Y(".header")),this._close=U(this._header,Y("span"+ie.close.cssSelector)),this._close.title=p("details.close","Close"),this._type=U(this._header,Y("p.type")),this._docs=U(this._body,Y("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(43)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(43),i=t.getMassagedFontFamily(Ws?Hi.fontFamily:null),n=e.get(106)||t.fontSize,o=e.get(107)||t.lineHeight,r=t.fontWeight,a=`${n}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/n}`,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(107)||this._editor.getOption(43).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]}
  628. `,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
  629. `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
  630. `,a+=`distance: ${e.distance} (localityBonus-setting)
  631. `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
  632. `,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")}
  633. `,r=new ma().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!CI(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,zn(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Li(this._type),this._type.title="",_n(this._type),this.domNode.classList.add("no-type");if(Li(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),Li(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 _t(e,t);_t.equals(i,this._size)||(this._size=i,f3(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}};uD=qee([Gee(1,Ge)],uD);class Zee{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new X,this._added=!1,this._resizable=new r4,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=Ii(e);this._anchorBox=i,this._placeAtAnchor(this._anchorBox,(t=this._userSize)!==null&&t!==void 0?t:this.widget.size)}_placeAtAnchor(e,t){var i;const n=qC(document.body),o=this.widget.getLayoutInfo(),r=new _t(220,2*o.lineHeight),a=e.top,l=function(){const b=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),v=-o.borderWidth+e.left+e.width,w=new _t(b,n.height-e.top-o.borderHeight-o.verticalPadding),y=w.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:v,fit:b-t.width,maxSizeTop:w,maxSizeBottom:y,minSize:r.with(Math.min(b,r.width))}}(),d=function(){const b=e.left-o.borderWidth-o.horizontalPadding,v=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),w=new _t(b,n.height-e.top-o.borderHeight-o.verticalPadding),y=w.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:v,fit:b-t.width,maxSizeTop:w,maxSizeBottom:y,minSize:r.with(Math.min(b,r.width))}}(),h=function(){const b=e.left,v=-o.borderWidth+e.top+e.height,w=new _t(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:v,left:b,fit:w.height-t.height,maxSizeBottom:w,maxSizeTop:w,minSize:r.with(w.width)}}(),c=[l,d,h],u=(i=c.find(b=>b.fit>=0))!==null&&i!==void 0?i:c.sort((b,v)=>v.fit-b.fit)[0],f=e.top+e.height-o.borderHeight;let g,m=t.height;const _=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);m>_&&(m=_);let C;m<=u.maxSizeTop.height?(g=!0,C=u.maxSizeTop):(g=!1,C=u.maxSizeBottom),this._applyTopLeft({left:u.left,top:g?u.top:f-m}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!g,u===l,g,u!==l),this._resizable.minSize=u.minSize,this._resizable.maxSize=C,this._resizable.layout(m,Math.min(C.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 ia;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(ia||(ia={}));function o_(s,e,t,i){const n=i===ia.ROOT_FOLDER?["rootfolder-icon"]:i===ia.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Te.data?o=ll.parseMetaData(t).get(ll.META_DATA_LABEL):o=WA(dM(t).toLowerCase()),i===ia.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=Yee(s,e,t);r&&n.push(`${WA(r)}-lang-file-icon`)}}return n}function Yee(s,e,t){if(!t)return null;let i=null;if(t.scheme===Te.data){const o=ll.parseMetaData(t).get(ll.META_DATA_MIME);o&&(i=e.getModeId(o))}else{const n=s.getModel(t);n&&(i=n.getLanguageId())}return i&&i!==Bu?i:e.getModeIdByFilepathOrFirstLine(t)}function WA(s){return s.replace(/[\11\12\14\15\40]/g,"/")}var Xee=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},AS=function(s,e){return function(t,i){e(t,i,s)}},bf;function a4(s){return`suggest-aria-id:${s}`}const Qee=Oi("suggest-more-info",ie.chevronRight,p("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Jee=new(bf=class Z_{extract(e,t){if(e.textLabel.match(Z_._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(Z_._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=Z_._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}},bf._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*\))/,bf._regexStrict=new RegExp(`^${bf._regexRelaxed.source}$`,"i"),bf);let fD=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=U(e,Y(".icon")),t.colorspan=U(t.icon,Y("span.colorspan"));const i=U(e,Y(".contents")),n=U(i,Y(".main"));t.iconContainer=U(n,Y(".icon-label.codicon")),t.left=U(n,Y("span.left")),t.right=U(n,Y("span.right")),t.iconLabel=new Yk(t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=U(t.left,Y("span.signature-label")),t.qualifierLabel=U(t.left,Y("span.qualifier-label")),t.detailsLabel=U(t.right,Y("span.details-label")),t.readMore=U(t.right,Y("span.readMore"+kt.asCSSSelector(Qee))),t.readMore.title=p("readMore","Read More");const o=()=>{const r=this._editor.getOptions(),a=r.get(43),l=a.getMassagedFontFamily(Ws?Hi.fontFamily:null),d=a.fontFeatureSettings,h=r.get(106)||a.fontSize,c=r.get(107)||a.lineHeight,u=a.fontWeight,f=`${h}px`,g=`${c}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(43)||r.hasChanged(106)||r.hasChanged(107))&&o()})),t}renderElement(e,t,i){const{completion:n}=e;i.root.id=a4(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Pv(e.score)};let r=[];if(n.kind===19&&Jee.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=o_(this._modelService,this._modeService,me.from({scheme:"fake",path:e.textLabel}),ia.FILE),l=o_(this._modelService,this._modeService,me.from({scheme:"fake",path:n.detail}),ia.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=_x([o_(this._modelService,this._modeService,me.from({scheme:"fake",path:e.textLabel}),ia.FOLDER),o_(this._modelService,this._modeService,me.from({scheme:"fake",path:n.detail}),ia.FOLDER)])):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...UW(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=RS(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=RS(n.label.detail||""),i.detailsLabel.textContent=RS(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(105).showInlineDetails?zn(i.detailsLabel):_n(i.detailsLabel),CI(e)?(i.right.classList.add("can-expand-details"),zn(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"),_n(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};fD=Xee([AS(1,ri),AS(2,Qi),AS(3,Dt)],fD);function RS(s){return s.replace(/\r\n|\r|\n/g,"")}var ete=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},r_=function(s,e){return function(t,i){e(t,i,s)}},tte=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const ite=R("editorSuggestWidget.background",{dark:Zn,light:Zn,hc:Zn},p("editorSuggestWidgetBackground","Background color of the suggest widget.")),nte=R("editorSuggestWidget.border",{dark:xd,light:xd,hc:xd},p("editorSuggestWidgetBorder","Border color of the suggest widget.")),ste=R("editorSuggestWidget.foreground",{dark:el,light:el,hc:el},p("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),ote=R("editorSuggestWidget.selectedForeground",{dark:T_,light:T_,hc:T_},p("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),rte=R("editorSuggestWidget.selectedIconForeground",{dark:A_,light:A_,hc:A_},p("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget.")),ate=R("editorSuggestWidget.selectedBackground",{dark:R_,light:R_,hc:R_},p("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),lte=R("editorSuggestWidget.highlightForeground",{dark:ra,light:ra,hc:ra},p("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),dte=R("editorSuggestWidget.focusHighlightForeground",{dark:v0,light:v0,hc:v0},p("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));class hte{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof nh}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(_t.is(i))return _t.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let _p=class gD{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 hn,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 r4,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new cte(this,e),this._persistedSize=new hte(t,e);class r{constructor(f,g,m=!1,_=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=m,this.persistWidth=_}}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,_;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:C,defaultSize:b}=this.getLayoutInfo(),v=Math.round(C/2);let{width:w,height:y}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-y)<=v)&&(y=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=v)&&(w=(_=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&_!==void 0?_:b.width),this._persistedSize.store(new _t(w,y))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=U(this.element.domNode,Y(".message")),this._listElement=U(this.element.domNode,Y(".tree"));const l=o.createInstance(uD,this.editor);l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Zee(l,this.editor);const d=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(105).showIcons);d();const h=o.createInstance(fD,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails(()=>this.toggleDetails())),this._list=new wr("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getAriaLabel:u=>{if(u.isResolved&&this._isDetailsVisible()){const{documentation:f,detail:g}=u.completion,m=Vi("{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(cD,this.element.domNode);const c=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(105).showStatusBar);c(),this._disposables.add(Xd(this._list,n,{listInactiveFocusBackground:ate,listInactiveFocusOutline:Xi})),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(105)&&(c(),d())})),this._ctxSuggestWidgetVisible=Fe.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Fe.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Fe.MultipleSuggestions.bindTo(i),this._disposables.add(ii(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(ite);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(nte);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(ul);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=gi(o=>tte(this,void 0,void 0,function*(){const r=Bd(()=>{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:a4(n)}))}).catch(Le)),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:_n(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=gD.LOADING_MESSAGE,_n(this._listElement,this._status.element),zn(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=gD.NO_SUGGESTIONS_MESSAGE,_n(this._listElement,this._status.element),zn(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:_n(this._messageElement),zn(this._listElement,this._status.element),this._show();break;case 4:_n(this._messageElement),zn(this._listElement,this._status.element),this._show();break;case 5:_n(this._messageElement),zn(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=Bd(()=>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")):(CI(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=qC(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 _t(l,a),this._contentWidget.setPreference(2);else{const d=o.width-r.borderHeight-2*r.horizontalPadding;l>d&&(l=d);const h=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:l,c=r.statusBarHeight+this._list.contentHeight+r.borderHeight,u=r.itemHeight+r.statusBarHeight,f=Ii(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=f.top+g.top+g.height,_=Math.min(o.height-m-r.verticalPadding,c),C=f.top+g.top-r.verticalPadding,b=Math.min(C,c);let v=Math.min(Math.max(b,_)+r.borderHeight,c);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<u&&(a=u),a>v&&(a=v),a>_||this._forceRenderingAbove&&C>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=_),this.element.preferredSize=new _t(h,r.defaultSize.height),this.element.maxSize=new _t(d,v),this.element.minSize=new _t(220,u),this._cappedHeight=a===c?{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(43),t=As(this.editor.getOption(107)||e.lineHeight,8,1e3),i=!this.editor.getOption(105).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 _t(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}};_p.LOADING_MESSAGE=p("suggestWidget.loading","Loading...");_p.NO_SUGGESTIONS_MESSAGE=p("suggestWidget.noSuggestions","No suggestions.");_p=ete([r_(1,yr),r_(2,ve),r_(3,Dt),r_(4,Ge)],_p);class cte{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 _t(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}}st((s,e)=>{const t=s.getColor(lte);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${t}; }`);const i=s.getColor(dte);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight { color: ${i}; }`);const n=s.getColor(ste);n&&e.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${n}; }`);const o=s.getColor(ote);o&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused { color: ${o}; }`);const r=s.getColor(rte);r&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon { color: ${r}; }`);const a=s.getColor(Vp);a&&e.addRule(`.monaco-editor .suggest-details a { color: ${a}; }`);const l=s.getColor(Hp);l&&e.addRule(`.monaco-editor .suggest-details a:hover { color: ${l}; }`);const d=s.getColor($x);d&&e.addRule(`.monaco-editor .suggest-details code { background-color: ${d}; }`)});var ute=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},Cf=function(s,e){return function(t,i){e(t,i,s)}};class fte{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:S.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 Hs=class l4{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 dn,this._toDispose=new X,this._selectors=new gte(h=>h.priority),this.editor=e,this.model=o.createInstance(hD,this.editor);const a=Fe.InsertMode.bindTo(n);a.set(e.getOption(105).insertMode),this.model.onDidTrigger(()=>a.set(e.getOption(105).insertMode)),this.widget=this._toDispose.add(new Tc(()=>{const h=this._instantiationService.createInstance(_p,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(m=>this._insertSuggestion(m,0),this));const c=new ree(this.editor,h,m=>this._insertSuggestion(m,2));this._toDispose.add(c),this._toDispose.add(this.model.onDidSuggest(m=>{m.completionModel.items.length===0&&c.reset()}));const u=Fe.MakesTextEdit.bindTo(this._contextKeyService),f=Fe.HasInsertAndReplaceRange.bindTo(this._contextKeyService),g=Fe.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ve(()=>{u.reset(),f.reset(),g.reset()})),this._toDispose.add(h.onDidFocus(({item:m})=>{const _=this.editor.getPosition(),C=m.editStart.column,b=_.column;let v=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&b-C===m.completion.insertText.length&&(v=this.editor.getModel().getValueInRange({startLineNumber:_.lineNumber,startColumn:C,endLineNumber:_.lineNumber,endColumn:b})!==m.completion.insertText),u.set(v),f.set(!F.equals(m.editInsertEnd,m.editReplaceEnd)),g.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(m=>{if(m.toKeybinding().equals(new Fd(!0,!1,!1,!1,33))||Me&&m.toKeybinding().equals(new Fd(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeybinding().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new Tc(()=>this._toDispose.add(new gw(this.editor,this.model)))),this._alternatives=this._toDispose.add(new Tc(()=>this._toDispose.add(new oh(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(mp,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new fte(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(!h.shy){let c=-1;for(const u of this._selectors.itemsOrderedByPriorityDesc)if(c=u.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),c!==-1)break;c===-1&&(c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items)),this.widget.value.showSuggestions(h.completionModel,c,h.isFrozen,h.auto)}})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));let l=Fe.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const h=this.editor.getOption(1);l.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}static get(e){return e.getContribution(l4.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 ln;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 h=gl.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(c=>Ut.replace(S.lift(c.range),c.text))),h.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!o.isResolved){const h=new dr(!0);let c;const u=i.onDidChangeContent(_=>{if(_.isFlush){a.cancel(),u.dispose();return}for(let C of _.changes){const b=S.getEndPosition(C.range);(!c||F.isBefore(b,c))&&(c=b)}});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||c&&o.completion.additionalTextEdits.some(C=>F.isBefore(c,S.getStartPosition(C.range))))return!1;g&&this.editor.pushUndoStop();const _=gl.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(C=>Ut.replace(S.lift(C.range),C.text))),_.restoreRelativeVerticalPositionOfCursor(this.editor),(g||!(f&2))&&this.editor.pushUndoStop(),!0}).then(_=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",h.elapsed(),_),u.dispose(),m.dispose()}))}let{insertText:d}=o.completion;o.completion.insertTextRules&4||(d=cw.escape(d)),Ri.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===om.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(Le)),this.model.cancel()):this.model.cancel(),t&4&&this._alternatives.value.set(e,h=>{for(a.cancel();i.canUndo();){n!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(h,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(r).finally(()=>{this.model.clear(),a.dispose()})}getOverwriteInfo(e,t){ut(this.editor.hasModel());let i=this.editor.getOption(105).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(Tn(e.completion.additionalTextEdits)){let t=p("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Ei(t)}}triggerSuggest(e){this.editor.hasModel()&&(this.model.trigger({auto:!1,shy:!1},!1,e),this.editor.revealPosition(this.editor.getPosition(),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};he.once(this.model.onDidTrigger)(o=>{let r=[];he.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{qe(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(qe(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.revealPosition(t,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.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};Hs.ID="editor.contrib.suggestController";Hs=ute([Cf(1,n4),Cf(2,Yt),Cf(3,ve),Cf(4,Ge),Cf(5,Cr)],Hs);class gte{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class om extends oe{constructor(){super({id:om.id,label:p("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:te.and(E.writable,E.hasCompletionItemProvider),kbOpts:{kbExpr:E.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t){const i=Hs.get(t);i&&i.triggerSuggest()}}om.id="editor.action.triggerSuggest";nt(Hs.ID,Hs);ee(om);const ys=190,Pn=Mi.bindToContribution(Hs.get);J(new Pn({id:"acceptSelectedSuggestion",precondition:Fe.Visible,handler(s){s.acceptSelectedSuggestion(!0,!1)}}));cn.registerKeybindingRule({id:"acceptSelectedSuggestion",when:te.and(Fe.Visible,E.textInputFocus),primary:2,weight:ys});cn.registerKeybindingRule({id:"acceptSelectedSuggestion",when:te.and(Fe.Visible,E.textInputFocus,Fe.AcceptSuggestionsOnEnter,Fe.MakesTextEdit),primary:3,weight:ys});ps.appendMenuItem(yl,{command:{id:"acceptSelectedSuggestion",title:p("accept.insert","Insert")},group:"left",order:1,when:Fe.HasInsertAndReplaceRange.toNegated()});ps.appendMenuItem(yl,{command:{id:"acceptSelectedSuggestion",title:p("accept.insert","Insert")},group:"left",order:1,when:te.and(Fe.HasInsertAndReplaceRange,Fe.InsertMode.isEqualTo("insert"))});ps.appendMenuItem(yl,{command:{id:"acceptSelectedSuggestion",title:p("accept.replace","Replace")},group:"left",order:1,when:te.and(Fe.HasInsertAndReplaceRange,Fe.InsertMode.isEqualTo("replace"))});J(new Pn({id:"acceptAlternativeSelectedSuggestion",precondition:te.and(Fe.Visible,E.textInputFocus),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:1027,secondary:[1026]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:yl,group:"left",order:2,when:te.and(Fe.HasInsertAndReplaceRange,Fe.InsertMode.isEqualTo("insert")),title:p("accept.replace","Replace")},{menuId:yl,group:"left",order:2,when:te.and(Fe.HasInsertAndReplaceRange,Fe.InsertMode.isEqualTo("replace")),title:p("accept.insert","Insert")}]}));$e.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");J(new Pn({id:"hideSuggestWidget",precondition:Fe.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:9,secondary:[1033]}}));J(new Pn({id:"selectNextSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));J(new Pn({id:"selectNextPageSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:12,secondary:[2060]}}));J(new Pn({id:"selectLastSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectLastSuggestion()}));J(new Pn({id:"selectPrevSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));J(new Pn({id:"selectPrevPageSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:11,secondary:[2059]}}));J(new Pn({id:"selectFirstSuggestion",precondition:te.and(Fe.Visible,Fe.MultipleSuggestions),handler:s=>s.selectFirstSuggestion()}));J(new Pn({id:"toggleSuggestionDetails",precondition:Fe.Visible,handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:yl,group:"right",order:1,when:te.and(Fe.DetailsVisible,Fe.CanResolve),title:p("detail.more","show less")},{menuId:yl,group:"right",order:1,when:te.and(Fe.DetailsVisible.toNegated(),Fe.CanResolve),title:p("detail.less","show more")}]}));J(new Pn({id:"toggleExplainMode",precondition:Fe.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:100,primary:2133}}));J(new Pn({id:"toggleSuggestionFocus",precondition:Fe.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:2570,mac:{primary:778}}}));J(new Pn({id:"insertBestCompletion",precondition:te.and(E.textInputFocus,te.equals("config.editor.tabCompletion","on"),mp.AtEnd,Fe.Visible.toNegated(),oh.OtherSuggestions.toNegated(),Ri.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(bn(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:ys,primary:2}}));J(new Pn({id:"insertNextSuggestion",precondition:te.and(E.textInputFocus,te.equals("config.editor.tabCompletion","on"),oh.OtherSuggestions,Fe.Visible.toNegated(),Ri.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:2}}));J(new Pn({id:"insertPrevSuggestion",precondition:te.and(E.textInputFocus,te.equals("config.editor.tabCompletion","on"),oh.OtherSuggestions,Fe.Visible.toNegated(),Ri.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:ys,kbExpr:E.textInputFocus,primary:1026}}));ee(class extends oe{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){Hs.get(e).resetWidgetSize()}});function pte(s,e){return{object:s,dispose:()=>e==null?void 0:e.dispose()}}function mte(s,e){return(t,i)=>e(s(t),s(i))}function _te(){return(s,e)=>s-e}function bte(s,e){let t;for(const i of s)(t===void 0||e(i,t)>0)&&(t=i);return t}class Cte extends H{constructor(e,t){super(),this.editor=e,this.suggestControllerPreselector=t,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentInlineCompletion=void 0,this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.setInactiveDelayed=this._register(new Lt(()=>{this.isSuggestWidgetVisible||this._isActive&&(this._isActive=!1,this.onDidChangeEmitter.fire())},100)),this._register(e.onKeyDown(n=>{n.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(n=>{n.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const i=Hs.get(this.editor);if(i){this._register(i.registerSelector({priority:100,select:(r,a,l)=>{const d=this.editor.getModel(),h=OC(d,this.suggestControllerPreselector());if(!h)return-1;const c=F.lift(a),u=l.map((g,m)=>{const _=VA(i,c,g,this.isShiftKeyPressed),C=OC(d,_);if(!C)return;const b=vte(h.range,C.range)&&h.text.startsWith(C.text);return{index:m,valid:b,prefixLength:C.text.length,suggestItem:g}}).filter(g=>g&&g.valid),f=bte(u,mte(g=>g.prefixLength,_te()));return f?f.index:-1}}));let n=!1;const o=()=>{n||(n=!0,this._register(i.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(i.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.setInactiveDelayed.schedule(),this.update(this._isActive)})),this._register(i.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(he.once(i.model.onDidTrigger)(r=>{o()}))}this.update(this._isActive)}get state(){if(this._isActive)return{selectedItemAsInlineCompletion:this._currentInlineCompletion}}update(e){const t=this.getInlineCompletion();let i=!1;kJ(this._currentInlineCompletion,t)||(this._currentInlineCompletion=t,i=!0),this._isActive!==e&&(this._isActive=e,i=!0),i&&this.onDidChangeEmitter.fire()}getInlineCompletion(){const e=Hs.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem();if(t)return VA(e,this.editor.getPosition(),t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Hs.get(this.editor);e&&e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Hs.get(this.editor);e&&e.forceRenderingAbove()}}function vte(s,e){return s.startLineNumber===e.startLineNumber&&s.startColumn===e.startColumn&&(s.endLineNumber<e.endLineNumber||s.endLineNumber===e.endLineNumber&&s.endColumn<=e.endColumn)}function VA(s,e,t,i){if(Array.isArray(t.completion.additionalTextEdits)&&t.completion.additionalTextEdits.length>0)return{text:"",range:S.fromPositions(e,e)};let{insertText:n}=t.completion;if(t.completion.insertTextRules&4){const r=new cw().parse(n),a=s.editor.getModel();if(r.children.length>100)return;Uo.adjustWhitespace(a,e,r,!0,!0),n=r.toString()}const o=s.getOverwriteInfo(t,i);return{text:n,range:S.fromPositions(e.delta(0,-o.overwriteBefore),e.delta(0,Math.max(o.overwriteAfter,0)))}}var HA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class wte extends ZF{constructor(e,t){super(e),this.cache=t,this.suggestionInlineCompletionSource=this._register(new Cte(this.editor,()=>{var i,n;return(n=(i=this.cache.value)===null||i===void 0?void 0:i.completions[0])===null||n===void 0?void 0:n.toLiveInlineCompletion()})),this.updateOperation=this._register(new dn),this.updateCacheSoon=this._register(new Lt(()=>this.updateCache(),50)),this.minReservedLineCount=0,this._register(this.suggestionInlineCompletionSource.onDidChange(()=>{this.updateCacheSoon.schedule(),this.suggestionInlineCompletionSource.state||(this.minReservedLineCount=0);const n=this.ghostText;n&&(this.minReservedLineCount=Math.max(this.minReservedLineCount,Ste(n.parts.map(o=>o.lines.length-1)))),this.minReservedLineCount>=1&&this.isSuggestionPreviewEnabled()?this.suggestionInlineCompletionSource.forceRenderingAbove():this.suggestionInlineCompletionSource.stopForceRenderingAbove(),this.onDidChangeEmitter.fire()})),this._register(this.cache.onDidChange(()=>{this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeCursorPosition(i=>{this.isSuggestionPreviewEnabled()&&(this.minReservedLineCount=0,this.updateCacheSoon.schedule(),this.onDidChangeEmitter.fire())})),this._register(Ve(()=>this.suggestionInlineCompletionSource.stopForceRenderingAbove()))}get isActive(){return this.suggestionInlineCompletionSource.state!==void 0}isSuggestionPreviewEnabled(){return this.editor.getOption(105).preview}updateCache(){return HA(this,void 0,void 0,function*(){const e=this.suggestionInlineCompletionSource.state;if(!e||!e.selectedItemAsInlineCompletion)return;const t={text:e.selectedItemAsInlineCompletion.text,range:e.selectedItemAsInlineCompletion.range},i=this.editor.getPosition(),n=gi(r=>HA(this,void 0,void 0,function*(){let a;try{a=yield QF(i,this.editor.getModel(),{triggerKind:ls.Automatic,selectedSuggestionInfo:t},r)}catch(l){Le(l);return}r.isCancellationRequested||(this.cache.setValue(this.editor,a,ls.Automatic),this.onDidChangeEmitter.fire())})),o=new XF(n,ls.Automatic);this.updateOperation.value=o,yield n,this.updateOperation.value===o&&this.updateOperation.clear()})}get ghostText(){var e,t;if(!this.isSuggestionPreviewEnabled())return;const i=this.suggestionInlineCompletionSource.state,n=OC(this.editor.getModel(),i==null?void 0:i.selectedItemAsInlineCompletion),o=OC(this.editor.getModel(),(t=(e=this.cache.value)===null||e===void 0?void 0:e.completions[0])===null||t===void 0?void 0:t.toLiveInlineCompletion()),r=o&&n&&o.text.startsWith(n.text)&&o.range.equalsRange(n.range)?o:n||o,a=n?((r==null?void 0:r.text.length)||0)-n.text.length:0;return(h=>{const c=this.editor.getOptions().get(105).previewMode;return h?YF(h,this.editor.getModel(),c,this.editor.getPosition(),a)||new GF(h.range.endLineNumber,[],this.minReservedLineCount):void 0})(r)}}function Ste(s){return s.reduce((e,t)=>e+t,0)}var yte=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},Lte=function(s,e){return function(t,i){e(t,i,s)}},Dte=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class xte extends H{constructor(){super(...arguments),this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.hasCachedGhostText=!1,this.currentModelRef=this._register(new dn)}get targetModel(){var e;return(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object}setTargetModel(e){var t;((t=this.currentModelRef.value)===null||t===void 0?void 0:t.object)!==e&&(this.currentModelRef.clear(),this.currentModelRef.value=e?pte(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 minReservedLineCount(){return this.targetModel?this.targetModel.minReservedLineCount:0}}let pD=class extends xte{constructor(e,t){super(),this.editor=e,this.commandService=t,this.sharedCache=this._register(new kte),this.suggestWidgetAdapterModel=this._register(new wte(this.editor,this.sharedCache)),this.inlineCompletionsModel=this._register(new aD(this.editor,this.sharedCache,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 F(i.lineNumber,n.column))):!1}triggerInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.trigger(ls.Explicit)}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 Dte(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})}};pD=yte([Lte(1,Yt)],pD);class kte extends H{constructor(){super(...arguments),this.onDidChangeEmitter=new M,this.onDidChange=this.onDidChangeEmitter.event,this.cache=this._register(new dn)}get value(){return this.cache.value}setValue(e,t,i){this.cache.value=new RJ(e,t,()=>this.onDidChangeEmitter.fire(),i)}clearAndLeak(){return this.cache.clearAndLeak()}clear(){this.cache.clear()}}var d4=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},fg=function(s,e){return function(t,i){e(t,i,s)}},MS;const zA=(MS=window.trustedTypes)===null||MS===void 0?void 0:MS.createPolicy("editorGhostText",{createHTML:s=>s});let mD=class extends H{constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.instantiationService=i,this.modeService=n,this.disposed=!1,this.partsWidget=this._register(this.instantiationService.createInstance(_D,this.editor)),this.additionalLinesWidget=this._register(new Ite(this.editor,this.modeService.languageIdCodec)),this.viewMoreContentWidget=void 0,this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(29)||o.hasChanged(104)||o.hasChanged(87)||o.hasChanged(82)||o.hasChanged(44)||o.hasChanged(43)||o.hasChanged(58))&&this.update()})),this._register(Ve(()=>{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,h){if(n.length>0){const c=n[n.length-1];h&&c.decorations.push(new qn(c.content.length+1,c.content.length+1+d[0].length,h,0)),c.content+=d[0],d=d.slice(1)}for(const c of d)n.push({content:c,decorations:h?[new qn(1,c.length+1,h,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 h=d.lines;a===void 0?(i.push({column:d.column,text:h[0],preview:d.preview}),h=h.slice(1)):o([r.substring(l,d.column-1)],void 0),h.length>0&&(o(h,"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 F(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(43),o=document.createElement("div");o.className="suggest-preview-additional-widget",Ui.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(ii(d,"mousedown",h=>{var c;(c=this.model)===null||c===void 0||c.setExpanded(!0),h.preventDefault(),this.editor.focus()})),o.append(d),new Ate(this.editor,e,o,l)}};mD=d4([fg(2,Ge),fg(3,Qi)],mD);let _D=class{constructor(e,t,i,n){this.editor=e,this.codeEditorService=t,this.themeService=i,this.contextKeyService=n,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(QO);let r,a;o&&(r=String(o.rgba.a),a=W.Format.CSS.format(h4(o)));const l=n.getColor(XO);let d;l&&(d=`2px dashed ${l}`);const h=this.editor.getModel();if(!h)return;const{tabSize:c}=h.getOptions(),u=h.getLineContent(e)||"";let f=0,g="";const m=new Array;i&&m.push({range:S.fromPositions(new F(e,i.column),new F(e,i.column+i.length)),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});const _=this.contextKeyService.getContextKeyValue("config.editor.useInjectedText"),C=_===void 0?!0:!!_;this.decorationIds=this.editor.deltaDecorations(this.decorationIds,t.map(b=>{g+=u.substring(f,b.column-1),f=b.column-1;const v=C?b.text:this.renderSingleLineText(b.text,g,c,!1),w=this.disposableStore.add(Tte(this.codeEditorService,"ghost-text","0-ghost-text-",{after:{contentText:v,opacity:r,color:a,border:d,fontWeight:b.preview?"bold":"normal"}}));return{range:S.fromPositions(new F(e,b.column)),options:C?{description:"ghost-text",after:{content:v,inlineClassName:b.preview?"ghost-text-decoration-preview":"ghost-text-decoration"},showIfCollapsed:!0}:Object.assign({},w.resolve())}}).concat(m))}renderSingleLineText(e,t,i,n){const o=t+e,r=ct.visibleColumnsByColumns(o,i);let a="",l=t.length+1;for(const d of e){if(d===" "){const h=r[l+1]-r[l];if(n){a+="→";for(let c=1;c<h;c++)a+=" "}else for(let c=0;c<h;c++)a+=" "}else d===" "?n?a+="·":a+=" ":a+=d;l+=1}return a}};_D=d4([fg(1,tt),fg(2,Dt),fg(3,ve)],_D);function h4(s){const{r:e,b:t,g:i}=s.rgba;return new W(new Be(e,i,t,255))}class Ite{constructor(e,t){this.editor=e,this.languageIdCodec=t,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");Ete(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:l})}})}}function Ete(s,e,t,i,n){const o=i.get(29),r=i.get(104),a="none",l=i.get(82),d=i.get(44),h=i.get(43),c=i.get(58),u=Vd(1e4);u.appendASCIIString('<div class="suggest-preview-text">');for(let m=0,_=t.length;m<_;m++){const C=t[m],b=C.content;u.appendASCIIString('<div class="view-line'),u.appendASCIIString('" style="top:'),u.appendASCIIString(String(m*c)),u.appendASCIIString('px;width:1000000px;">');const v=ix(b),w=ZC(b),y=yi.createEmpty(b,n);ov(new wh(h.isMonospace&&!o,h.canUseHalfwidthRightwardsArrow,b,!1,v,w,0,y,C.decorations,e,0,h.spaceWidth,h.middotWidth,h.wsmiddotWidth,r,a,l,d!==Hn.OFF,null),u),u.appendASCIIString("</div>")}u.appendASCIIString("</div>"),Ui.applyFontInfoSlow(s,h);const f=u.build(),g=zA?zA.createHTML(f):f;s.innerHTML=g}let Nte=0;function Tte(s,e,t,i){const n=t+Nte++;return s.registerDecorationType(e,n,i),{dispose(){s.removeDecorationType(n)},resolve(){return s.resolveDecorationOptions(n,!0)}}}class Ate extends H{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(Ve(()=>{this.editor.removeContentWidget(this)})),this.editor.addContentWidget(this)}getId(){return"editor.widget.viewMoreLinesWidget"}getDomNode(){return this.domNode}getPosition(){return{position:this.position,preference:[0]}}}st((s,e)=>{const t=s.getColor(QO);if(t){const n=String(t.rgba.a),o=W.Format.CSS.format(h4(t));e.addRule(`.monaco-editor .ghost-text-decoration { opacity: ${n} !important; color: ${o} !important; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${t.toString()} !important; }`),e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { opacity: ${n} !important; color: ${o} !important; }`)}const i=s.getColor(XO);i&&(e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${i}; }`),e.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${i}; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${i}; }`))});var c4=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},bD=function(s,e){return function(t,i){e(t,i,s)}},pw=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let fi=class u4 extends H{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.triggeredExplicitly=!1,this.activeController=this._register(new dn),this._register(this.editor.onDidChangeModel(()=>{this.updateModelController()})),this._register(this.editor.onDidChangeConfiguration(i=>{i.hasChanged(105)&&this.updateModelController(),i.hasChanged(54)&&this.updateModelController()})),this.updateModelController()}static get(e){return e.getContribution(u4.ID)}get activeModel(){var e;return(e=this.activeController.value)===null||e===void 0?void 0:e.model}updateModelController(){const e=this.editor.getOption(105),t=this.editor.getOption(54);this.activeController.value=void 0,this.activeController.value=this.editor.hasModel()&&(e.preview||t.enabled||this.triggeredExplicitly)?this.instantiationService.createInstance(CD,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 pw(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})}};fi.inlineSuggestionVisible=new re("inlineSuggestionVisible",!1,p("inlineSuggestionVisible","Whether an inline suggestion is visible"));fi.inlineSuggestionHasIndentation=new re("inlineSuggestionHasIndentation",!1,p("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));fi.inlineSuggestionHasIndentationLessThanTabSize=new re("inlineSuggestionHasIndentationLessThanTabSize",!0,p("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));fi.ID="editor.contrib.ghostTextController";fi=c4([bD(1,Ge)],fi);class Rte{constructor(e){this.contextKeyService=e,this.inlineCompletionVisible=fi.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=fi.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=fi.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService)}}let CD=class extends H{constructor(e,t,i){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.contextKeys=new Rte(this.contextKeyService),this.model=this._register(this.instantiationService.createInstance(pD,this.editor)),this.widget=this._register(this.instantiationService.createInstance(mD,this.editor,this.model)),this._register(Ve(()=>{this.contextKeys.inlineCompletionVisible.set(!1),this.contextKeys.inlineCompletionSuggestsIndentation.set(!1),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(!0)})),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);let t=!1,i=!0;const n=this.model.inlineCompletionsModel.ghostText;if(this.model.activeInlineCompletionsModel&&n&&n.parts.length>0){const{column:o,lines:r}=n.parts[0],a=r[0],l=this.editor.getModel().getLineIndentColumn(n.lineNumber);if(o<=l){let h=an(a);h===-1&&(h=a.length-1),t=h>0;const c=this.editor.getModel().getOptions().tabSize;i=ct.visibleColumnFromColumn(a,h+1,c)<c}}this.contextKeys.inlineCompletionSuggestsIndentation.set(t),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(i)}};CD=c4([bD(1,Ge),bD(2,ve)],CD);const f4=Mi.bindToContribution(fi.get),bp=new f4({id:qF,precondition:fi.inlineSuggestionVisible,handler(s){s.commit(),s.editor.focus()}});J(bp);cn.registerKeybindingRule({primary:2,weight:200,id:bp.id,when:te.and(bp.precondition,E.tabMovesFocus.toNegated(),fi.inlineSuggestionHasIndentationLessThanTabSize)});J(new f4({id:"editor.action.inlineSuggest.hide",precondition:fi.inlineSuggestionVisible,kbOpts:{weight:100,primary:9},handler(s){s.hide()}}));class Cu extends oe{constructor(){super({id:Cu.ID,label:p("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:te.and(E.writable,fi.inlineSuggestionVisible),kbOpts:{weight:100,primary:601}})}run(e,t){return pw(this,void 0,void 0,function*(){const i=fi.get(t);i&&(i.showNextInlineCompletion(),t.focus())})}}Cu.ID="editor.action.inlineSuggest.showNext";class vu extends oe{constructor(){super({id:vu.ID,label:p("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:te.and(E.writable,fi.inlineSuggestionVisible),kbOpts:{weight:100,primary:599}})}run(e,t){return pw(this,void 0,void 0,function*(){const i=fi.get(t);i&&(i.showPreviousInlineCompletion(),t.focus())})}}vu.ID="editor.action.inlineSuggest.showPrevious";class Mte extends oe{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:p("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:E.writable})}run(e,t){return pw(this,void 0,void 0,function*(){const i=fi.get(t);i&&i.trigger()})}}nt(fi.ID,fi);ee(Mte);ee(Cu);ee(vu);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},nc=function(s,e){return function(t,i){e(t,i,s)}};class Pte{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 vD=class{constructor(e,t,i,n,o,r,a,l){this._editor=e,this._hover=t,this._commandService=i,this._menuService=n,this._contextKeyService=o,this._modeService=r,this._openerService=a,this.accessibilityService=l}suggestHoverAnchor(e){const t=fi.get(this._editor);if(!t)return null;if(e.target.type===8){const i=e.target.detail;if(t.shouldShowHoverAtViewZone(i.viewZoneId))return new LS(1e3,this,S.fromPositions(i.positionBefore||i.position,i.positionBefore||i.position))}return e.target.type===7&&e.target.range&&t.shouldShowHoverAt(e.target.range)?new LS(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 LS(1e3,this,e.target.range):null}computeSync(e,t){const i=fi.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Pte(this,e.range,i)]:[]}renderHoverParts(e,t,i){const n=new X,o=e[0];this.accessibilityService.isScreenReaderOptimized()&&this.renderScreenReaderText(o,t,n);const r=n.add(this._menuService.createMenu(ae.InlineCompletionsActions,this._contextKeyService)),a=i.addAction({label:p("showNextInlineSuggestion","Next"),commandId:Cu.ID,run:()=>this._commandService.executeCommand(Cu.ID)}),l=i.addAction({label:p("showPreviousInlineSuggestion","Previous"),commandId:vu.ID,run:()=>this._commandService.executeCommand(vu.ID)});i.addAction({label:p("acceptInlineSuggestion","Accept"),commandId:bp.id,run:()=>this._commandService.executeCommand(bp.id)});const d=[a,l];for(const h of d)h.setEnabled(!1);o.hasMultipleSuggestions().then(h=>{for(const c of d)c.setEnabled(h)});for(const[h,c]of r.getActions())for(const u of c)u instanceof Ud&&i.addAction({label:u.label,commandId:u.item.id,run:()=>this._commandService.executeCommand(u.item.id)});return n}renderScreenReaderText(e,t,i){var n,o;const r=Y,a=r("div.hover-row.markdown-hover"),l=U(a,r("div.hover-contents")),d=i.add(new wl({editor:this._editor},this._modeService,this._openerService)),h=u=>{i.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",this._hover.onContentsChanged()}));const f=p("inlineSuggestionFollows","Suggestion:"),g=i.add(d.render(new ma().appendText(f).appendCodeblock("text",u)));l.replaceChildren(g.element)},c=(o=(n=e.controller.activeModel)===null||n===void 0?void 0:n.inlineCompletionsModel)===null||o===void 0?void 0:o.ghostText;if(c){const u=this._editor.getModel().getLineContent(c.lineNumber);h(c.renderForScreenReader(u))}t.appendChild(a)}};vD=Ote([nc(2,Yt),nc(3,yh),nc(4,ve),nc(5,Qi),nc(6,Co),nc(7,On)],vD);var g4=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)}},UA=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const $A=Y;let wD=class extends H{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=$A("div.hover-row.status-bar"),this.actionsElement=U(this.hoverElement,$A("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(gI.render(this.actionsElement,e,i))}append(e){const t=U(this.actionsElement,e);return this._hasContent=!0,t}};wD=g4([Y_(0,Nt)],wD);class FC{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 UA(this,void 0,void 0,function*(){const t=this._anchor;if(!this._editor.hasModel()||!t)return Promise.resolve([]);const i=FC._getLineDecorations(this._editor,t),n=yield Promise.all(this._participants.map(o=>this._computeAsync(o,i,t,e)));return _x(n)})}_computeAsync(e,t,i,n){return UA(this,void 0,void 0,function*(){return e.computeAsync?e.computeAsync(i,t,n):[]})}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=FC._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return vh(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 Ka=class SD extends ss{constructor(e,t,i,n,o){super(),this._hoverVisibleKey=t,this._keybindingService=n,this._contextKeyService=o,this.allowEditorOverflow=!0,this._participants=[i.createInstance(XL,e,this),i.createInstance(JL,e,this),i.createInstance(vD,e,this),i.createInstance(rD,e,this)],this._editor=e,this._isVisible=!1,this._stoleFocus=!1,this._renderDisposable=null,this._hover=this._register(new RF),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this.onkeydown(this._hover.containerDomNode,r=>{r.equals(9)&&this.hide()}),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(43)&&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 FC(this._editor,this._participants),this._highlightDecorations=[],this._isChangingDecorations=!1,this._shouldFocus=!1,this._colorPicker=null,this._preferAbove=this._editor.getOption(52).above,this._hoverOperation=new OF(this._computer,r=>this._withResult(r,!0),null,r=>this._withResult(r,!1),this._editor.getOption(52).delay),this._register(ii(this.getDomNode(),ue.FOCUS,()=>{this._colorPicker&&this.getDomNode().classList.add("colorpicker-hover")})),this._register(ii(this.getDomNode(),ue.BLUR,()=>{this.getDomNode().classList.remove("colorpicker-hover")})),this._register(e.onDidChangeConfiguration(()=>{this._hoverOperation.setHoverTime(this._editor.getOption(52).delay),this._preferAbove=this._editor.getOption(52).above})),this._register(Rt.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 SD.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(43).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 S(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1):e.target.range;i.push(new uA(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(){if(this._isVisible){let e=this._preferAbove;return!e&&this._contextKeyService.getContextKeyValue(Fe.Visible.key)&&(e=!0),{position:this._showAtPosition,range:this._showAtRange,preference:e?[1,2]:[2,1]}}return 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(43);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i/t}`,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 uA(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 h of t)i=Math.min(i,h.range.startColumn),n=S.plusRange(n,h.range),h.forceShowAtRange&&(o=h.range),l.has(h.owner)||l.set(h.owner,[]),l.get(h.owner).push(h);const d=a.add(new wD(this._keybindingService));for(const[h,c]of l)a.add(h.renderHoverParts(c,r,d));d.hasContent&&r.appendChild(d.hoverElement),this._renderDisposable=a,r.hasChildNodes()&&(o?this._showAt(o.getStartPosition(),o,this._shouldFocus):this._showAt(new F(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:SD._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1}};Ka.ID="editor.contrib.modesContentHoverWidget";Ka._DECORATION_OPTIONS=Ee.register({description:"content-hover-highlight",className:"hoverHighlight"});Ka=g4([Y_(2,Ge),Y_(3,Nt),Y_(4,ve)],Ka);const jA=Y;class Fte{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||dg(o)||i.push(...bx(o).map(e))}return i}onResult(e,t){this._result=this._result.concat(e)}getResult(){return this._result}getResultWithLoadingMessage(){return this.getResult()}}class _d extends ss{constructor(e,t,i=dW){super(),this._renderDisposeables=this._register(new X),this._editor=e,this._isVisible=!1,this._messages=[],this._lastLineNumber=-1,this._hover=this._register(new RF),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new wl({editor:this._editor},t,i)),this._computer=new Fte(this._editor),this._hoverOperation=new OF(this._computer,n=>this._withResult(n),void 0,n=>this._withResult(n),300),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(43)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._hoverOperation.cancel(),this._editor.removeOverlayWidget(this),super.dispose()}getId(){return _d.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),o=this._editor.getOption(58),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}_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()}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(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const o=jA("div.hover-row.markdown-hover"),r=U(o,jA("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}}_d.ID="editor.contrib.modesGlyphHoverWidget";var Bte=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},a_=function(s,e){return function(t,i){e(t,i,s)}};let Ll=class p4{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(52)&&(this._unhookEvents(),this._hookEvents())}),this._hoverVisibleKey=E.hoverVisible.bindTo(o)}static get(e){return e.getContribution(p4.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(52);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===Ka.ID){this._hoverClicked=!0;return}t===12&&e.target.detail===_d.ID||(t!==12&&e.target.detail!==_d.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===Ka.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===Ka.ID&&(!((n=this._contentWidget)===null||n===void 0)&&n.isColorPickerVisible())||this._isHoverSticky&&a===12&&e.target.detail===_d.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 _d(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(Ka,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()}};Ll.ID="editor.contrib.hover";Ll=Bte([a_(1,Ge),a_(2,Co),a_(3,Qi),a_(4,ve)],Ll);class Wte extends oe{constructor(){super({id:"editor.action.showHover",label:p({key:"showHover",comment:["Label for action that will trigger the showing of a hover in the editor.","This allows for users to show the hover without using the mouse."]},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;let i=Ll.get(t);if(!i)return;const n=t.getPosition(),o=new S(n.lineNumber,n.column,n.lineNumber,n.column),r=t.getOption(2)===2;i.showContentHover(o,1,r)}}class Vte extends oe{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=Ll.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new S(n.lineNumber,n.column,n.lineNumber,n.column);sh.get(t).startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,1,!0)})}}nt(Ll.ID,Ll);ee(Wte);ee(Vte);st((s,e)=>{const t=s.getColor(I9);t&&e.addRule(`.monaco-editor .hoverHighlight { background-color: ${t}; }`);const i=s.getColor(Kd);i&&e.addRule(`.monaco-editor .monaco-hover { background-color: ${i}; }`);const n=s.getColor(tk);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(Vp);o&&e.addRule(`.monaco-editor .monaco-hover a { color: ${o}; }`);const r=s.getColor(Hp);r&&e.addRule(`.monaco-editor .monaco-hover a:hover { color: ${r}; }`);const a=s.getColor(ek);a&&e.addRule(`.monaco-editor .monaco-hover { color: ${a}; }`);const l=s.getColor(E9);l&&e.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${l}; }`);const d=s.getColor($x);d&&e.addRule(`.monaco-editor .monaco-hover code { background-color: ${d}; }`)});class yD extends H{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(Ll.ID);if(!o.isColorPickerVisible()){const r=new S(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1);o.showContentHover(r,0,!1)}}}yD.ID="editor.contrib.colorContribution";nt(yD.ID,yD);class qa{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,h=e.endColumn,c=o.getLineContent(a),u=o.getLineContent(d);let f=c.lastIndexOf(t,l-1+t.length),g=u.indexOf(i,h-1-i.length);if(f!==-1&&g!==-1)if(a===d)c.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const _=c.substring(f+t.length),C=u.substring(0,g);(_.indexOf(i)>=0||C.indexOf(i)>=0)&&(f=-1,g=-1)}let m;f!==-1&&g!==-1?(n&&f+t.length<c.length&&c.charCodeAt(f+t.length)===32&&(t=t+" "),n&&g>0&&u.charCodeAt(g-1)===32&&(i=" "+i,g-=1),m=qa._createRemoveBlockCommentOperations(new S(a,f+t.length+1,d,g+1),t,i)):(m=qa._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){let n=[];return S.isEmpty(e)?n.push(Ut.delete(new S(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Ut.delete(new S(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Ut.delete(new S(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){let o=[];return S.isEmpty(e)?o.push(Ut.replace(new S(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Ut.insert(new F(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Ut.insert(new F(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=Qe.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 ne(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 ne(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}class Hr{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=Qe.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 h=0,c=n.length;h<c;h++){const u=n[h],f=o+h;if(f===o&&a){u.ignore=!0;continue}const g=i.getLineContent(f),m=an(g);if(m===-1){u.ignore=r,u.commentStrOffset=g.length;continue}if(l=!1,u.ignore=!1,u.commentStrOffset=m,d&&!qa._haystackHasNeedleAtOffset(g,u.commentStr,m)&&(e===0?d=!1:e===1||(u.ignore=!0)),d&&t){const _=m+u.commentStrLength;_<g.length&&g.charCodeAt(_)===32&&(u.commentStrLength+=1)}}if(e===0&&l){d=!1;for(let h=0,c=n.length;h<c;h++)n[h].ignore=!1}return{supported:!0,shouldRemoveComments:d,lines:n}}static _gatherPreflightData(e,t,i,n,o,r,a){const l=Hr._gatherPreflightCommentStrings(i,n,o);return l===null?{supported:!1}:Hr._analyzeLines(e,t,i,l,n,r,a)}_executeLineComments(e,t,i,n){let o;i.shouldRemoveComments?o=Hr._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(Hr._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new F(n.positionLineNumber,n.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),S.isEmpty(o[a].range)&&S.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?qa._createRemoveBlockCommentOperations(new S(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=Qe.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 h=an(d);h===-1&&(h=d.length),l=qa._createAddBlockCommentOperations(new S(i.startLineNumber,h+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=qa._createAddBlockCommentOperations(new S(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 S(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
  634. `),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=Hr._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 ne(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(Ut.delete(new S(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(Ut.insert(new F(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 h=e.getLineContent(i+l);let c=0;for(let u=0,f=t[l].commentStrOffset;c<o&&u<f;u++)c=Hr.nextVisibleColumn(c,n,h.charCodeAt(u)===9,1);c<o&&(o=c)}o=Math.floor(o/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const h=e.getLineContent(i+l);let c=0;for(r=0,a=t[l].commentStrOffset;c<o&&r<a;r++)c=Hr.nextVisibleColumn(c,n,h.charCodeAt(r)===9,1);c>o?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class vI extends oe{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(19),a=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));a.sort((d,h)=>S.compareRangesUsingStarts(d.selection,h.selection));let l=a[0];for(let d=1;d<a.length;d++){const h=a[d];l.selection.endLineNumber===h.selection.startLineNumber&&(l.index<h.index?h.ignoreFirstLine=!0:(l.ignoreFirstLine=!0,l=h))}for(const d of a)n.push(new Hr(d.selection,o.tabSize,this._type,r.insertSpace,r.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Hte extends vI{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:ae.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class zte extends vI{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2081),weight:100}})}}class Ute extends vI{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2099),weight:100}})}}class $te extends oe{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:ae.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){if(!t.hasModel())return;const i=t.getOption(19),n=[],o=t.getSelections();for(const r of o)n.push(new qa(r,i.insertSpace));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}ee(Hte);ee(zte);ee(Ute);ee($te);var jte=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},vf=function(s,e){return function(t,i){e(t,i,s)}};let wu=class m4{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&&bh(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(m4.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(20)){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.event.stopPropagation(),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(20)||!this._editor.hasModel())return;if(!this._contextMenuService){this._editor.focus();return}const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?ae.SimpleEditorContext:ae.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 Nx){const h=this._getMenuActions(e,d.item.submenu);h.length>0&&(i.push(new Cv(d.id,d.label,h)),l++)}else i.push(d),l++;l&&i.push(new $s)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(52);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=Ii(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(113)&&!lr;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 Yg(o,o,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new Yg(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()}};wu.ID="editor.contrib.contextmenu";wu=jte([vf(1,Tl),vf(2,Nl),vf(3,ve),vf(4,Nt),vf(5,yh)],wu);class Kte extends oe{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:E.textInputFocus,primary:1092,weight:100}})}run(e,t){wu.get(t).showContextMenu()}}nt(wu.ID,wu);ee(Kte);class OS{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 PS{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class rh extends H{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 OS(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new PS(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(rh.ID)}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new PS(new OS(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 PS(new OS(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}}rh.ID="editor.contrib.cursorUndoRedoController";class qte extends oe{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:2099,weight:100}})}run(e,t,i){rh.get(t).cursorUndo()}}class Gte extends oe{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){rh.get(t).cursorRedo()}}nt(rh.ID,rh);ee(qte);ee(Gte);class Zte{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 S(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 ne(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 ne(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 ne(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 ne(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 ne(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 sc(s){return Me?s.altKey:s.ctrlKey}class la extends H{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(31)||this._editor.getOption(18)||(sc(e)&&(this._modifierPressed=!0),this._mouseDown&&sc(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(31)||this._editor.getOption(18)||(sc(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===la.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}sc(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 F(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 ne(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ne(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(sc(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(la.ID,new Zte(this._dragSelection,t,sc(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 S(e.lineNumber,e.column,e.lineNumber,e.column),options:la._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()}}la.ID="editor.contrib.dragAndDrop";la.TRIGGER_KEY_VALUE=Me?6:5;la._DECORATION_OPTIONS=Ee.register({description:"dnd-target",className:"dnd-target"});nt(la.ID,la);class Ki{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===Ki._FIND_MATCH_DECORATION||n===Ki._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,Ki._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,Ki._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 S(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,Ki._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=Ki._FIND_MATCH_DECORATION,o=[];if(e.length>1e3){n=Ki._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,h=Math.max(2,Math.ceil(3/d));let c=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+h>=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new S(c,1,u,1),options:Ki._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),c=m.startLineNumber,u=m.endLineNumber)}o.push({range:new S(c,1,u,1),options:Ki._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,Ki._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}}Ki._CURRENT_FIND_MATCH_DECORATION=Ee.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:$t(nk),position:Xn.Center},minimap:{color:$t(UO),position:fs.Inline}});Ki._FIND_MATCH_DECORATION=Ee.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:$t(nk),position:Xn.Center},minimap:{color:$t(UO),position:fs.Inline}});Ki._FIND_MATCH_NO_OVERVIEW_DECORATION=Ee.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Ki._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Ee.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:$t(nk),position:Xn.Center}});Ki._RANGE_HIGHLIGHT_DECORATION=Ee.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Ki._FIND_SCOPE_DECORATION=Ee.register({description:"find-scope",className:"findScope",isWholeLine:!0});class Yte{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)=>S.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 _4(s,e){if(s&&s[0]!==""){const t=KA(s,e,"-"),i=KA(s,e,"_");return t&&!i?qA(s,e,"-"):!t&&i?qA(s,e,"_"):s[0].toUpperCase()===s[0]?e.toUpperCase():s[0].toLowerCase()===s[0]?e.toLowerCase():P3(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 KA(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function qA(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=_4([n[a]],r)+t}),o.slice(0,-1)}class GA{constructor(e){this.staticValue=e,this.kind=0}}class Xte{constructor(e){this.pieces=e,this.kind=1}}class Su{constructor(e){!e||e.length===0?this._state=new GA(""):e.length===1&&e[0].staticValue!==null?this._state=new GA(e[0].staticValue):this._state=new Xte(e)}static fromStaticValue(e){return new Su([Md.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}buildReplaceString(e,t){if(this._state.kind===0)return t?_4(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=Su._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){let l=[],d=r.caseOps.length,h=0;for(let c=0,u=a.length;c<u;c++){if(h>=d){l.push(a.slice(c));break}switch(r.caseOps[h]){case"U":l.push(a[c].toUpperCase());break;case"u":l.push(a[c].toUpperCase()),h++;break;case"L":l.push(a[c].toLowerCase());break;case"l":l.push(a[c].toLowerCase()),h++;break;default:l.push(a[c])}}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 Md{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 Md(e,-1,null)}static caseOps(e,t){return new Md(null,e,t)}}class Qte{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++]=Md.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=Md.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Md.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new Su(this._result)}}function Jte(s){if(!s||s.length===0)return new Su(null);let e=[],t=new Qte(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(`
  635. `,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 Oh=new re("findWidgetVisible",!1),mw=new re("findInputFocussed",!1),wI=new re("replaceInputFocussed",!1),l_={primary:545,mac:{primary:2593}},d_={primary:565,mac:{primary:2613}},h_={primary:560,mac:{primary:2608}},c_={primary:554,mac:{primary:2602}},u_={primary:558,mac:{primary:2606}},Ct={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"},Ga=19999,eie=240;class gg{constructor(e,t){this._toDispose=new X,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new hn,this._decorations=new Ki(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Lt(()=>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,qe(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)},eie)):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 S(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));let n=this._findMatches(i,!1,Ga);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=FM(n.map(l=>l.range),l=>S.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(35).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 F(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const h=this._decorations.matchAfterPosition(e);h&&this._setCurrentFindMatch(h);return}if(this._decorations.getCount()<Ga){let h=this._decorations.matchBeforePosition(e);h&&h.isEmpty()&&h.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),h=this._decorations.matchBeforePosition(e)),h&&this._setCurrentFindMatch(h);return}if(this._cannotFind())return;let i=this._decorations.getFindScope(),n=gg._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 F(o,r),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):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(115):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 F(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<Ga){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=gg._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(),h=new F(a,l),c=d.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t);return i&&c&&c.range.isEmpty()&&c.range.getStartPosition().equals(h)&&(h=this._nextSearchPosition(h),c=d.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t)),c?!n&&!r.containsRange(c.range)?this._getNextMatch(c.range.getEndPosition(),t,i,!0):c:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_getReplacePattern(){return this._state.isRegex?Jte(this._state.replaceString):Su.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 xi(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new F(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=>gg._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(115):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Ga?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Yl(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let c="mu";i.ignoreCase&&(c+="i"),i.global&&(c+="g"),i=new RegExp(i.source,c)}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 h=new lk(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",h)}_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 Yte(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 ne(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 tie={inputActiveOptionBorder:W.fromHex("#007ACC00"),inputActiveOptionForeground:W.fromHex("#FFFFFF"),inputActiveOptionBackground:W.fromHex("#0E639C50")};class rm extends ss{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({},tie),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...En.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 iie=p("caseDescription","Match Case"),nie=p("wordsDescription","Match Whole Word"),sie=p("regexDescription","Use Regular Expression");class b4 extends rm{constructor(e){super({icon:ie.caseSensitive,title:iie+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class C4 extends rm{constructor(e){super({icon:ie.wholeWord,title:nie+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class v4 extends rm{constructor(e){super({icon:ie.regex,title:sie+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class _w extends ss{constructor(e,t,i,n){super(),this._hideSoon=this._register(new Lt(()=>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(yy),r=n.getColorTheme().getColor(Dy),a=n.getColorTheme().getColor(Ly);this.caseSensitive=this._register(new b4({appendTitle:this._keybindingLabelFor(Ct.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 C4({appendTitle:this._keybindingLabelFor(Ct.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 v4({appendTitle:this._keybindingLabelFor(Ct.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(ZD(this._domNode,l=>this._onMouseOut())),this._register(q(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 _w.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(yy),inputActiveOptionForeground:e.getColor(Dy),inputActiveOptionBackground:e.getColor(Ly)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}_w.ID="editor.contrib.findOptionsWidget";st((s,e)=>{const t=s.getColor(Zn);t&&e.addRule(`.monaco-editor .findOptionsWidget { background-color: ${t}; }`);const i=s.getColor(oa);i&&e.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const n=s.getColor(fl);n&&e.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${n}; }`);const o=s.getColor(Zt);o&&e.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${o}; }`)});function f_(s,e){return s===1?!0:s===2?!1:e}class oie extends H{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 f_(this._isRegexOverride,this._isRegex)}get wholeWord(){return f_(this._wholeWordOverride,this._wholeWord)}get matchCase(){return f_(this._matchCaseOverride,this._matchCase)}get preserveCase(){return f_(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"&&(S.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,h=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(c=>{var u;return(u=this._searchScope)===null||u===void 0?void 0:u.some(f=>!S.equalsRange(f,c))})||(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),h!==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>=Ga}}const rie=p("defaultLabel","input");class aie extends ss{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||rie,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,h=!!n.flexibleWidth,c=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new L2(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,showHistoryHint:n.showHistoryHint,flexibleHeight:d,flexibleWidth:h,flexibleMaxHeight:c})),this.regex=this._register(new v4({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 C4({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 b4({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 _=-1;g.equals(17)?_=(m+1)%u.length:g.equals(15)&&(m===0?_=u.length-1:_=m-1),g.equals(9)?(u[m].blur(),this.inputBox.focus()):_>=0&&u[_].focus(),rt.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(q(this.inputBox.inputElement,"compositionstart",g=>{this.imeSessionInProgress=!0})),this._register(q(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 lie=p("defaultLabel","input"),die=p("label.preserveCaseCheckbox","Preserve Case");class hie extends rm{constructor(e){super({icon:ie.preserveCase,title:die+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class cie extends ss{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||lie,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 L2(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,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:d})),this.preserveCase=this._register(new hie({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 h=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){let f=h.indexOf(document.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%h.length:u.equals(15)&&(f===0?g=h.length-1:g=f-1),u.equals(9)?(h[f].blur(),this.inputBox.focus()):g>=0&&h[g].focus(),rt.stop(u,!0)}}});let c=document.createElement("div");c.className="controls",c.style.display=this._showOptionButtons?"block":"none",c.appendChild(this.preserveCase.domNode),this.domNode.appendChild(c),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 w4=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},S4=function(s,e){return function(t,i){e(t,i,s)}};const Cp="historyNavigationWidget",y4="historyNavigationForwardsEnabled",L4="historyNavigationBackwardsEnabled";function uie(s,e,t){new re(t,e).bindTo(s)}function fie(s,e){return s.createScoped(e.target)}function D4(s,e){return s.getContext(document.activeElement).getValue(e)}function x4(s,e){const t=fie(s,e);uie(t,e,Cp);const i=new re(y4,!0).bindTo(t),n=new re(L4,!0).bindTo(t);return{scopedContextKeyService:t,historyNavigationForwardsEnablement:i,historyNavigationBackwardsEnablement:n}}let LD=class extends aie{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(x4(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};LD=w4([S4(3,ve)],LD);let DD=class extends cie{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(x4(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};DD=w4([S4(3,ve)],DD);cn.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:te.and(te.has(Cp),te.equals(L4,!0),Fe.Visible.isEqualTo(!1)),primary:16,secondary:[528],handler:s=>{const e=D4(s.get(ve),Cp);e&&e.historyNavigator.showPreviousValue()}});cn.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:te.and(te.has(Cp),te.equals(y4,!0),Fe.Visible.isEqualTo(!1)),primary:18,secondary:[530],handler:s=>{const e=D4(s.get(ve),Cp);e&&e.historyNavigator.showNextValue()}});function ZA(s){var e,t;return((e=s.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=s.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var gie=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const pie=Oi("find-selection",ie.selection,p("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),YA=Oi("find-collapsed",ie.chevronRight,p("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),XA=Oi("find-expanded",ie.chevronDown,p("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),mie=Oi("find-replace",ie.replace,p("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),_ie=Oi("find-replace-all",ie.replaceAll,p("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),bie=Oi("find-previous-match",ie.arrowUp,p("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Cie=Oi("find-next-match",ie.arrowDown,p("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),vie=p("label.find","Find"),wie=p("placeholder.find","Find"),Sie=p("label.previousMatchButton","Previous Match"),yie=p("label.nextMatchButton","Next Match"),Lie=p("label.toggleSelectionFind","Find in Selection"),Die=p("label.closeButton","Close"),xie=p("label.replace","Replace"),kie=p("placeholder.replace","Replace"),Iie=p("label.replaceButton","Replace"),Eie=p("label.replaceAllButton","Replace All"),Nie=p("label.toggleReplaceButton","Toggle Replace"),Tie=p("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Ga),Aie=p("label.matchesLocation","{0} of {1}"),QA=p("label.noResults","No results"),Fo=419,Rie=275,Mie=Rie-54;let wf=69;const Oie=33,JA="ctrlEnterReplaceAll.windows.donotask",eR=Me?256:2048;class FS{constructor(e){this.afterLineNumber=e,this.heightInPx=Oie,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function tR(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function iR(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){s.stopPropagation();return}}class bw extends ss{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(JA,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new ca(500),this._register(Ve(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(80)&&(this._codeEditor.getOption(80)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(129)&&this._tryUpdateWidgetWidth(),h.hasChanged(2)&&this.updateAccessibilitySupport(),h.hasChanged(35)){const c=this._codeEditor.getOption(35).addExtraSpaceOnTop;c&&!this._viewZone&&(this._viewZone=new FS(0),this._showViewZone()),!c&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>gie(this,void 0,void 0,function*(){if(this._isVisible){let h=yield this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}}))),this._findInputFocused=mw.bindTo(r),this._findFocusTracker=this._register(Gc(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=wI.bindTo(r),this._replaceFocusTracker=this._register(Gc(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(35).addExtraSpaceOnTop&&(this._viewZone=new FS(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(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return bw.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(80)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=Es(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,Le)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=wf+"px",this._state.matchesCount>=Ga?this._matchesCount.title=Tie: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>=Ga&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Vi(Aie,i,t)}else e=QA;this._matchesCount.appendChild(document.createTextNode(e)),Ei(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),wf=Math.max(wf,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===QA)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(80);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(35).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(35).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=Ii(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=qR(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(35).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(35).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new FS(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(74).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(yy),inputActiveOptionBackground:e.getColor(Ly),inputActiveOptionForeground:e.getColor(Dy),inputBackground:e.getColor(jx),inputForeground:e.getColor(Kx),inputBorder:e.getColor(qx),inputValidationInfoBackground:e.getColor(Gx),inputValidationInfoForeground:e.getColor(Zx),inputValidationInfoBorder:e.getColor(Yx),inputValidationWarningBackground:e.getColor(RO),inputValidationWarningForeground:e.getColor(MO),inputValidationWarningBorder:e.getColor(OO),inputValidationErrorBackground:e.getColor(PO),inputValidationErrorForeground:e.getColor(FO),inputValidationErrorBorder:e.getColor(BO)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible||!qD(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&&Es(this._domNode)>Fo){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Es(this._findInput.domNode);return}if(Fo+28+n>=i&&(r=!0),Fo+28+n-wf>=i&&(a=!0),Fo+28+n-wf>=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=Es(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&&!S.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(eR|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
  636. `),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 tR(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return iR(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(eR|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Ai&&uo&&!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(JA,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
  637. `),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 tR(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return iR(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 LD(null,this._contextViewProvider,{width:Mie,label:vie,placeholder:wie,appendCaseSensitiveLabel:this._keybindingLabelFor(Ct.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ct.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ct.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,showHistoryHint:()=>ZA(this._keybindingService)},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()})),Cn&&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 oc({label:Sie+this._keybindingLabelFor(Ct.PreviousMatchFindAction),icon:bie,onTrigger:()=>{this._codeEditor.getAction(Ct.PreviousMatchFindAction).run().then(void 0,Le)}})),this._nextBtn=this._register(new oc({label:yie+this._keybindingLabelFor(Ct.NextMatchFindAction),icon:Cie,onTrigger:()=>{this._codeEditor.getAction(Ct.NextMatchFindAction).run().then(void 0,Le)}}));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 rm({icon:pie,title:Lie+this._keybindingLabelFor(Ct.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 oc({label:Die+this._keybindingLabelFor(Ct.CloseFindWidgetCommand),icon:J$,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 DD(null,void 0,{label:xie,placeholder:kie,appendPreserveCaseLabel:this._keybindingLabelFor(Ct.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>ZA(this._keybindingService)},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 oc({label:Iie+this._keybindingLabelFor(Ct.ReplaceOneAction),icon:mie,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new oc({label:Eie+this._keybindingLabelFor(Ct.ReplaceAllAction),icon:_ie,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 oc({label:Nie,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Es(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=`${Fo}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(o),this._resizeSash=new Wi(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Fo;this._register(this._resizeSash.onDidStart(()=>{a=Es(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;let d=a+l.startX-l.currentX;if(d<Fo)return;const h=parseFloat(XD(this._domNode).maxWidth)||0;d>h||(this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=Es(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Es(this._domNode);if(l<Fo)return;let d=Fo;if(!this._resized||l===Fo){const h=this._codeEditor.getLayoutInfo();d=h.width-28-h.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=Es(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}bw.ID="editor.contrib.findWidget";class oc extends ss{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+kt.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(...kt.asClassNameArray(YA)),this._domNode.classList.add(...kt.asClassNameArray(XA))):(this._domNode.classList.remove(...kt.asClassNameArray(XA)),this._domNode.classList.add(...kt.asClassNameArray(YA)))}}st((s,e)=>{const t=(g,m)=>{m&&e.addRule(`.monaco-editor ${g} { background-color: ${m}; }`)};t(".findMatch",s.getColor(ky)),t(".currentFindMatch",s.getColor(y9)),t(".findScope",s.getColor(L9));const i=s.getColor(Zn);t(".find-widget",i);const n=s.getColor(fl);n&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const o=s.getColor(x9);o&&e.addRule(`.monaco-editor .findMatch { border: 1px ${s.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=s.getColor(D9);r&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=s.getColor(k9);a&&e.addRule(`.monaco-editor .findScope { border: 1px ${s.type==="hc"?"dashed":"solid"} ${a}; }`);const l=s.getColor(Zt);l&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const d=s.getColor(oa);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const h=s.getColor(n9);h&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${h}; }`);const c=s.getColor(u9);if(c)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const g=s.getColor(xd);g&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${g}; }`)}const u=s.getColor(d6);u&&e.addRule(`
  638. .monaco-editor .find-widget .button:not(.disabled):hover,
  639. .monaco-editor .find-widget .codicon-find-selection:hover {
  640. background-color: ${u} !important;
  641. }
  642. `);const f=s.getColor(ul);f&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${f}; }`)});var k4=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},$o=function(s,e){return function(t,i){e(t,i,s)}},yu=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Pie=524288;function xD(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.getModel().getValueLengthInRange(i)<Pie)return s.getModel().getValueInRange(i)}return null}let ns=class I4 extends H{constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=Oh.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new ca(500),this._state=this._register(new oie),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",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(35).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(I4.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!!mw.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=Ks(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e){return yu(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;let t={isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){let i=xD(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);i&&(this._state.isRegex?t.searchString=Ks(i):t.searchString=i)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){let i=xD(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 gg(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 yu(this,void 0,void 0,function*(){return this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};ns.ID="editor.contrib.findController";ns=k4([$o(1,ve),$o(2,yr),$o(3,Al)],ns);let kD=class extends ns{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 yu(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(35).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 bw(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new _w(this._editor,this._state,this._keybindingService,this._themeService))}};kD=k4([$o(1,Nl),$o(2,ve),$o(3,Nt),$o(4,Dt),$o(5,ni),$o(6,yr),$o(7,Al)],kD);const Fie=gO(new fO({id:Ct.StartFindAction,label:p("startFindAction","Find"),alias:"Find",precondition:te.or(E.focus,te.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:ae.MenubarEditMenu,group:"3_find",title:p({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));Fie.addImplementation(0,(s,e,t)=>{const i=ns.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop}):!1});class Bie extends oe{constructor(){super({id:Ct.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 yu(this,void 0,void 0,function*(){let i=ns.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class E4 extends oe{run(e,t){return yu(this,void 0,void 0,function*(){let i=ns.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class Wie extends E4{constructor(){super({id:Ct.NextMatchFindAction,label:p("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:E.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:te.and(E.focus,mw),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class Vie extends E4{constructor(){super({id:Ct.PreviousMatchFindAction,label:p("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:E.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:te.and(E.focus,mw),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class N4 extends oe{run(e,t){return yu(this,void 0,void 0,function*(){let i=ns.get(t);if(!i)return;const n=t.getOption(35).seedSearchStringFromSelection==="selection";let o=null;t.getOption(35).seedSearchStringFromSelection!=="never"&&(o=xD(t,"single",n)),o&&i.setSearchString(o),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class Hie extends N4{constructor(){super({id:Ct.NextSelectionMatchFindAction,label:p("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class zie extends N4{constructor(){super({id:Ct.PreviousSelectionMatchFindAction,label:p("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const Uie=gO(new fO({id:Ct.StartFindReplaceAction,label:p("startReplace","Replace"),alias:"Replace",precondition:te.or(E.focus,te.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:ae.MenubarEditMenu,group:"3_find",title:p({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));Uie.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(80))return!1;const i=ns.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(35).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop})});nt(ns.ID,kD);ee(Bie);ee(Wie);ee(Vie);ee(Hie);ee(zie);const Eo=Mi.bindToContribution(ns.get);J(new Eo({id:Ct.CloseFindWidgetCommand,precondition:Oh,handler:s=>s.closeFindWidget(),kbOpts:{weight:105,kbExpr:te.and(E.focus,te.not("isComposing")),primary:9,secondary:[1033]}}));J(new Eo({id:Ct.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:E.focus,primary:l_.primary,mac:l_.mac,win:l_.win,linux:l_.linux}}));J(new Eo({id:Ct.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:105,kbExpr:E.focus,primary:d_.primary,mac:d_.mac,win:d_.win,linux:d_.linux}}));J(new Eo({id:Ct.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:105,kbExpr:E.focus,primary:h_.primary,mac:h_.mac,win:h_.win,linux:h_.linux}}));J(new Eo({id:Ct.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:105,kbExpr:E.focus,primary:c_.primary,mac:c_.mac,win:c_.win,linux:c_.linux}}));J(new Eo({id:Ct.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:105,kbExpr:E.focus,primary:u_.primary,mac:u_.mac,win:u_.win,linux:u_.linux}}));J(new Eo({id:Ct.ReplaceOneAction,precondition:Oh,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:E.focus,primary:3094}}));J(new Eo({id:Ct.ReplaceOneAction,precondition:Oh,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:te.and(E.focus,wI),primary:3}}));J(new Eo({id:Ct.ReplaceAllAction,precondition:Oh,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:E.focus,primary:2563}}));J(new Eo({id:Ct.ReplaceAllAction,precondition:Oh,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:te.and(E.focus,wI),primary:void 0,mac:{primary:2051}}}));J(new Eo({id:Ct.SelectAllMatchesAction,precondition:Oh,handler:s=>s.selectAllMatches(),kbOpts:{weight:105,kbExpr:E.focus,primary:515}}));const nR=65535,Qr=16777215,sR=4278190080;class vp{constructor(e,t,i){if(e.length!==t.length||e.length>nR)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>Qr||r>Qr)throw new Error("startLineNumber or endLineNumber must not exceed "+Qr);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]&Qr}getEndLineNumber(e){return this._endIndexes[e]&Qr}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)}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new $ie(this,e)}getParentIndex(e){this.ensureParentIndices();let t=((this._startIndexes[e]&sR)>>>24)+((this._endIndexes[e]&sR)>>>16);return t===nR?-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 $ie{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 jie{constructor(e,t){this._updateEventEmitter=new M,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new vp(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),h=this._regions.isCollapsed(n);d<=o&&i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(h,d<=r)),h&&d>r&&(r=d),n++}};for(let l of e){let d=l.regionIndex,h=this._editorDecorationIds[d];if(h&&!t[h]){t[h]=!0,a(d);let c=!this._regions.isCollapsed(d);this._regions.setCollapsed(d,c),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=(c,u)=>{for(let f of t)if(c<f&&f<=u)return!0;return!1},o=-1,r=(c,u)=>{const f=e.getStartLineNumber(c),g=e.getEndLineNumber(c);u||(u=e.isCollapsed(c)),u&&n(f,g)&&(u=!1),e.setCollapsed(c,u);const m=this._textModel.getLineMaxColumn(f),_={startLineNumber:f,startColumn:Math.max(m-1,1),endLineNumber:f,endColumn:m};i.push({range:_,options:this._decorationProvider.getDecorationOption(u,g<=o)}),u&&g>o&&(o=g)},a=0,l=()=>{for(;a<this._regions.length;){let c=this._regions.isCollapsed(a);if(a++,c)return a-1}return-1},d=0,h=l();for(;h!==-1&&d<e.length;){let c=this._textModel.getDecorationRange(this._editorDecorationIds[h]);if(c){let u=c.startLineNumber;if(c.startColumn===Math.max(c.endColumn-1,1)&&this._textModel.getLineMaxColumn(u)===c.endColumn)for(;d<e.length;){let f=e.getStartLineNumber(d);if(u>=f)r(d,u===f),d++;else break}}h=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 Kie(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 Uu(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 T4(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 qie(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 Gie(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 A4(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 SI(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 yI(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)}function Zie(s,e){let t=null,i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){let n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function Yie(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{let i=t.parentIndex,n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<s)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Xie(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){let i=t.parentIndex,n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>s)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class Qie{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 S(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 S(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 oR(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,n=null,o=r=>((!n||!Jie(r,n))&&(n=oR(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 h=o(l.endLineNumber);h&&(l=l.setEndPosition(h,i.getLineMaxColumn(h)),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 Jie(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function oR(s,e){let t=FM(s,i=>e<i.startLineNumber)-1;return t>=0&&s[t].endLineNumber>=e?s[t]:null}const ene=5e3,tne="indent";class ine{constructor(e){this.editorModel=e,this.id=tne}dispose(){}compute(e){let t=Qe.getFoldingRules(this.editorModel.getLanguageId()),i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(sne(this.editorModel,i,n))}}let nne=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Qr||t>Qr)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 vp(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],h=e.getLineContent(d),c=ts.computeIndentLevel(h,n);(c<i||c===i&&t++<this._foldingRangesLimit)&&(o[l]=d,r[l]=this._endIndexes[a],l++)}return new vp(o,r)}}};function sne(s,e,t,i=ene){const n=s.getOptions().tabSize;let o=new nne(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 h=s.getLineContent(d),c=ts.computeIndentLevel(h,n),u=a[a.length-1];if(c===-1){e&&(u.endAbove=d);continue}let f;if(r&&(f=h.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,c),u.line=d,u.indent=c,u.endAbove=d;continue}}else{a.push({indent:-2,endAbove:d,line:d});continue}if(u.indent>c){do a.pop(),u=a[a.length-1];while(u.indent>c);let g=u.endAbove-1;g-d>=1&&o.insertFirst(d,g,c)}u.indent===c?u.endAbove=d:a.push({indent:c,endAbove:d,line:d})}return o.toIndentRanges(s)}const one=5e3,rne={},R4="syntax";class ane{constructor(e,t,i,n=one){this.editorModel=e,this.providers=t,this.limit=n,this.id=R4;for(const o of t)typeof o.onDidChange=="function"&&(this.disposables||(this.disposables=new X),this.disposables.add(o.onDidChange(i)))}compute(e){return lne(this.providers,this.editorModel,e).then(t=>t?M4(t,this.limit):null)}dispose(){var e;(e=this.disposables)===null||e===void 0||e.dispose()}}function lne(s,e,t){let i=null,n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,rne,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})}},Di));return Promise.all(n).then(o=>i)}class dne{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>Qr||t>Qr)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 vp(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 vp(i,n,o)}}}function M4(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 dne(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 O4="init";class hne{constructor(e,t,i,n){if(this.editorModel=e,this.id=O4,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(M4(t,Number.MAX_VALUE))}}const LI=Oi("folding-expanded",ie.chevronDown,p("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),DI=Oi("folding-collapsed",ie.chevronRight,p("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class Bs{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?Bs.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?Bs.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bs.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?Bs.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Bs.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}Bs.COLLAPSED_VISUAL_DECORATION=Ee.register({description:"folding-collapsed-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:kt.asClassName(DI)});Bs.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ee.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:kt.asClassName(DI)});Bs.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ee.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:kt.asClassName(LI)});Bs.EXPANDED_VISUAL_DECORATION=Ee.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+kt.asClassName(LI)});Bs.HIDDEN_RANGE_DECORATION=Ee.register({description:"folding-hidden-range-decoration",stickiness:1});var cne=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},une=function(s,e){return function(t,i){e(t,i,s)}};const fn=new re("foldingEnabled",!1);let Lu=class P4 extends H{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(37),this._useFoldingProviders=i.get(38)!=="indentation",this._unfoldOnClickAfterEndOfLine=i.get(41),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=i.get(40),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 Bs(e),this.foldingDecorationProvider.autoHideFoldingControls=i.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=i.get(39),this.foldingEnabled=fn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(n=>{if(n.hasChanged(37)&&(this._isEnabled=this.editor.getOptions().get(37),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),n.hasChanged(98)||n.hasChanged(39)){const o=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls=o.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=o.get(39),this.onModelContentChanged()}n.hasChanged(38)&&(this._useFoldingProviders=this.editor.getOptions().get(38)!=="indentation",this.onFoldingStrategyChanged()),n.hasChanged(41)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(41)),n.hasChanged(40)&&(this._foldingImportsByDefault=this.editor.getOptions().get(40))})),this.onModelChanged()}static get(e){return e.getContribution(P4.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,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel||!e||e.lineCount!==t.getLineCount()||(this._currentModelHasFoldedImports=!!e.foldedImports,!e.collapsedRegions))return;(e.provider===R4||e.provider===O4)&&(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,Le)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new jie(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new Qie(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new ca(200),this.cursorChangedScheduler=new Lt(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(J1.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 ine(e),this._useFoldingProviders&&this.foldingModel){let t=J1.ordered(this.foldingModel.textModel);if(t.length===0&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions)return this.rangeProvider=new hne(e,this.foldingStateMemento.collapsedRegions,()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()},3e4);t.length>0&&(this.rangeProvider=new ane(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;const t=this.getRangeProvider(e.textModel);let i=this.foldingRegionPromise=gi(n=>t.compute(n));return i.then(n=>{if(n&&i===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const l=n.setCollapsedAllOfType(vo.Imports.value,!0);l&&(o=gl.capture(this.editor),this._currentModelHasFoldedImports=l)}let r=this.editor.getSelections(),a=r?r.map(l=>l.startLineNumber):[];e.update(n,a),o&&o.restore(this.editor)}return e})}).then(void 0,e=>(Le(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,Le)}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,h=[];if(d){let c=f=>!f.containedBy(a)&&!a.containedBy(f),u=r.getRegionsInside(null,c);for(const f of u)f.isCollapsed&&h.push(f);h.length===0&&(h=u)}else{let c=e.event.middleButton||e.event.shiftKey;if(c)for(const u of r.getRegionsInside(a))u.isCollapsed===l&&h.push(u);(l||!c||h.length===0)&&h.push(a)}r.toggleCollapseState(h),this.reveal({lineNumber:i,column:1})}}}}).then(void 0,Le)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Lu.ID="editor.contrib.folding";Lu=cne([une(1,ve)],Lu);class wn extends oe{runEditorCommand(e,t,i){let n=Lu.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 F4(s){if(!sn(s)){if(!bn(s))return!1;const e=s;if(!sn(e.levels)&&!Wd(e.levels)||!sn(e.direction)&&!Gs(e.direction)||!sn(e.selectionLines)&&(!hM(e.selectionLines)||!e.selectionLines.every(Wd)))return!1}return!0}class fne extends wn{constructor(){super({id:"editor.unfold",label:p("unfoldAction.label","Unfold"),alias:"Unfold",precondition:fn,kbOpts:{kbExpr:E.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:
  643. * 'levels': Number of levels to unfold. If not set, defaults to 1.
  644. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
  645. * '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.
  646. `,constraint:F4,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"?T4(t,!1,o,r):Uu(t,!1,o,r)}}class gne extends wn{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2137),weight:100}})}invoke(e,t,i,n){Uu(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class pne extends wn{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:fn,kbOpts:{kbExpr:E.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:
  647. * 'levels': Number of levels to fold.
  648. * 'direction': If 'up', folds given number of levels up otherwise folds down.
  649. * '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.
  650. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
  651. `,constraint:F4,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"?qie(t,!0,o):a==="up"?T4(t,!0,r||1,o):Uu(t,!0,r||1,o)}}class mne extends wn{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2090),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);Kie(t,1,n)}}class _ne extends wn{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2135),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);Uu(t,!0,Number.MAX_VALUE,n)}}class bne extends wn{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())yI(t,vo.Comment.value,!0);else{const n=i.getModel();if(!n)return;const o=Qe.getComments(n.getLanguageId());if(o&&o.blockCommentStartToken){let r=new RegExp("^\\s*"+Ks(o.blockCommentStartToken));SI(t,r,!0)}}}}class Cne extends wn{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())yI(t,vo.Region.value,!0);else{const n=i.getModel();if(!n)return;const o=Qe.getFoldingRules(n.getLanguageId());if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);SI(t,r,!0)}}}}class vne extends wn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())yI(t,vo.Region.value,!1);else{const n=i.getModel();if(!n)return;const o=Qe.getFoldingRules(n.getLanguageId());if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);SI(t,r,!1)}}}}class wne extends wn{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2131),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);A4(t,!0,n)}}class Sne extends wn{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2129),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);A4(t,!1,n)}}class yne extends wn{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2069),weight:100}})}invoke(e,t,i){Uu(t,!0)}}class Lne extends wn{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2088),weight:100}})}invoke(e,t,i){Uu(t,!1)}}class ah extends wn{getFoldingLevel(){return parseInt(this.id.substr(ah.ID_PREFIX.length))}invoke(e,t,i){Gie(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}ah.ID_PREFIX="editor.foldLevel";ah.ID=s=>ah.ID_PREFIX+s;class Dne extends wn{constructor(){super({id:"editor.gotoParentFold",label:p("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);if(n.length>0){let o=Zie(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class xne extends wn{constructor(){super({id:"editor.gotoPreviousFold",label:p("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);if(n.length>0){let o=Yie(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class kne extends wn{constructor(){super({id:"editor.gotoNextFold",label:p("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);if(n.length>0){let o=Xie(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}nt(Lu.ID,Lu);ee(fne);ee(gne);ee(pne);ee(_ne);ee(yne);ee(Lne);ee(bne);ee(Cne);ee(vne);ee(wne);ee(Sne);ee(mne);ee(Dne);ee(xne);ee(kne);for(let s=1;s<=7;s++)pO(new ah({id:ah.ID(s),label:p("foldLevelAction.label","Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:fn,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2048|21+s),weight:100}}));const Ine=R("editor.foldBackground",{light:wt(tl,.3),dark:wt(tl,.3),hc:null},p("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),Ene=R("editorGutter.foldingControlForeground",{dark:b0,light:b0,hc:b0},p("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));st((s,e)=>{const t=s.getColor(Ine);t&&e.addRule(`.monaco-editor .folded-background { background-color: ${t}; }`);const i=s.getColor(Ene);i&&e.addRule(`
  652. .monaco-editor .cldr${kt.asCSSSelector(LI)},
  653. .monaco-editor .cldr${kt.asCSSSelector(DI)} {
  654. color: ${i} !important;
  655. }
  656. `)});class Nne extends oe{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){fa.setZoomLevel(fa.getZoomLevel()+1)}}class Tne extends oe{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){fa.setZoomLevel(fa.getZoomLevel()-1)}}class Ane extends oe{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){fa.setZoomLevel(0)}}ee(Nne);ee(Tne);ee(Ane);var B4=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},W4=function(s,e){return function(t,i){e(t,i,s)}},xI=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let wp=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(xb.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){if(this._callOnModel.clear(),!this._editor.getOption(48)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=xb.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;let i=new bc;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||!this._editor.getSelection().isEmpty())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}});A2(this._workerService,t,i,e,t.getFormattingOptions()).then(r=>{o.dispose(),!n&&Tn(r)&&(fu.execute(this._editor,r,!0),Jk(r))},r=>{throw o.dispose(),r})}};wp.ID="editor.contrib.autoFormat";wp=B4([W4(1,Ys)],wp);let Sp=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(ao.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(47)&&this.editor.hasModel()&&ao.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(T2,this.editor,e,2,xh.None,Oe.None).catch(Le))}};Sp.ID="editor.contrib.formatOnPaste";Sp=B4([W4(1,Ge)],Sp);class Rne extends oe{constructor(){super({id:"editor.action.formatDocument",label:p("formatDocument.label","Format Document"),alias:"Format Document",precondition:te.and(E.notInCompositeEditor,E.writable,E.hasDocumentFormattingProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return xI(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(Ge);yield e.get(Ca).showWhile(i.invokeFunction(lY,t,1,xh.None,Oe.None),250)}})}}class Mne extends oe{constructor(){super({id:"editor.action.formatSelection",label:p("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:te.and(E.writable,E.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2084),weight:100},contextMenuOpts:{when:E.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return xI(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Ge),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new S(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Ca).showWhile(i.invokeFunction(T2,t,o,1,xh.None,Oe.None),250)})}}nt(wp.ID,wp);nt(Sp.ID,Sp);ee(Rne);ee(Mne);$e.registerCommand("editor.action.format",s=>xI(void 0,void 0,void 0,function*(){const e=s.get(tt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(Yt);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));class kc{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 rR extends kc{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class One extends kc{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class nn extends kc{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=nn._requests.get(i);if(!n){let o=new ln;n={promiseCnt:0,source:o,promise:nn._create(e,o.token),model:void 0},nn._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(),nn._requests.delete(i))}),new Promise((o,r)=>{n.promise.then(a=>{n.model=a,o(a)},a=>{nn._requests.delete(i),r(a)})}))}static _create(e,t){const i=new ln(t),n=new nn(e.uri),o=Vs.ordered(e),r=o.map((l,d)=>{var h;let c=kc.findId(`provider_${d}`,n),u=new One(c,n,(h=l.displayName)!==null&&h!==void 0?h:"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(e,i.token)).then(f=>{for(const g of f||[])nn._makeOutlineElement(g,u);return u},f=>(Di(f),u)).then(f=>{kc.empty(f)?f.remove():n._groups.set(c,f)})}),a=Vs.onDidChange(()=>{const l=Vs.ordered(e);zs(l,o)||i.cancel()});return Promise.all(r).then(()=>i.token.isCancellationRequested&&!t.isCancellationRequested?nn._create(e,t):n._compact()).finally(()=>{a.dispose()})}static _makeOutlineElement(e,t){let i=kc.findId(e,t),n=new rR(i,t,e);if(e.children)for(const o of e.children)nn._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=Ue.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 rR?e.push(t.symbol):e.push(...Ue.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>S.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return nn._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>S.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&&nn._flattenDocumentSymbols(e,n.children,n.name)}}nn._requestDurations=new _b(Vs,350);nn._requests=new kl(9,.75);nn._keys=new class{constructor(){this._counter=1,this._data=new WeakMap}for(s,e){return`${s.id}/${e?s.getVersionId():""}/${this._hash(Vs.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 V4=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function aR(s,e,t){return V4(this,void 0,void 0,function*(){return(yield nn.create(s,t)).getTopLevelSymbols()})}$e.registerCommand("_executeDocumentSymbolProvider",function(s,...e){return V4(this,void 0,void 0,function*(){const[t]=e;ut(me.isUri(t));const i=s.get(ri).getModel(t);if(i)return aR(i,!1,Oe.None);const n=yield s.get(Qn).createModelReference(t);try{return yield aR(n.object.textEditorModel,!1,Oe.None)}finally{n.dispose()}})});function xn(s,e){let t=0;for(let i=0;i<s.length;i++)s.charAt(i)===" "?t+=e:t++;return t}function pg(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 H4(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return[];const n=Qe.getIndentationRules(s.getLanguageId());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,_)=>(_=_||1,$n.shiftIndent(m,m.length+_,o,r,a)),d=(m,_)=>(_=_||1,$n.unshiftIndent(m,m.length+_,o,r,a));let h=[],c,u=s.getLineContent(e),f=u;c=ht(u);let g=c;n.increaseIndentPattern&&n.increaseIndentPattern.test(f)?(g=l(g),c=l(c)):n.indentNextLinePattern&&n.indentNextLinePattern.test(f)&&(g=l(g)),e++;for(let m=e;m<=t;m++){let _=s.getLineContent(m),C=ht(_),b=g+_.substring(C.length);n.decreaseIndentPattern&&n.decreaseIndentPattern.test(b)&&(g=d(g),c=d(c)),C!==g&&h.push(Ut.replaceMove(new ne(m,1,m,C.length+1),ts.normalizeIndentation(g,r,a))),!(n.unIndentedLinePattern&&n.unIndentedLinePattern.test(_))&&(n.increaseIndentPattern&&n.increaseIndentPattern.test(b)?(c=l(c),g=c):n.indentNextLinePattern&&n.indentNextLinePattern.test(b)?g=l(g):g=c)}return h}class Cw extends oe{constructor(){super({id:Cw.ID,label:p("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:E.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new Wne(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}Cw.ID="editor.action.indentationToSpaces";class vw extends oe{constructor(){super({id:vw.ID,label:p("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:E.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new Vne(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}vw.ID="editor.action.indentationToTabs";class z4 extends oe{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const i=e.get(Rl),n=e.get(ri);let o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),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({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"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 ww extends z4{constructor(){super(!1,{id:ww.ID,label:p("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}ww.ID="editor.action.indentUsingTabs";class Sw extends z4{constructor(){super(!0,{id:Sw.ID,label:p("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}Sw.ID="editor.action.indentUsingSpaces";class yw extends oe{constructor(){super({id:yw.ID,label:p("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(ri);let n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}yw.ID="editor.action.detectIndentation";class Pne extends oe{constructor(){super({id:"editor.action.reindentlines",label:p("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:E.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=H4(i,1,i.getLineCount());n.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,n),t.pushUndoStop())}}class Fne extends oe{constructor(){super({id:"editor.action.reindentselectedlines",label:p("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:E.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=H4(i,a,l);o.push(...d)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Bne{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(S.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 ID{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(47))&&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=>$n.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>$n.unshiftIndent(f,f.length+1,o,r,a)},h=e.startLineNumber;for(;h<=e.endLineNumber;){if(this.shouldIgnoreLine(i,h)){h++;continue}break}if(h>e.endLineNumber)return;let c=i.getLineContent(h);if(!/\S/.test(c.substring(0,e.startColumn-1))){const f=Qe.getGoodIndentForLine(n,i,i.getLanguageId(),h,d);if(f!==null){let g=ht(c),m=xn(f,o),_=xn(g,o);if(m!==_){let C=pg(m,o,a);l.push({range:new S(h,1,h,g.length+1),text:C}),c=C+c.substr(g.length)}else{let C=Qe.getIndentMetadata(i,h);if(C===0||C===8)return}}}const u=h;for(;h<e.endLineNumber;){if(!/\S/.test(i.getLineContent(h+1))){h++;continue}break}if(h!==e.endLineNumber){let f={getLineTokens:m=>i.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,_)=>i.getLanguageIdAtPosition(m,_),getLineContent:m=>m===u?c:i.getLineContent(m)},g=Qe.getGoodIndentForLine(n,f,i.getLanguageId(),h+1,d);if(g!==null){let m=xn(g,o),_=xn(ht(i.getLineContent(h+1)),o);if(m!==_){let C=m-_;for(let b=h+1;b<=e.endLineNumber;b++){let v=i.getLineContent(b),w=ht(v),k=xn(w,o)+C,L=pg(k,o,a);L!==w&&l.push({range:new S(b,1,b,w.length+1),text:L})}}}}if(l.length>0){this.editor.pushUndoStop();let f=new Bne(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()}}ID.ID="editor.contrib.autoIndentOnPaste";function U4(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 S(r,1,r,l),h=s.getValueInRange(d),c=i?h.replace(/\t/ig,n):h.replace(o," ");e.addEditOperation(d,c)}}class Wne{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),U4(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class Vne{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),U4(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}nt(ID.ID,ID);ee(Cw);ee(vw);ee(ww);ee(Sw);ee(yw);ee(Pne);ee(Fne);var Hne=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},zne=function(s,e){return function(t,i){e(t,i,s)}},BC=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const Une=1500;class $4{constructor(){this._data=new Zi}push(e,t){const i=this._data.get(e.uri);i===void 0?this._data.set(e.uri,new Set([t])):i.add(t)}pop(e,t){const i=this._data.get(e.uri);i&&(i.delete(t),i.size===0&&this._data.delete(e.uri))}has(e,t){var i;return!!(!((i=this._data.get(e.uri))===null||i===void 0)&&i.has(t))}}function j4(s,e,t,i){return BC(this,void 0,void 0,function*(){const n=[],r=za.ordered(s).reverse().map(a=>e.map(l=>BC(this,void 0,void 0,function*(){try{t.push(s,a);const d=yield a.provideInlayHints(s,l,i);d!=null&&d.length&&n.push(d.filter(h=>l.containsPosition(h.position)))}catch(d){Di(d)}finally{t.pop(s,a)}})));return yield Promise.all(r.flat()),n.flat().sort((a,l)=>F.compare(a.position,l.position))})}class WC{constructor(){this._entries=new kl(50)}get(e){const t=WC._key(e);return this._entries.get(t)}set(e,t){const i=WC._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}let Du=class K4{constructor(e,t){this._editor=e,this._codeEditorService=t,this._decorationOwnerId=++K4._decorationOwnerIdPool,this._disposables=new X,this._sessionDisposables=new X,this._getInlayHintsDelays=new _b(za,25,500),this._cache=new WC,this._decorations=new Map,this._disposables.add(za.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(i=>{i.hasChanged(125)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){if(this._sessionDisposables.clear(),this._removeAllDecorations(),!this._editor.getOption(125).enabled)return;const e=this._editor.getModel();if(!e||!za.has(e))return;const t=this._cache.get(e);t&&this._updateHintsDecorators([e.getFullModelRange()],t);const i=new $4,n=new Lt(()=>BC(this,void 0,void 0,function*(){const r=Date.now(),a=new ln;this._sessionDisposables.add(Ve(()=>a.dispose(!0)));const l=this._getHintsRanges(),d=yield j4(e,l,i,a.token);n.delay=this._getInlayHintsDelays.update(e,Date.now()-r),!a.token.isCancellationRequested&&(this._updateHintsDecorators(l,d),this._cache.set(e,Array.from(this._decorations.values()).map(h=>h.hint)))}),this._getInlayHintsDelays.get(e));this._sessionDisposables.add(n),this._sessionDisposables.add(this._editor.onDidChangeModelContent(()=>n.schedule())),this._disposables.add(this._editor.onDidScrollChange(()=>n.schedule())),n.schedule();const o=new X;this._sessionDisposables.add(o);for(const r of za.all(e))typeof r.onDidChangeInlayHints=="function"&&o.add(r.onDidChangeInlayHints(()=>{i.has(e,r)||n.schedule()}))}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const o of i.sort(S.compareRangesUsingStarts)){const r=t.validateRange(new S(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!S.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=S.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const{fontSize:i,fontFamily:n}=this._getLayoutInfo(),o=this._editor.getModel(),r=[],a=[],l="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(l,n);for(const c of t){const{text:u,position:f,whitespaceBefore:g,whitespaceAfter:m}=c,_=g?i/3|0:0,C=m?i/3|0:0,b={contentText:$ne(u),fontSize:`${i}px`,margin:`0px ${C}px 0px ${_}px`,fontFamily:`var(${l}), ${Hi.fontFamily}`,padding:`1px ${Math.max(1,i/4)|0}px`,borderRadius:`${i/4|0}px`,verticalAlign:"middle",backgroundColor:$t(Id),color:$t(kd)};c.kind===Cb.Parameter?(b.backgroundColor=$t(R9),b.color=$t(A9)):c.kind===Cb.Type&&(b.backgroundColor=$t(T9),b.color=$t(N9));let v={beforeInjectedText:Object.assign(Object.assign({},b),{affectsLetterSpacing:!0})},w=S.fromPositions(f),y=o.getWordAtPosition(f),k=!1;y&&(y.endColumn===f.column?(v.afterInjectedText=v.beforeInjectedText,v.beforeInjectedText=void 0,k=!0,w=lR(y,f.lineNumber)):y.startColumn===f.column&&(k=!0,w=lR(y,f.lineNumber)));const L="inlayHints-"+ax(v).toString(16);if(this._codeEditorService.registerDecorationType("inlay-hints-controller",L,v,void 0,this._editor),r.push(L),a.push({range:w,options:Object.assign(Object.assign({},this._codeEditorService.resolveDecorationOptions(L,!0)),{showIfCollapsed:!k,stickiness:0})})>Une)break}const d=[];for(const c of e)for(const{id:u}of o.getDecorationsInRange(c,this._decorationOwnerId,!0)){const f=this._decorations.get(u);f&&(d.push(u),this._codeEditorService.removeDecorationType(f.decorationTypeId),this._decorations.delete(u))}const h=o.deltaDecorations(d,a,this._decorationOwnerId);for(let c=0;c<h.length;c++)this._decorations.set(h[c],{hint:t[c],decorationTypeId:r[c]})}_getLayoutInfo(){const e=this._editor.getOption(125),t=this._editor.getOption(45);let i=e.fontSize;(!i||i<5||i>t)&&(i=t*.9|0);const n=e.fontFamily||this._editor.getOption(42);return{fontSize:i,fontFamily:n}}_removeAllDecorations(){this._editor.deltaDecorations(Array.from(this._decorations.keys()),[]);for(let e of this._decorations.values())this._codeEditorService.removeDecorationType(e.decorationTypeId);this._decorations.clear()}};Du.ID="editor.contrib.InlayHints";Du._decorationOwnerIdPool=0;Du=Hne([zne(1,tt)],Du);function lR(s,e){return new S(e,s.startColumn,e,s.endColumn)}function $ne(s){return s.replace(/[ \t]/g," ")}nt(Du.ID,Du);$e.registerCommand("_executeInlayHintProvider",(s,...e)=>BC(void 0,void 0,void 0,function*(){const[t,i]=e;ut(me.isUri(t)),ut(S.isIRange(i));const n=yield s.get(Qn).createModelReference(t);try{return yield j4(n.object.textEditorModel,[S.lift(i)],new $4,Oe.None)}finally{n.dispose()}}));class jne{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 ne(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new ne(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var Kne=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},qne=function(s,e){return function(t,i){e(t,i,s)}};let Dl=class ED{constructor(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}static get(e){return e.getContribution(ED.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 wP(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=gi(l=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!r.validate(this.editor))return;let d=S.lift(l.range),h=l.range,c=l.value.length-(o.endColumn-o.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+l.value.length},c>1&&(o=new ne(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+c-1));const u=new jne(d,o,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[{range:h,options:ED.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=rl(350),this.decorationRemover.then(()=>this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[])).catch(Le)}).catch(Le)):Promise.resolve(void 0)}};Dl.ID="editor.contrib.inPlaceReplaceController";Dl.DECORATION=Ee.register({description:"in-place-replace",className:"valueSetReplacement"});Dl=Kne([qne(1,Ys)],Dl);class Gne extends oe{constructor(){super({id:"editor.action.inPlaceReplace.up",label:p("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:3154,weight:100}})}run(e,t){const i=Dl.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}class Zne extends oe{constructor(){super({id:"editor.action.inPlaceReplace.down",label:p("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:3156,weight:100}})}run(e,t){const i=Dl.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}nt(Dl.ID,Dl);ee(Gne);ee(Zne);st((s,e)=>{const t=s.getColor(YO);t&&e.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${t}; }`)});class Yne{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){let i=Xne(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 Xne(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,h=0;if(n<o&&e[n].lineNumber===r&&(h=e[n].column,n++,h===d)||l.length===0)continue;let c=sr(l),u=0;if(c===-1)u=1;else if(c!==l.length-1)u=c+2;else continue;u=Math.max(h,u),t[i++]=Ut.delete(new S(r,u,r,d))}return t}class q4{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(`
  657. `);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new S(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
  658. `):this._isCopyingDown?t.addEditOperation(new S(i.startLineNumber,1,i.startLineNumber,1),o+`
  659. `):t.addEditOperation(new S(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
  660. `+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=ne.createWithDirection(n,o,r,a,this._selectionDirection)}return i}}class Qne{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:h=>e.getLineTokens(h),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(h,c)=>e.getLanguageIdAtPosition(h,c),getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){let h=n.startLineNumber,c=this._isMovingDown?h+1:h-1;e.getLineMaxColumn(c)===1?t.addEditOperation(new S(1,1,1,1),null):(t.addEditOperation(new S(h,1,h,1),e.getLineContent(c)),t.addEditOperation(new S(c,1,c,e.getLineMaxColumn(c)),null)),n=new ne(c,1,c,1)}else{let h,c;if(this._isMovingDown){h=n.endLineNumber+1,c=e.getLineContent(h),t.addEditOperation(new S(h-1,e.getLineMaxColumn(h-1),h,e.getLineMaxColumn(h)),null);let u=c;if(this.shouldAutoIndent(e,n)){let f=this.matchEnterRule(e,l,o,h,n.startLineNumber-1);if(f!==null){let m=ht(e.getLineContent(h)),_=f+xn(m,o);u=pg(_,o,a)+this.trimLeft(c)}else{d.getLineContent=_=>_===n.startLineNumber?e.getLineContent(h):e.getLineContent(_);let m=Qe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(h,1),n.startLineNumber,l);if(m!==null){let _=ht(e.getLineContent(h)),C=xn(m,o),b=xn(_,o);C!==b&&(u=pg(C,o,a)+this.trimLeft(c))}}t.addEditOperation(new S(n.startLineNumber,1,n.startLineNumber,1),u+`
  661. `);let g=this.matchEnterRuleMovingDown(e,l,o,n.startLineNumber,h,u);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,g);else{d.getLineContent=_=>_===n.startLineNumber?u:_>=n.startLineNumber+1&&_<=n.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);let m=Qe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(h,1),n.startLineNumber+1,l);if(m!==null){const _=ht(e.getLineContent(n.startLineNumber)),C=xn(m,o),b=xn(_,o);if(C!==b){const v=C-b;this.getIndentEditsOfMovingBlock(e,t,n,o,a,v)}}}}else t.addEditOperation(new S(n.startLineNumber,1,n.startLineNumber,1),u+`
  662. `)}else if(h=n.startLineNumber-1,c=e.getLineContent(h),t.addEditOperation(new S(h,1,h+1,1),null),t.addEditOperation(new S(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),`
  663. `+c),this.shouldAutoIndent(e,n)){d.getLineContent=f=>f===h?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=Qe.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(n.startLineNumber,1),h,l);if(f!==null){let g=ht(e.getLineContent(n.startLineNumber)),m=xn(f,o),_=xn(g,o);if(m!==_){let C=m-_;this.getIndentEditsOfMovingBlock(e,t,n,o,a,C)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>$n.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>$n.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===Gt.None||o.indentAction===Gt.Indent?r=o.indentation+o.appendText:o.indentAction===Gt.IndentOutdent?r=o.indentation:o.indentAction===Gt.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);let a=e.getLineContent(n);if(this.trimLeft(a).indexOf(this.trimLeft(r))>=0){let l=ht(e.getLineContent(n)),d=ht(r),h=Qe.getIndentMetadata(e,n);h!==null&&h&2&&(d=t.unshiftIndent(d));let c=xn(d,i),u=xn(l,i);return c-u}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(sr(r)>=0){let a=e.getLineMaxColumn(o),l=Qe.getEnterAction(this._autoIndent,e,new S(o,a,o,a));return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){let h=e.getLineContent(a);if(sr(h)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=Qe.getEnterAction(this._autoIndent,e,new S(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 h;if(a===o&&r!==void 0?h=r:h=e.getLineContent(a),sr(h)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=Qe.getEnterAction(this._autoIndent,e,new S(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||Qe.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=ht(l),c=xn(d,n)+r,u=pg(c,n,o);u!==d&&(t.addEditOperation(new S(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 sl{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return sl._COLLATOR||(sl._COLLATOR=new Intl.Collator),sl._COLLATOR}getEditOperations(e,t){let i=Jne(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=G4(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}}sl._COLLATOR=null;function G4(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(sl.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function Jne(s,e,t){let i=G4(s,e,t);return i?Ut.replace(new S(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(`
  664. `)):null}class Z4 extends oe{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)=>S.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 q4(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class ese extends Z4{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:p("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class tse extends Z4{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:p("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class ise extends oe{constructor(){super({id:"editor.action.duplicateSelection",label:p("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:E.writable,menuOpts:{menuId:ae.MenubarSelectionMenu,group:"2_line",title:p({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&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 q4(a,!0));else{const l=new ne(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new Fz(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Y4 extends oe{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 Qne(r,this.down,o));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class nse extends Y4{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:p("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class sse extends Y4{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:p("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class X4 extends oe{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!sl.canRun(t.getModel(),o,this.descending))return;let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=new sl(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class ose extends X4{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:p("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:E.writable})}}class rse extends X4{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:p("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:E.writable})}}class ase extends oe{constructor(){super({id:"editor.action.removeDuplicateLines",label:p("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:E.writable})}run(e,t){if(!t.hasModel())return;let i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let n=[],o=[],r=0;for(let a of t.getSelections()){let l=new Set,d=[];for(let f=a.startLineNumber;f<=a.endLineNumber;f++){let g=i.getLineContent(f);l.has(g)||(d.push(g),l.add(g))}let h=new ne(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),c=a.startLineNumber-r,u=new ne(c,1,c+d.length-1,d[d.length-1].length);n.push(Ut.replace(h,d.join(`
  665. `))),o.push(u),r+=a.endLineNumber-a.startLineNumber+1-d.length}t.pushUndoStop(),t.executeEdits(this.id,n,o),t.pushUndoStop()}}class Lw extends oe{constructor(){super({id:Lw.ID,label:p("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:mi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new F(a.positionLineNumber,a.positionColumn)));let o=t.getSelection();if(o===null)return;let r=new Yne(o,n);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}Lw.ID="editor.action.trimTrailingWhitespace";class lse extends oe{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:E.writable,kbOpts:{kbExpr:E.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 h=i[l];let c=h.startLineNumber,u=h.endLineNumber,f=1,g=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,g=1):c>1&&(c-=1,f=n.getLineMaxColumn(c)),r.push(Ut.replace(new ne(c,f,u,g),"")),a.push(new ne(c-o,h.positionColumn,c-o,h.positionColumn)),o+=h.endLineNumber-h.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 dse extends oe{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,It.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class hse extends oe{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2135,weight:100}})}run(e,t){zc.Outdent.runEditorCommand(e,t,null)}}class cse extends oe{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,It.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class use extends oe{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,It.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Q4 extends oe{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 h=n[l],c=n[l+1];S.intersectRanges(h,c)===null?o.push(h):n[l+1]=S.plusRange(h,c)}o.push(n[n.length-1]);let r=this._getEndCursorState(i,o),a=o.map(l=>Ut.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class fse extends Q4{constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:E.writable,kbOpts:{kbExpr:E.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 ne(l,r.startColumn,l,r.startColumn)}else a=new ne(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(S.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 S(r,a,o.startLineNumber,1)}else return new S(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new S(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class gse extends Q4{constructor(){super({id:"deleteAllRight",label:p("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:E.writable,kbOpts:{kbExpr:E.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 ne(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 S(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new S(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(S.compareRangesUsingStarts),n}}class pse extends oe{constructor(){super({id:"editor.action.joinLines",label:p("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:E.writable,kbOpts:{kbExpr:E.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(S.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 ne(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new ne(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);let a=t.getModel();if(a===null)return;let l=[],d=[],h=n,c=0;for(let u=0,f=o.length;u<f;u++){let g=o[u],m=g.startLineNumber,_=1,C=0,b,v,w=a.getLineContent(g.endLineNumber).length-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){let L=g.getStartPosition();L.lineNumber<a.getLineCount()?(b=m+1,v=a.getLineMaxColumn(b)):(b=L.lineNumber,v=a.getLineMaxColumn(L.lineNumber))}else b=g.endLineNumber,v=a.getLineMaxColumn(b);let y=a.getLineContent(m);for(let L=m+1;L<=b;L++){let D=a.getLineContent(L),N=a.getLineFirstNonWhitespaceColumn(L);if(N>=1){let B=!0;y===""&&(B=!1),B&&(y.charAt(y.length-1)===" "||y.charAt(y.length-1)===" ")&&(B=!1,y=y.replace(/[\s\uFEFF\xA0]+$/g," "));let O=D.substr(N-1);y+=(B?" ":"")+O,B?C=O.length+1:C=O.length}else C=0}let k=new S(m,_,b,v);if(!k.isEmpty()){let L;g.isEmpty()?(l.push(Ut.replace(k,y)),L=new ne(k.startLineNumber-c,y.length-C+1,m-c,y.length-C+1)):g.startLineNumber===g.endLineNumber?(l.push(Ut.replace(k,y)),L=new ne(g.startLineNumber-c,g.startColumn,g.endLineNumber-c,g.endColumn)):(l.push(Ut.replace(k,y)),L=new ne(g.startLineNumber-c,g.startColumn,g.startLineNumber-c,y.length-w)),S.intersectRanges(k,n)!==null?h=L:d.push(L)}c+=k.endLineNumber-k.startLineNumber}d.unshift(h),t.pushUndoStop(),t.executeEdits(this.id,l,d),t.pushUndoStop()}}class mse extends oe{constructor(){super({id:"editor.action.transpose",label:p("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:E.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(),h=n.getLineMaxColumn(d.lineNumber);if(d.column>=h){if(d.lineNumber===n.getLineCount())continue;let c=new S(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),u=n.getValueInRange(c).split("").reverse().join("");o.push(new xi(new ne(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),u))}else{let c=new S(d.lineNumber,Math.max(1,d.column-1),d.lineNumber,d.column+1),u=n.getValueInRange(c).split("").reverse().join("");o.push(new lk(c,u,new ne(d.lineNumber,d.column+1,d.lineNumber,d.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Dw extends oe{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=t.getOption(115),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),d=t.getConfiguredWordAtPosition(l);if(!d)continue;const h=new S(l.lineNumber,d.startColumn,l.lineNumber,d.endColumn),c=n.getValueInRange(h);r.push(Ut.replace(h,this._modifyText(c,o)))}else{const l=n.getValueInRange(a);r.push(Ut.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class _se extends Dw{constructor(){super({id:"editor.action.transformToUppercase",label:p("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:E.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class bse extends Dw{constructor(){super({id:"editor.action.transformToLowercase",label:p("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:E.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class kI{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 yp extends Dw{constructor(){super({id:"editor.action.transformToTitlecase",label:p("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:E.writable})}_modifyText(e,t){const i=yp.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}}yp.titleBoundary=new kI("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class ol extends Dw{constructor(){super({id:"editor.action.transformToSnakecase",label:p("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:E.writable})}_modifyText(e,t){const i=ol.caseBoundary.get(),n=ol.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}ol.caseBoundary=new kI("(\\p{Ll})(\\p{Lu})","gmu");ol.singleLetters=new kI("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");ee(ese);ee(tse);ee(ise);ee(nse);ee(sse);ee(ose);ee(rse);ee(ase);ee(Lw);ee(lse);ee(dse);ee(hse);ee(cse);ee(use);ee(fse);ee(gse);ee(pse);ee(mse);ee(_se);ee(bse);ol.caseBoundary.isSupported()&&ol.singleLetters.isSupported()&&ee(ol);yp.titleBoundary.isSupported()&&ee(yp);var Cse=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},vse=function(s,e){return function(t,i){e(t,i,s)}},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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const J4=new re("LinkedEditingInputVisible",!1),eB="linked-editing-decoration";let xl=class TD extends H{constructor(e,t){super(),this._debounceDuration=200,this._localToDispose=this._register(new X),this._editor=e,this._enabled=!1,this._visibleContextKey=J4.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(61)||i.hasChanged(81))&&this.reinitialize(!1)})),this._register(Sb.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}static get(e){return e.getContribution(TD.ID)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(61)||this._editor.getOption(81))&&Sb.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._languageWordPattern=Qe.getWordDefinition(t.getLanguageId()),this._localToDispose.add(t.onDidChangeLanguageConfiguration(()=>{this._languageWordPattern=Qe.getWordDefinition(t.getLanguageId())}));const n=new ca(this._debounceDuration),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration)},r=new ca(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(h=>d.intersectRanges(h.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),h=n,c=l.startColumn,u=l.endColumn;const f=Zc(d,h);c+=f,d=d.substr(f),h=h.substr(f);const g=fb(d,h);u-=g,d=d.substr(0,d.length-g),h=h.substr(0,h.length-g),(c!==u||h.length!==0)&&o.push({range:new S(l.startLineNumber,c,l.endLineNumber,u),text:h})}}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 ND(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=gi(r=>ND(this,void 0,void 0,function*(){try{const a=yield tB(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 c=0,u=l.length;c<u;c++)if(S.containsPosition(l[c],t)){if(d=!0,c!==0){const f=l[c];l.splice(c,1),l.unshift(f)}break}if(!d){this.clearRanges();return}const h=l.map(c=>({range:c,options:TD.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,h)}catch(a){br(a)||Le(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};xl.ID="editor.contrib.linkedEditing";xl.DECORATION=Ee.register({description:"linked-editing",stickiness:0,className:eB});xl=Cse([vse(1,ve)],xl);class wse extends oe{constructor(){super({id:"editor.action.linkedEditing",label:p("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:te.and(E.writable,E.hasRenameProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(tt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return me.isUri(n)&&F.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))))},Le):super.runCommand(e,t)}run(e,t){const i=xl.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const Sse=Mi.bindToContribution(xl.get);J(new Sse({id:"cancelLinkedEditingInput",precondition:J4,handler:s=>s.clearRanges(),kbOpts:{kbExpr:E.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function tB(s,e,t){const i=Sb.ordered(s);return HR(i.map(n=>()=>ND(this,void 0,void 0,function*(){try{return yield n.provideLinkedEditingRanges(s,e,t)}catch(o){Di(o);return}})),n=>!!n&&Tn(n==null?void 0:n.ranges))}const yse=R("editor.linkedEditingBackground",{dark:W.fromHex("#f00").transparent(.3),light:W.fromHex("#f00").transparent(.3),hc:W.fromHex("#f00").transparent(.3)},p("editorLinkedEditingBackground","Background color when the editor auto renames on type."));st((s,e)=>{const t=s.getColor(yse);t&&e.addRule(`.monaco-editor .${eB} { background: ${t}; border-left-color: ${t}; }`)});vr("_executeLinkedEditingProvider",(s,e)=>tB(s,e,Oe.None));nt(xl.ID,xl);ee(wse);var iB=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class Lse{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 iB(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 VC{constructor(e){this._disposables=new X;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new Lse(r,n));t=VC._union(t,o),VD(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(S.areIntersectingOrTouching(l.range,d.range)){n++;continue}S.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 nB(s,e){const t=[],i=yg.ordered(s).reverse().map((n,o)=>Promise.resolve(n.provideLinks(s,e)).then(r=>{r&&(t[o]=[r,n])},Di));return Promise.all(i).then(()=>{const n=new VC(vh(t));return e.isCancellationRequested?(n.dispose(),new VC([])):n})}$e.registerCommand("_executeLinkProvider",(s,...e)=>iB(void 0,void 0,void 0,function*(){let[t,i]=e;ut(t instanceof me),typeof i!="number"&&(i=0);const n=s.get(ri).getModel(t);if(!n)return[];const o=yield nB(n,Oe.None);if(!o)return[];for(let a=0;a<Math.min(i,o.links.length);a++)yield o.links[a].resolve(Oe.None);const r=o.links.slice(0);return o.dispose(),r}));var Dse=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},dR=function(s,e){return function(t,i){e(t,i,s)}},xse=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};function kse(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?Me?p("links.navigate.kb.meta.mac","cmd + click"):p("links.navigate.kb.meta","ctrl + click"):Me?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 ma("",!0).appendMarkdown(`[${i}](${s.url.toString(!0).replace(/ /g,"%20")}${o}) (${n})`)}else return new ma().appendText(`${i} (${n})`)}const hR={general:Ee.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Ee.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Kc{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:Kc._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n=Object.assign({},i?hR.active:hR.general);return n.hoverMessage=kse(e,t),n}activate(e,t){e.changeDecorationOptions(this.decorationId,Kc._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Kc._getOptions(this.link,t,!1))}}let lh=class AD{constructor(e,t,i){this.listenersToRemove=new X,this.editor=e,this.openerService=t,this.notificationService=i;let n=new rF(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(62),this.listenersToRemove.add(e.onDidChangeConfiguration(o=>{const r=e.getOption(62);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(yg.onDidChange(o=>this.onModelModeChanged())),this.timeout=new hn,this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null,this.beginCompute()}static get(e){return e.getContribution(AD.ID)}onModelChanged(){this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.beginCompute()}onModelModeChanged(){this.stop(),this.beginCompute()}onChange(){this.timeout.setIfNotSet(()=>this.beginCompute(),AD.RECOMPUTE_TIME)}beginCompute(){return xse(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.enabled)return;const e=this.editor.getModel();if(yg.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=gi(t=>nB(e,t));try{this.activeLinksList=yield this.computePromise,this.updateDecorations(this.activeLinksList.links)}catch(t){Le(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(69)==="altKey";let i=[],n=Object.keys(this.currentOccurrences);for(let a=0,l=n.length;a<l;a++){let d=n[a],h=this.currentOccurrences[d];i.push(h.decorationId)}let o=[];if(e)for(const a of e)o.push(Kc.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 Kc(e[a],r[a]);this.currentOccurrences[d.decorationId]=d}}_onEditorMouseMove(e,t){const i=this.editor.getOption(69)==="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(69)==="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(Oe.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Te.file&&o.startsWith(`${Te.file}:`)){const a=me.parse(o);if(a.scheme===Te.file){const l=w_(a);let d=null;l.startsWith("/./")?d=`.${l.substr(1)}`:l.startsWith("//./")&&(d=`.${l.substr(2)}`),d&&(o=tW(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.")):Le(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()}};lh.ID="editor.linkDetector";lh.RECOMPUTE_TIME=1e3;lh=Dse([dR(1,Co),dR(2,ni)],lh);class Ise extends oe{constructor(){super({id:"editor.action.openLink",label:p("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){let i=lh.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)}}}nt(lh.ID,lh);ee(Ise);st((s,e)=>{const t=s.getColor(ik);t&&e.addRule(`.monaco-editor .detected-link-active { color: ${t} !important; }`)});function $u(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);$b(n)}}class Ese extends oe{constructor(){super({id:"editor.action.insertCursorAbove",label:p("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Ci.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),$u(r,o.getCursorStates())}}class Nse extends oe{constructor(){super({id:"editor.action.insertCursorBelow",label:p("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Ci.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),$u(r,o.getCursorStates())}}class Tse extends oe{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:E.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"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 ne(n,o,n,o))}e.endColumn>1&&i.push(new ne(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),$u(r,o.getCursorStates())}}class Ase extends oe{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 ne(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),$u(a,r.getCursorStates())}}class Rse extends oe{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 ne(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),$u(r,o.getCursorStates())}}class g_{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Lp{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 Lp(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,h=null;if(l.isEmpty()){const c=e.getConfiguredWordAtPosition(l.getStartPosition());if(!c)return null;d=c.word,h=new ne(l.startLineNumber,c.startColumn,l.startLineNumber,c.endColumn)}else d=e.getModel().getValueInRange(l).replace(/\r\n/g,`
  666. `);return new Lp(e,t,n,d,o,r,h)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new g_(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 g_(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(115):null,!1);return i?new ne(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 g_(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 g_(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(115):null,!1);return i?new ne(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(115):null,!1,1073741824)):[]}}class dh extends H{constructor(e){super(),this._sessionDispose=this._register(new X),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(dh.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Lp.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 ne(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(!sB(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(115):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 ne(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}dh.ID="editor.contrib.multiCursorController";class ju extends oe{run(e,t){const i=dh.get(t);if(!i)return;const n=ns.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates();this._run(i,n),$u(r,o.getCursorStates())}}}class Mse extends ju{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:E.focus,primary:2082,weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class Ose extends ju{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:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class Pse extends ju{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:E.focus,primary:mi(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class Fse extends ju{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 Bse extends ju{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:E.focus,primary:3114,weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"3_multi",title:p({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class Wse extends ju{constructor(){super({id:"editor.action.changeAll",label:p("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:te.and(E.writable,E.editorTextFocus),kbOpts:{kbExpr:E.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class cR{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 da extends H{constructor(e){super(),this.editor=e,this._isEnabled=e.getOption(96),this.decorations=[],this.updateSoon=this._register(new Lt(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(96)})),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(ns.get(e).getState().onFindReplaceStateChange(t=>{this._update()}))}_update(){this._setState(da._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=dh.get(t);if(!n)return null;const o=ns.get(t);if(!o)return null;let r=n.getSession(o);if(!r){const d=t.getSelections();if(d.length>1){const c=o.getState().matchCase;if(!sB(t.getModel(),d,c))return null}r=Lp.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 h=r.searchText;if(l||(h=h.toLowerCase()),d===h&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new cR(r.searchText,r.matchCase,r.wholeWord?t.getOption(115):null,t.getModel().getVersionId())}_setState(e){if(cR.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=Xc.has(t)&&this.editor.getOption(71);let n=t.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(l=>l.range);n.sort(S.compareRangesUsingStarts);let o=this.editor.getSelections();o.sort(S.compareRangesUsingStarts);let r=[];for(let l=0,d=0,h=n.length,c=o.length;l<h;){const u=n[l];if(d>=c)r.push(u),l++;else{const f=S.compareRangesUsingStarts(u,o[d]);f<0?((o[d].isEmpty()||!S.areIntersecting(u,o[d]))&&r.push(u),l++):(f>0||l++,d++)}}const a=r.map(l=>({range:l,options:i?da._SELECTION_HIGHLIGHT:da._SELECTION_HIGHLIGHT_OVERVIEW}));this.decorations=this.editor.deltaDecorations(this.decorations,a)}dispose(){this._setState(null),super.dispose()}}da.ID="editor.contrib.selectionHighlighter";da._SELECTION_HIGHLIGHT_OVERVIEW=Ee.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",minimap:{color:$t(Dv),position:fs.Inline},overviewRuler:{color:$t(zO),position:Xn.Center}});da._SELECTION_HIGHLIGHT=Ee.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});function sB(s,e,t){const i=uR(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=uR(s,r,!t);if(i!==a)return!1}return!0}function uR(s,e,t){const i=s.getValueInRange(e);return t?i.toLowerCase():i}nt(dh.ID,dh);nt(da.ID,da);ee(Ese);ee(Nse);ee(Tse);ee(Mse);ee(Ose);ee(Pse);ee(Fse);ee(Bse);ee(Wse);ee(Ase);ee(Rse);var oB=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const hh={Visible:new re("parameterHintsVisible",!1),MultipleSignatures:new re("parameterHintsMultipleSignatures",!1)};function rB(s,e,t,i){return oB(this,void 0,void 0,function*(){const n=yd.ordered(s);for(const o of n)try{const r=yield o.provideSignatureHelp(s,e,i,t);if(r)return r}catch(r){Di(r)}})}$e.registerCommand("_executeSignatureHelpProvider",(s,...e)=>oB(void 0,void 0,void 0,function*(){const[t,i,n]=e;ut(me.isUri(t)),ut(F.isIPosition(i)),ut(typeof n=="string"||!n);const o=yield s.get(Qn).createModelReference(t);try{const r=yield rB(o.object.textEditorModel,F.lift(i),{triggerKind:rr.Invoke,isRetrigger:!1,triggerCharacter:n},Oe.None);return r?(setTimeout(()=>r.dispose(),0),r.value):void 0}finally{o.dispose()}}));var Vse=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},Pa;(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})(Pa||(Pa={}));class xw extends H{constructor(e,t=xw.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new M),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Pa.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new dn),this.triggerChars=new bc,this.retriggerChars=new bc,this.triggerId=0,this.editor=e,this.throttledDelayer=new ca(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(yd.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=Pa.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!yd.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(Le)}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(75).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(75).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 Pa.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return Vse(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(Hse);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 Pa.Pending(gi(l=>rB(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 Pa.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Pa.Default),Le(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 bc,this.retriggerChars=new bc;const e=this.editor.getModel();if(e)for(const t of yd.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:rr.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:rr.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:rr.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(75).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}xw.DEFAULT_DELAY=120;function Hse(s,e){switch(e.triggerKind){case rr.Invoke:return e;case rr.ContentChange:return s;case rr.TriggerCharacter:default:return e}}var zse=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},BS=function(s,e){return function(t,i){e(t,i,s)}};const Bn=Y,Use=Oi("parameter-hints-next",ie.chevronDown,p("parameterHintsNextIcon","Icon for show next parameter hint.")),$se=Oi("parameter-hints-previous",ie.chevronUp,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let HC=class aB extends H{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 wl({editor:e},n,i)),this.model=this._register(new xw(e)),this.keyVisible=hh.Visible.bindTo(t),this.keyMultipleSignatures=hh.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints(o=>{o?(this.show(),this.render(o)):this.hide()}))}createParameterHintDOMNodes(){const e=Bn(".editor-widget.parameter-hints-widget"),t=U(e,Bn(".phwrapper"));t.tabIndex=-1;const i=U(t,Bn(".controls")),n=U(i,Bn(".button"+kt.asCSSSelector($se))),o=U(i,Bn(".overloads")),r=U(i,Bn(".button"+kt.asCSSSelector(Use)));this._register(q(n,"click",u=>{rt.stop(u),this.previous()})),this._register(q(r,"click",u=>{rt.stop(u),this.next()}));const a=Bn(".body"),l=new Up(a,{});this._register(l),t.appendChild(l.getDomNode());const d=U(a,Bn(".signature")),h=U(a,Bn(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:o,docs:h,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const c=()=>{if(!this.domNodes)return;const u=this.editor.getOption(43);this.domNodes.element.style.fontSize=`${u.fontSize}px`,this.domNodes.element.style.lineHeight=`${u.lineHeight/u.fontSize}`};c(),this._register(he.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(u=>u.hasChanged(43)).on(c,null)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),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=U(this.domNodes.signature,Bn(".code")),r=this.editor.getOption(43);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 c=U(o,Bn("span"));c.textContent=n.label}const d=n.parameters[l];if(d!=null&&d.documentation){const c=Bn("span.documentation");if(typeof d.documentation=="string")c.textContent=d.documentation;else{const u=this.renderMarkdownDocs(d.documentation);c.appendChild(u.element)}U(this.domNodes.docs,Bn("p",{},c))}if(n.documentation!==void 0)if(typeof n.documentation=="string")U(this.domNodes.docs,Bn("p",{},n.documentation));else{const c=this.renderMarkdownDocs(n.documentation);U(this.domNodes.docs,c.element)}const h=this.hasDocs(n,d);if(this.domNodes.signature.classList.toggle("has-docs",h),this.domNodes.docs.classList.toggle("empty",!h),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,d){let c="";const u=n.parameters[l];Array.isArray(u.label)?c=n.label.substring(u.label[0],u.label[1]):c=u.label,u.documentation&&(c+=typeof u.documentation=="string"?`, ${u.documentation}`:`, ${u.documentation.value}`),n.documentation&&(c+=typeof n.documentation=="string"?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==c&&(Ei(p("hint","{0}, hint",c)),this.announcedLabel=c)}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"&&_m(t.documentation).length>0||t&&typeof t.documentation=="object"&&_m(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&_m(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&_m(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),U(e,r,a,l)}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|^)${Ks(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.createParameterHintDOMNodes(),this.domNodes.element}getId(){return aB.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)}};HC.ID="editor.widget.parameterHintsWidget";HC=zse([BS(1,ve),BS(2,Co),BS(3,Qi)],HC);const jse=R("editorHoverWidget.highlightForeground",{dark:ra,light:ra,hc:ra},p("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));st((s,e)=>{const t=s.getColor(tk);if(t){const d=s.type===gs.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .parameter-hints-widget { border: ${d}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(Kd);i&&e.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${i}; }`);const n=s.getColor(Vp);n&&e.addRule(`.monaco-editor .parameter-hints-widget a { color: ${n}; }`);const o=s.getColor(Hp);o&&e.addRule(`.monaco-editor .parameter-hints-widget a:hover { color: ${o}; }`);const r=s.getColor(ek);r&&e.addRule(`.monaco-editor .parameter-hints-widget { color: ${r}; }`);const a=s.getColor($x);a&&e.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${a}; }`);const l=s.getColor(jse);l&&e.addRule(`.monaco-editor .parameter-hints-widget .parameter.active { color: ${l}}`)});var Kse=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},qse=function(s,e){return function(t,i){e(t,i,s)}};let ch=class lB extends H{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(HC,this.editor))}static get(e){return e.getContribution(lB.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};ch.ID="editor.controller.parameterHints";ch=Kse([qse(1,Ge)],ch);class Gse extends oe{constructor(){super({id:"editor.action.triggerParameterHints",label:p("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:E.hasSignatureHelpProvider,kbOpts:{kbExpr:E.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=ch.get(t);i&&i.trigger({triggerKind:rr.Invoke})}}nt(ch.ID,ch);ee(Gse);const II=175,EI=Mi.bindToContribution(ch.get);J(new EI({id:"closeParameterHints",precondition:hh.Visible,handler:s=>s.cancel(),kbOpts:{weight:II,kbExpr:E.focus,primary:9,secondary:[1033]}}));J(new EI({id:"showPrevParameterHint",precondition:te.and(hh.Visible,hh.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:II,kbExpr:E.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));J(new EI({id:"showNextParameterHint",precondition:te.and(hh.Visible,hh.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:II,kbExpr:E.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var Zse=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},WS=function(s,e){return function(t,i){e(t,i,s)}};const kw=new re("renameInputVisible",!1,p("renameInputVisible","Whether the rename input widget is visible"));let RD=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=kw.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(43)&&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({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{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(fl);this._domNode.style.backgroundColor=String((t=e.getColor(Zn))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?` 0 0 8px 2px ${r}`:"",this._domNode.style.color=String((i=e.getColor(Kx))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((n=e.getColor(jx))!==null&&n!==void 0?n:"");const a=e.getColor(qx);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(43);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 F(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)}};RD=Zse([WS(2,Dt),WS(3,Nt),WS(4,ve)],RD);var Yse=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},rc=function(s,e){return function(t,i){e(t,i,s)}},Od=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class NI{constructor(e,t){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=wb.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return Od(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 S(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
  667. `):void 0}:{range:S.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
  668. `):void 0}})}provideRenameEdits(e,t){return Od(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return Od(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
  669. `)};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 Xse(s,e,t){return Od(this,void 0,void 0,function*(){const i=new NI(s,e),n=yield i.resolveRenameLocation(Oe.None);return n!=null&&n.rejectReason?{edits:[],rejectReason:n.rejectReason}:i.provideRenameEdits(t,Oe.None)})}let uh=class dB{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 ln,this._renameInputField=this._dispoableStore.add(new Tc(()=>this._dispoableStore.add(this._instaService.createInstance(RD,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(dB.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){return Od(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const e=this.editor.getPosition(),t=new NI(this.editor.getModel(),e);if(!t.hasProvider())return;this._cts=new Zg(this.editor,5);let i;try{const h=t.resolveRenameLocation(this._cts.token);this._progressService.showWhile(h,250),i=yield h}catch(h){is.get(this.editor).showMessage(h||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),e);return}if(!i)return;if(i.rejectReason){is.get(this.editor).showMessage(i.rejectReason,e);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new Zg(this.editor,5,i.range);let n=this.editor.getSelection(),o=0,r=i.text.length;!S.isEmpty(n)&&!S.spansMultipleLines(n)&&S.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=KD(t.provideRenameEdits(l.newName,this._cts.token),this._cts.token).then(h=>Od(this,void 0,void 0,function*(){if(!(!h||!this.editor.hasModel())){if(h.rejectReason){this._notificationService.info(h.rejectReason);return}this.editor.setSelection(S.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(lv.convert(h),{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(c=>{c.ariaSummary&&Ei(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",i.text,l.newName,c.ariaSummary))}).catch(c=>{this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(c)})}}),h=>{this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(h)});return this._progressService.showWhile(d,250),d})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};uh.ID="editor.contrib.renameController";uh=Yse([rc(1,Ge),rc(2,ni),rc(3,yx),rc(4,Ca),rc(5,Cr),rc(6,px)],uh);class Qse extends oe{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:te.and(E.writable,E.hasRenameProvider),kbOpts:{kbExpr:E.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(tt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return me.isUri(n)&&F.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))))},Le):super.runCommand(e,t)}run(e,t){const i=uh.get(t);return i?i.run():Promise.resolve()}}nt(uh.ID,uh);ee(Qse);const TI=Mi.bindToContribution(uh.get);J(new TI({id:"acceptRenameInput",precondition:kw,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:E.focus,primary:3}}));J(new TI({id:"acceptRenameInputWithPreview",precondition:te.and(kw,te.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:E.focus,primary:1027}}));J(new TI({id:"cancelRenameInput",precondition:kw,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:E.focus,primary:9,secondary:[1033]}}));vr("_executeDocumentRenameProvider",function(s,e,...t){const[i]=t;return ut(typeof i=="string"),Xse(s,e,i)});vr("_executePrepareRename",function(s,e){return Od(this,void 0,void 0,function*(){const i=yield new NI(s,e).resolveRenameLocation(Oe.None);if(i!=null&&i.rejectReason)throw new Error(i.rejectReason);return i})});Xt.as(Ch.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 Jse{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,h=0;for(;l>=0;l--){let c=o.charCodeAt(l);if(l!==a&&(c===95||c===45))break;if(Ha(c)&&jo(h))break;h=c}for(l+=1;d<o.length;d++){let c=o.charCodeAt(d);if(jo(c)&&Ha(h))break;if(c===95||c===45)break;h=c}l<d&&e.push({range:new S(i.lineNumber,r+l,i.lineNumber,r+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new S(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 S(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var AI=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class RI{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 RI(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}class xu{constructor(e){this._editor=e,this._ignoreSelection=!1}static get(e){return e.getContribution(xu.ID)}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return AI(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(!JC.has(i)||(this._state||(yield cB(i,t.map(o=>o.getPosition()),this._editor.getOption(101),Oe.None).then(o=>{var r;if(!(!Tn(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!zs(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 RI(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=>ne.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}})}}xu.ID="editor.contrib.smartSelectController";class hB extends oe{constructor(e,t){super(t),this._forward=e}run(e,t){return AI(this,void 0,void 0,function*(){let i=xu.get(t);i&&(yield i.run(this._forward))})}}class eoe extends hB{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:p("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"1_basic",title:p({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}$e.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class toe extends hB{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:p("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ae.MenubarSelectionMenu,group:"1_basic",title:p({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}nt(xu.ID,xu);ee(eoe);ee(toe);JC.register("*",new Jse);function cB(s,e,t,i){return AI(this,void 0,void 0,function*(){const n=JC.all(s);n.length===1&&n.unshift(new Vn);let o=[],r=[];for(const a of n)o.push(Promise.resolve(a.provideSelectionRanges(s,e,i)).then(l=>{if(Tn(l)&&l.length===e.length)for(let d=0;d<e.length;d++){r[d]||(r[d]=[]);for(const h of l[d])S.isIRange(h.range)&&S.containsPosition(h.range,e[d])&&r[d].push(S.lift(h.range))}},Di));return yield Promise.all(o),r.map(a=>{if(a.length===0)return[];a.sort((c,u)=>F.isBefore(c.getStartPosition(),u.getStartPosition())?1:F.isBefore(u.getStartPosition(),c.getStartPosition())||F.isBefore(c.getEndPosition(),u.getEndPosition())?-1:F.isBefore(u.getEndPosition(),c.getEndPosition())?1:0);let l=[],d;for(const c of a)(!d||S.containsRange(c,d)&&!S.equalsRange(c,d))&&(l.push(c),d=c);if(!t.selectLeadingAndTrailingWhitespace)return l;let h=[l[0]];for(let c=1;c<l.length;c++){const u=l[c-1],f=l[c];if(f.startLineNumber!==u.startLineNumber||f.endLineNumber!==u.endLineNumber){const g=new S(u.startLineNumber,s.getLineFirstNonWhitespaceColumn(u.startLineNumber),u.endLineNumber,s.getLineLastNonWhitespaceColumn(u.endLineNumber));g.containsRange(u)&&!g.equalsRange(u)&&f.containsRange(g)&&!f.equalsRange(g)&&h.push(g);const m=new S(u.startLineNumber,1,u.endLineNumber,s.getLineMaxColumn(u.endLineNumber));m.containsRange(u)&&!m.equalsRange(g)&&f.containsRange(m)&&!f.equalsRange(m)&&h.push(m)}h.push(f)}return h})})}w8("_executeSelectionRangeProvider",function(s,...e){const[t]=e;return cB(s,t,{selectLeadingAndTrailingWhitespace:!0},Oe.None)});class ioe extends oe{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 dr(!0);i.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}ee(ioe);class ku extends oe{constructor(){super({id:ku.ID,label:p({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"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=!Mb.getTabFocusMode();Mb.setTabFocusMode(n),Ei(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"))}}ku.ID="editor.action.toggleTabFocusMode";ee(ku);var noe=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},fR=function(s,e){return function(t,i){e(t,i,s)}},soe=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};const uB="ignoreUnusualLineTerminators";function ooe(s,e,t){s.setModelProperty(e.uri,uB,t)}function roe(s,e){return s.getModelProperty(e.uri,uB)}let Dp=class extends H{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._config=this._editor.getOption(112),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(112)&&(this._config=this._editor.getOption(112),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()}))}_checkForUnusualLineTerminators(){return soe(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||roe(this._codeEditorService,e)===!0||this._editor.getOption(80))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`.",qs(e.uri)),primaryButton:p("unusualLineTerminators.fix","Remove Unusual Line Terminators"),secondaryButton:p("unusualLineTerminators.ignore","Ignore")})).confirmed){ooe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};Dp.ID="editor.contrib.unusualLineTerminatorsDetector";Dp=noe([fR(1,Kp),fR(2,tt)],Dp);nt(Dp.ID,Dp);var aoe=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},VS=function(s,e){return function(t,i){e(t,i,s)}};let xp=class extends H{constructor(e,t,i,n){super(),this._modelService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._tokenizeViewport=new Lt(()=>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(ev.onDidChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(Lk)&&(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(!Ky(e,this._themeService,this._configurationService)){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}if(!Pj(e)){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=gi(o=>Promise.resolve(yk(e,t,o)));return n.then(o=>{if(!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:r,tokens:a}=o,l=this._modelService.getSemanticTokensProviderStyling(r);e.setPartialSemanticTokens(t,NP(a,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};xp.ID="editor.contrib.viewportSemanticTokens";xp=aoe([VS(1,ri),VS(2,Dt),VS(3,Vt)],xp);nt(xp.ID,xp);var loe=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},doe=function(s,e){return function(t,i){e(t,i,s)}};const hoe=R("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),coe=R("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),uoe=R("editor.wordHighlightBorder",{light:null,dark:null,hc:Xi},p("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),foe=R("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:Xi},p("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),goe=R("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),poe=R("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),Iw=new re("hasWordHighlights",!1);function fB(s,e,t){const i=Xc.ordered(s);return HR(i.map(n=>()=>Promise.resolve(n.provideDocumentHighlights(s,e,t)).then(void 0,Di)),Tn)}class gB{constructor(e,t,i){this._wordRange=this._getCurrentWordRange(e,t),this.result=gi(n=>this._compute(e,t,i,n))}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new S(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,h=i.length;!l&&d<h;d++){let c=e.getDecorationRange(i[d]);c&&c.startLineNumber===n&&c.startColumn<=o&&c.endColumn>=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class moe extends gB{_compute(e,t,i,n){return fB(e,t.getPosition(),n).then(o=>o||[])}}class _oe extends gB{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return rl(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:vg.Text}))})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function boe(s,e,t){return Xc.has(s)?new moe(s,e,t):new _oe(s,e,t)}vr("_executeDocumentHighlights",(s,e)=>fB(s,e,Oe.None));class Ku{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=Iw.bindTo(t),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(71),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(71);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 vh(this._decorationIds.map(e=>this.model.getDecorationRange(e)).sort(S.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);Ei(`${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);Ei(`${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=boe(this.model,this.editor.getSelection(),this.editor.getOption(115)),this.workerRequest.result.then(a=>{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Le)}}_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:Ku._getDecorationOptions(t.kind)});this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e),this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===vg.Write?this._WRITE_OPTIONS:e===vg.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}Ku._WRITE_OPTIONS=Ee.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:$t(poe),position:Xn.Center},minimap:{color:$t(Dv),position:fs.Inline}});Ku._TEXT_OPTIONS=Ee.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight",overviewRuler:{color:$t(zO),position:Xn.Center},minimap:{color:$t(Dv),position:fs.Inline}});Ku._REGULAR_OPTIONS=Ee.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:$t(goe),position:Xn.Center},minimap:{color:$t(Dv),position:fs.Inline}});let fh=class pB extends H{constructor(e,t){super(),this.wordHighlighter=null;const i=()=>{e.hasModel()&&(this.wordHighlighter=new Ku(e,t))};this._register(e.onDidChangeModel(n=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),i()})),i()}static get(e){return e.getContribution(pB.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()}};fh.ID="editor.contrib.wordHighlighter";fh=loe([doe(1,ve)],fh);class mB extends oe{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=fh.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Coe extends mB{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:Iw,kbOpts:{kbExpr:E.editorTextFocus,primary:65,weight:100}})}}class voe extends mB{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:Iw,kbOpts:{kbExpr:E.editorTextFocus,primary:1089,weight:100}})}}class woe extends oe{constructor(){super({id:"editor.action.wordHighlight.trigger",label:p("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Iw.toNegated(),kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=fh.get(t);n&&n.restoreViewState(!0)}}nt(fh.ID,fh);ee(Coe);ee(voe);ee(woe);st((s,e)=>{const t=s.getColor(Jx);t&&(e.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${t}; }`),e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`));const i=s.getColor(hoe);i&&e.addRule(`.monaco-editor .wordHighlight { background-color: ${i}; }`);const n=s.getColor(coe);n&&e.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${n}; }`);const o=s.getColor(S9);o&&e.addRule(`.monaco-editor .selectionHighlight { border: 1px ${s.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=s.getColor(uoe);r&&e.addRule(`.monaco-editor .wordHighlight { border: 1px ${s.type==="hc"?"dashed":"solid"} ${r}; box-sizing: border-box; }`);const a=s.getColor(foe);a&&e.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${s.type==="hc"?"dashed":"solid"} ${a}; box-sizing: border-box; }`)});class Ew extends Mi{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=vs(t.getOption(115)),o=t.getModel(),a=t.getSelections().map(l=>{const d=new F(l.positionLineNumber,l.positionColumn),h=this._move(n,o,d,this._wordNavigationType);return this._moveTo(l,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Re.fromModelSelection(l))),a.length===1){const l=new F(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new ne(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ne(t.lineNumber,t.column,t.lineNumber,t.column)}}class Ml extends Ew{_move(e,t,i,n){return je.moveWordLeft(e,t,i,n)}}class Ol extends Ew{_move(e,t,i,n){return je.moveWordRight(e,t,i,n)}}class Soe extends Ml{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class yoe extends Ml{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Loe extends Ml{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:te.and(E.textInputFocus,(e=te.and(jp,Vv))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Doe extends Ml{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class xoe extends Ml{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class koe extends Ml{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:te.and(E.textInputFocus,(e=te.and(jp,Vv))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Ioe extends Ml{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(vs(Do.wordSeparators.defaultValue),t,i,n)}}class Eoe extends Ml{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(vs(Do.wordSeparators.defaultValue),t,i,n)}}class Noe extends Ol{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Toe extends Ol{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:te.and(E.textInputFocus,(e=te.and(jp,Vv))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Aoe extends Ol{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Roe extends Ol{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Moe extends Ol{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:te.and(E.textInputFocus,(e=te.and(jp,Vv))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Ooe extends Ol{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Poe extends Ol{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(vs(Do.wordSeparators.defaultValue),t,i,n)}}class Foe extends Ol{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(vs(Do.wordSeparators.defaultValue),t,i,n)}}class Nw extends Mi{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=vs(t.getOption(115)),o=t.getModel(),r=t.getSelections(),a=t.getOption(5),l=t.getOption(8),d=Qe.getAutoClosingPairs(o.getLanguageId()),h=t._getViewModel(),c=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:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new xi(f,"")});t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}}class MI extends Nw{_delete(e,t){let i=je.deleteWordLeft(e,t);return i||new S(1,1,1,1)}}class OI extends Nw{_delete(e,t){let i=je.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new S(n,o,n,o)}}class Boe extends MI{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:E.writable})}}class Woe extends MI{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:E.writable})}}class Voe extends MI{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Hoe extends OI{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:E.writable})}}class zoe extends OI{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:E.writable})}}class Uoe extends OI{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class $oe extends oe{constructor(){super({id:"deleteInsideWord",precondition:E.writable,label:p("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=vs(t.getOption(115)),o=t.getModel(),a=t.getSelections().map(l=>{const d=je.deleteInsideWord(n,o,l);return new xi(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}J(new Soe);J(new yoe);J(new Loe);J(new Doe);J(new xoe);J(new koe);J(new Noe);J(new Toe);J(new Aoe);J(new Roe);J(new Moe);J(new Ooe);J(new Ioe);J(new Eoe);J(new Poe);J(new Foe);J(new Boe);J(new Woe);J(new Voe);J(new Hoe);J(new zoe);J(new Uoe);ee($oe);class joe extends Nw{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){let i=Ev.deleteWordPartLeft(e);return i||new S(1,1,1,1)}}class Koe extends Nw{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let i=Ev.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new S(n,o,n,o)}}class _B extends Ew{_move(e,t,i,n){return Ev.moveWordPartLeft(e,t,i)}}class qoe extends _B{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}$e.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Goe extends _B{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}$e.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class bB extends Ew{_move(e,t,i,n){return Ev.moveWordPartRight(e,t,i)}}class Zoe extends bB{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Yoe extends bB{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}J(new joe);J(new Koe);J(new qoe);J(new Goe);J(new Zoe);J(new Yoe);var CB=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},X_=function(s,e){return function(t,i){e(t,i,s)}};const vB=new re("accessibilityHelpWidgetVisible",!1);let gh=class wB extends H{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(Iu,this._editor))}static get(e){return e.getContribution(wB.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};gh.ID="editor.contrib.accessibilityHelpController";gh=CB([X_(1,Ge)],gh);function Xoe(s,e){return!s||s.length===0?Jt.noSelection:s.length===1?e?Vi(Jt.singleSelectionRange,s[0].positionLineNumber,s[0].positionColumn,e):Vi(Jt.singleSelection,s[0].positionLineNumber,s[0].positionColumn):e?Vi(Jt.multiSelectionRange,s.length,e):s.length>0?Vi(Jt.multiSelection,s.length):""}let Iu=class Q_ extends ss{constructor(e,t,i,n){super(),this._contextKeyService=t,this._keybindingService=i,this._openerService=n,this._editor=e,this._isVisibleKey=vB.bindTo(this._contextKeyService),this._domNode=Ke(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=Ke(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(ii(this._contentDomNode.domNode,"keydown",o=>{if(this._isVisible&&(o.equals(2083)&&(Ei(Jt.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),Li(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),o.preventDefault(),o.stopPropagation()),o.equals(2086))){Ei(Jt.openingDocs);let r=this._editor.getRawOptions().accessibilityHelpUrl;typeof r>"u"&&(r="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(me.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 Q_.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?Vi(t,n.getAriaLabel()):Vi(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=Xoe(t,i);e.get(53)?e.get(80)?n+=Jt.readonlyDiffEditor:n+=Jt.editableDiffEditor:e.get(80)?n+=Jt.readonlyEditor:n+=Jt.editableEditor;const o=Me?Jt.changeConfigToOnMac:Jt.changeConfigToOnWinLinux;switch(e.get(2)){case 0:n+=`
  670. - `+o;break;case 2:n+=`
  671. - `+Jt.auto_on;break;case 1:n+=`
  672. - `+Jt.auto_off,n+=" "+o;break}e.get(128)?n+=`
  673. - `+this._descriptionForCommand(ku.ID,Jt.tabFocusModeOnMsg,Jt.tabFocusModeOnMsgNoKb):n+=`
  674. - `+this._descriptionForCommand(ku.ID,Jt.tabFocusModeOffMsg,Jt.tabFocusModeOffMsgNoKb);const r=Me?Jt.openDocMac:Jt.openDocWinLinux;n+=`
  675. - `+r,n+=`
  676. `+Jt.outroMsg,this._contentDomNode.domNode.appendChild(w2(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,Li(this._contentDomNode.domNode),this._editor.focus())}_layout(){let e=this._editor.getLayoutInfo(),t=Math.max(5,Math.min(Q_.WIDTH,e.width-40)),i=Math.max(5,Math.min(Q_.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)}};Iu.ID="editor.contrib.accessibilityHelpWidget";Iu.WIDTH=500;Iu.HEIGHT=300;Iu=CB([X_(1,ve),X_(2,Nt),X_(3,Co)],Iu);class Qoe extends oe{constructor(){super({id:"editor.action.showAccessibilityHelp",label:Jt.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){let i=gh.get(t);i&&i.show()}}nt(gh.ID,gh);ee(Qoe);const Joe=Mi.bindToContribution(gh.get);J(new Joe({id:"closeAccessibilityHelp",precondition:vB,handler:s=>s.hide(),kbOpts:{weight:200,kbExpr:E.focus,primary:9,secondary:[1033]}}));st((s,e)=>{const t=s.getColor(Zn);t&&e.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${t}; }`);const i=s.getColor(oa);i&&e.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const n=s.getColor(fl);n&&e.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${n}; }`);const o=s.getColor(Zt);o&&e.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${o}; }`)});class MD extends H{constructor(e){super(),this.editor=e,this.widget=null,lr&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(80);!this.widget&&e?this.widget=new Tw(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}MD.ID="editor.contrib.iPadShowKeyboard";class Tw extends H{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(q(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(q(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Tw.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}Tw.ID="editor.contrib.ShowKeyboardWidget";nt(MD.ID,MD);var ere=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},gR=function(s,e){return function(t,i){e(t,i,s)}};let Eu=class SB extends H{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(Rt.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}static get(e){return e.getContribution(SB.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Aw(this._editor,this._modeService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Eu.ID="editor.contrib.inspectTokens";Eu=ere([gR(1,kh),gR(2,Qi)],Eu);class tre extends oe{constructor(){super({id:"editor.action.inspectTokens",label:uy.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=Eu.get(t);i&&i.launch()}}function ire(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 nre(s,e){const t=Rt.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>Op,tokenize:(n,o,r,a)=>vM(e,n,r,a),tokenize2:(n,o,r,a)=>cx(i,n,r,a)}}class Aw extends H{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=nre(this._modeService.languageIdCodec,this._model.getLanguageId()),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 Aw._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)}al(this._domNode,Y("h2.tm-token",void 0,ire(r),Y("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),U(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;U(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.languageId:"-?-"}`)),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?W.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?W.Format.CSS.formatHex(a.background):"-?-"}`))))),U(this._domNode,Y("hr.tokens-inspect-separator")),i<t.tokens1.length&&U(this._domNode,Y("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=Rt.getColorMap(),i=Yi.getLanguageId(e),n=Yi.getTokenType(e),o=Yi.getFontStyle(e),r=Yi.getForeground(e),a=Yi.getBackground(e);return{languageId:this._modeService.languageIdCodec.decodeLanguageId(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]}}}Aw._ID="editor.contrib.inspectTokensWidget";nt(Eu.ID,Eu);ee(tre);st((s,e)=>{const t=s.getColor(tk);if(t){let o=s.type===gs.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(Kd);i&&e.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${i}; }`);const n=s.getColor(ek);n&&e.addRule(`.monaco-editor .tokens-inspect-widget { color: ${n}; }`)});var sre=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},ore=function(s,e){return function(t,i){e(t,i,s)}};let zC=class J_{constructor(e){this.quickInputService=e,this.registry=Xt.as(Th.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(J_.PREFIX.length));r&&r.prefix&&r.prefix!==J_.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!==J_.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}}};zC.PREFIX="?";zC=sre([ore(0,Rl)],zC);Xt.as(Th.Quickaccess).registerQuickAccessProvider({ctor:zC,prefix:"",helpEntries:[{description:fy.helpQuickAccessActionLabel,needsEditor:!0}]});class yB{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 dn);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=GM(n);if(r){let a=Kn(n.saveViewState());i.add(r.onDidChangeCursorPosition(()=>{a=Kn(n.saveViewState())})),o.restoreViewState=()=>{a&&n===this.activeTextEditorControl&&n.restoreViewState(a)},i.add(ha(t.onCancellationRequested)(()=>{var l;return(l=o.restoreViewState)===null||l===void 0?void 0:l.call(o)}))}i.add(Ve(()=>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 qM(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:$t(H6),position:Xn.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 Rw extends yB{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,H.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(Rw.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 h=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(h,0),this.addDecorations(n,h)};r(),o.add(t.onDidChangeValue(()=>r()));const a=GM(n);return a&&a.getOptions().get(59).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Ve(()=>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}}Rw.PREFIX=":";var rre=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},are=function(s,e){return function(t,i){e(t,i,s)}};let kp=class extends Rw{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=he.None}get activeTextEditorControl(){return Kn(this.editorService.getFocusedCodeEditor())}};kp=rre([are(0,tt)],kp);Xt.as(Th.Quickaccess).registerQuickAccessProvider({ctor:kp,prefix:kp.PREFIX,helpEntries:[{description:Vb.gotoLineActionLabel,needsEditor:!0}]});let lre=class extends oe{constructor(){super({id:"editor.action.gotoLine",label:Vb.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Rl).quickAccess.show(kp.PREFIX)}};ee(lre);const LB=[void 0,[]];function HS(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?dre(s,n.values,t,i):DB(s,e,t,i)}function dre(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=DB(s,r,t,i);if(typeof a!="number")return LB;n+=a,o.push(...l)}return[n,hre(o)]}function DB(s,e,t,i){const n=cu(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,!0);return n?[n[0],Pv(n)]:LB}function hre(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!cre(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 cre(s,e){return!(s.end<e.start||e.end<s.start)}function pR(s){return s.startsWith('"')&&s.endsWith('"')}const xB=" ";function OD(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=mR(s),o=t.indexOf(Cd)>=0,r=pR(s);let a;const l=s.split(xB);if(l.length>1)for(const d of l){const h=pR(d),{pathNormalized:c,normalized:u,normalizedLowercase:f}=mR(d);u&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:c,normalized:u,normalizedLowercase:f,expectContiguousMatch:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function mR(s){let e;Ai?e=s.replace(/\//g,Cd):e=s.replace(/\\/g,Cd);const t=k3(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function _R(s){return Array.isArray(s)?OD(s.map(e=>e.original).join(xB)):OD(s.original)}var Sf=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};class bs extends yB{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.")),H.None}provideWithTextEditor(e,t,i){const n=e.editor,o=this.getModel(n);return o?Vs.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):H.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.")),Sf(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 Sf(this,void 0,void 0,function*(){if(Vs.has(e))return!0;let i;const n=new Promise(r=>i=r),o=t.add(Vs.onDidChange(()=>{Vs.has(e)&&(o.dispose(),i(!0))}));return t.add(Ve(()=>i(!1))),n})}doProvideWithEditorSymbols(e,t,i,n){const o=e.editor,r=new X;r.add(i.onDidAccept(c=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:c.inBackground}),c.inBackground||i.hide())})),r.add(i.onDidTriggerItemButton(({item:c})=>{c&&c.range&&(this.gotoLocation(e,{range:c.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const a=this.getDocumentSymbols(t,n);let l;const d=()=>Sf(this,void 0,void 0,function*(){l==null||l.dispose(!0),i.busy=!1,l=new ln(n),i.busy=!0;try{const c=OD(i.value.substr(bs.PREFIX.length).trim()),u=yield this.doGetSymbolPicks(a,c,void 0,l.token);if(n.isCancellationRequested)return;u.length>0?i.items=u:c.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 h=!0;return r.add(i.onDidChangeActive(()=>{const[c]=i.activeItems;if(c&&c.range){if(h){h=!1;return}o.revealRangeInCenter(c.range.selection,0),this.addDecorations(o,c.range.decoration)}})),r}doGetSymbolPicks(e,t,i,n){return Sf(this,void 0,void 0,function*(){const o=yield e;if(n.isCancellationRequested)return[];const r=t.original.indexOf(bs.SCOPE_PREFIX)===0,a=r?1:0;let l,d;t.values&&t.values.length>1?(l=_R(t.values[0]),d=_R(t.values.slice(1))):l=t;const h=[];for(let f=0;f<o.length;f++){const g=o[f],m=D3(g.name),_=`$(symbol-${Q1.toString(g.kind)||"property"}) ${m}`,C=_.length-m.length;let b=g.containerName;i!=null&&i.extraContainerLabel&&(b?b=`${i.extraContainerLabel} • ${b}`:b=i.extraContainerLabel);let v,w,y,k;if(t.original.length>a){let D=!1;if(l!==t&&([v,w]=HS(_,Object.assign(Object.assign({},t),{values:void 0}),a,C),typeof v=="number"&&(D=!0)),typeof v!="number"&&([v,w]=HS(_,l,a,C),typeof v!="number"))continue;if(!D&&d){if(b&&d.original.length>0&&([y,k]=HS(b,d)),typeof y!="number")continue;typeof v=="number"&&(v+=y)}}const L=g.tags&&g.tags.indexOf(1)>=0;h.push({index:f,kind:g.kind,score:v,label:_,ariaLabel:m,description:b,highlights:L?void 0:{label:w,description:k},range:{selection:S.collapseToStart(g.selectionRange),decoration:g.range},strikethrough:L,buttons:(()=>{var D,N;const B=!((D=this.options)===null||D===void 0)&&D.openSideBySideDirection?(N=this.options)===null||N===void 0?void 0:N.openSideBySideDirection():void 0;if(B)return[{iconClass:B==="right"?ie.splitHorizontal.classNames:ie.splitVertical.classNames,tooltip:B==="right"?p("openToSide","Open to the Side"):p("openToBottom","Open to the Bottom")}]})()})}const c=h.sort((f,g)=>r?this.compareByKindAndScore(f,g):this.compareByScore(f,g));let u=[];if(r){let _=function(){g&&typeof f=="number"&&m>0&&(g.label=Vi(US[f]||zS,m))},f,g,m=0;for(const C of c)f!==C.kind?(_(),f=C.kind,m=1,g={type:"separator"},u.push(g)):m++,u.push(C);_()}else c.length>0&&(u=[{label:p("symbols","symbols ({0})",h.length),type:"separator"},...c]);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=US[e.kind]||zS,n=US[t.kind]||zS,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return Sf(this,void 0,void 0,function*(){const i=yield nn.create(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}}bs.PREFIX="@";bs.SCOPE_PREFIX=":";bs.PREFIX_BY_CATEGORY=`${bs.PREFIX}${bs.SCOPE_PREFIX}`;const zS=p("property","properties ({0})"),US={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 ure=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},fre=function(s,e){return function(t,i){e(t,i,s)}};let PD=class extends bs{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=he.None}get activeTextEditorControl(){return Kn(this.editorService.getFocusedCodeEditor())}};PD=ure([fre(0,tt)],PD);Xt.as(Th.Quickaccess).registerQuickAccessProvider({ctor:PD,prefix:bs.PREFIX,helpEntries:[{description:Ng.quickOutlineActionLabel,prefix:bs.PREFIX,needsEditor:!0},{description:Ng.quickOutlineByCategoryActionLabel,prefix:bs.PREFIX_BY_CATEGORY,needsEditor:!0}]});let gre=class extends oe{constructor(){super({id:"editor.action.quickOutline",label:Ng.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:E.hasDocumentSymbolProvider,kbOpts:{kbExpr:E.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Rl).quickAccess.show(bs.PREFIX)}};ee(gre);function $S(s,e){return e&&(s.stack||s.stacktrace)?p("stackTrace.format","{0}: {1}",CR(s),bR(s.stack)||bR(s.stacktrace)):CR(s)}function bR(s){return Array.isArray(s)?s.join(`
  677. `):s}function CR(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 kB(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=vh(s),i=kB(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Gs(s))return s;if(s.detail){const t=s.detail;if(t.error)return $S(t.error,e);if(t.exception)return $S(t.exception,e)}return s.stack?$S(s,e):s.message?s.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var p_=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})},Ic;(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"})(Ic||(Ic={}));function jS(s){const e=s;return Array.isArray(e.items)}function pre(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class Mw extends H{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 dn),a=()=>p_(this,void 0,void 0,function*(){const l=r.value=new X;o==null||o.dispose(!0),e.busy=!1,o=new ln(t);const d=o.token,h=e.value.substr(this.prefix.length).trim(),c=this._getPicks(h,l,d),u=(f,g)=>{var m;let _,C;if(jS(f)?(_=f.items,C=f.active):_=f,_.length===0){if(g)return!1;h.length>0&&(!((m=this.options)===null||m===void 0)&&m.noResultsPick)&&(_=[this.options.noResultsPick])}return e.items=_,C&&(e.activeItems=[C]),!0};if(c!==null)if(pre(c)){let f=!1,g=!1;yield Promise.all([p_(this,void 0,void 0,function*(){yield rl(Mw.FAST_PICKS_RACE_DELAY),!d.isCancellationRequested&&(g||(f=u(c.picks,!0)))}),p_(this,void 0,void 0,function*(){e.busy=!0;try{const m=yield c.additionalPicks;if(d.isCancellationRequested)return;let _,C;jS(c.picks)?(_=c.picks.items,C=c.picks.active):_=c.picks;let b,v;if(jS(m)?(b=m.items,v=m.active):b=m,b.length>0||!f){let w;if(!C&&!v){const y=e.activeItems[0];y&&_.indexOf(y)!==-1&&(w=y)}u({items:[..._,...b],active:C||v||w})}}finally{d.isCancellationRequested||(e.busy=!1),g=!0}})])}else if(!(c instanceof Promise))u(c);else{e.busy=!0;try{const f=yield c;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})=>p_(this,void 0,void 0,function*(){var h,c;if(typeof d.trigger=="function"){const u=(c=(h=d.buttons)===null||h===void 0?void 0:h.indexOf(l))!==null&&c!==void 0?c:-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 Ic.NO_ACTION:break;case Ic.CLOSE_PICKER:e.hide();break;case Ic.REFRESH_PICKER:a();break;case Ic.REMOVE_ITEM:const m=e.items.indexOf(d);if(m!==-1){const _=e.items.slice(),C=_.splice(m,1),b=e.activeItems.filter(w=>w!==C[0]),v=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,b&&(e.activeItems=b),e.keepScrollPosition=v}break}}}}))),n}}Mw.FAST_PICKS_RACE_DELAY=200;var IB=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},dd=function(s,e){return function(t,i){e(t,i,s)}},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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Ip=class eb extends Mw{constructor(e,t,i,n,o,r){super(eb.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(ph)),this.options=e}_getPicks(e,t,i){return vR(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 h=Kn(eb.WORD_FILTER(e,d.label)),c=d.commandAlias?Kn(eb.WORD_FILTER(e,d.commandAlias)):void 0;h||c?(d.highlights={label:h,detail:this.options.showAlias?c:void 0},o.push(d)):e===d.commandId&&o.push(d)}const r=new Map;for(const d of o){const h=r.get(d.label);h?(d.description=d.commandId,h.description=h.commandId):r.set(d.label,d)}o.sort((d,h)=>{const c=this.commandsHistory.peek(d.commandId),u=this.commandsHistory.peek(h.commandId);return c&&u?c>u?-1:1:c?-1:u?1:d.label.localeCompare(h.label)});const a=[];let l=!1;for(let d=0;d<o.length;d++){const h=o[d],c=this.keybindingService.lookupKeybinding(h.commandId),u=c?p("commandPickAriaLabelWithKeybinding","{0}, {1}",h.label,c.getAriaLabel()):h.label;d===0&&this.commandsHistory.peek(h.commandId)&&(a.push({type:"separator",label:p("recentlyUsed","recently used")}),l=!0),d!==0&&l&&!this.commandsHistory.peek(h.commandId)&&(a.push({type:"separator",label:p("morecCommands","other commands")}),l=!1),a.push(Object.assign(Object.assign({},h),{ariaLabel:u,detail:this.options.showAlias&&h.commandAlias!==h.label?h.commandAlias:void 0,keybinding:c,accept:()=>vR(this,void 0,void 0,function*(){this.commandsHistory.push(h.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:h.commandId,from:"quick open"});try{yield this.commandService.executeCommand(h.commandId)}catch(f){br(f)||this.dialogService.show(Wt.Error,p("canNotRun","Command '{0}' resulted in an error ({1})",h.label,kB(f)))}})}))}return a})}};Ip.PREFIX=">";Ip.WORD_FILTER=Ik(Mv,vK,WP);Ip=IB([dd(1,Ge),dd(2,Nt),dd(3,Yt),dd(4,El),dd(5,Kp)],Ip);let ph=class ai extends H{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=ai.getConfiguredCommandHistoryLength(this.configurationService),ai.cache&&ai.cache.limit!==this.configuredCommandsHistoryLength&&(ai.cache.limit=this.configuredCommandsHistoryLength,ai.saveState(this.storageService))}load(){const e=this.storageService.get(ai.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=ai.cache=new kl(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))}ai.counter=this.storageService.getNumber(ai.PREF_KEY_COUNTER,0,ai.counter)}push(e){ai.cache&&(ai.cache.set(e,ai.counter++),ai.saveState(this.storageService))}peek(e){var t;return(t=ai.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!ai.cache)return;const t={usesLRU:!0,entries:[]};ai.cache.forEach((i,n)=>t.entries.push({key:n,value:i})),e.store(ai.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(ai.PREF_KEY_COUNTER,ai.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:ai.DEFAULT_COMMANDS_HISTORY_LENGTH}};ph.DEFAULT_COMMANDS_HISTORY_LENGTH=50;ph.PREF_KEY_CACHE="commandPalette.mru.cache";ph.PREF_KEY_COUNTER="commandPalette.mru.counter";ph.counter=1;ph=IB([dd(0,yr),dd(1,Vt)],ph);class mre extends Ip{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:GP(i.label)||i.id});return t}}var _re=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},ac=function(s,e){return function(t,i){e(t,i,s)}},bre=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(h){try{d(i.next(h))}catch(c){r(c)}}function l(h){try{d(i.throw(h))}catch(c){r(c)}}function d(h){h.done?o(h.value):n(h.value).then(a,l)}d((i=i.apply(s,e||[])).next())})};let Ep=class extends mre{constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}get activeTextEditorControl(){return Kn(this.codeEditorService.getFocusedCodeEditor())}getCommandPicks(){return bre(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}};Ep=_re([ac(0,Ge),ac(1,tt),ac(2,Nt),ac(3,Yt),ac(4,El),ac(5,Kp)],Ep);Xt.as(Th.Quickaccess).registerQuickAccessProvider({ctor:Ep,prefix:Ep.PREFIX,helpEntries:[{description:Hb.quickCommandHelp,needsEditor:!0}]});class Cre extends oe{constructor(){super({id:"editor.action.quickCommand",label:Hb.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Rl).quickAccess.show(Ep.PREFIX)}}ee(Cre);var vre=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},lc=function(s,e){return function(t,i){e(t,i,s)}};let FD=class extends vl{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};FD=vre([lc(1,ve),lc(2,tt),lc(3,ni),lc(4,Ge),lc(5,yr),lc(6,Vt)],FD);nt(vl.ID,FD);class wre extends oe{constructor(){super({id:"editor.action.toggleHighContrast",label:gy.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(kh);this._originalThemeName?(i.setTheme(this._originalThemeName),this._originalThemeName=null):(this._originalThemeName=i.getColorTheme().themeName,i.setTheme("hc-black"))}}ee(wre);const ple=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:uY,Emitter:gu,KeyCode:fY,KeyMod:gY,MarkerSeverity:CY,MarkerTag:vY,Position:pY,Range:mY,Selection:_Y,SelectionDirection:bY,Token:SY,Uri:wY,editor:yY,languages:on},Symbol.toStringTag,{value:"Module"}));export{vY as M,mY as R,wY as U,CY as a,ple as b,yY as e,on as l,M2 as t};