752 lines
3.2 MiB
JavaScript
752 lines
3.2 MiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./freemarker2.js","./index.js","./index.css","./handlebars.js","./html.js","./javascript.js","./typescript.js","./liquid.js","./mdx.js","./python.js","./razor.js","./xml.js","./yaml.js","./cssMode.js","./htmlMode.js","./jsonMode.js","./tsMode.js"])))=>i.map(i=>d[i]);
|
||
|
|
import{_ as we}from"./index.js";function $o(o,e=0){return o[o.length-(1+e)]}function zj(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Jt(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function Uj(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function rb(o,e,t){return $j(o.length,i=>t(o[i],e))}function $j(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function xD(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?xD(o,n,t):o<n.length+r.length?r[0]:xD(o-(n.length+r.length),s,t)}function mF(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*BM(o,e){let t,i;for(const n of o)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function $7(o,e){for(let t=0;t<=o.length;t++)e(t===0?void 0:o[t-1],t===o.length?void 0:o[t])}function jj(o,e){for(let t=0;t<o.length;t++)e(t===0?void 0:o[t-1],o[t],t+1===o.length?void 0:o[t+1])}function Ar(o){return o.filter(e=>!!e)}function _F(o){let e=0;for(let t=0;t<o.length;t++)o[t]&&(o[e]=o[t],e+=1);o.length=e}function j7(o){return!Array.isArray(o)||o.length===0}function qn(o){return Array.isArray(o)&&o.length>0}function mc(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function HM(o,e){return o.length>0?o[0]:e}function vs(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);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 gy(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function vx(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function Ev(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function kD(o,e){for(const t of e)o.push(t)}function VM(o){return Array.isArray(o)?o:[o]}function Kj(o,e,t){const i=K7(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function bF(o,e,t,i){const n=K7(o,e);let s=o.splice(n,t);return s===void 0&&(s=[]),Kj(o,n,i),s}function K7(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var ab;(function(o){function e(s){return s<0}o.isLessThan=e;function t(s){return s<=0}o.isLessThanOrEqual=t;function i(s){return s>0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(ab||(ab={}));function rs(o,e){return(t,i)=>e(o(t),o(i))}function qj(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!ab.isNeitherLessOrGreaterThan(n))return n}return ab.neitherLessOrGreaterThan}}const Rr=(o,e)=>o-e,Gj=(o,e)=>Rr(o?1:0,e?1:0);function q7(o){return(e,t)=>-o(e,t)}class _c{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let 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(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class lc{static{this.empty=new lc(e=>{})}constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new lc(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new lc(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||ab.isGreaterThan(e(n,t)))&&(i=!
|
||
|
|
- Use 0 to automatically compute the line height from the font size.
|
||
|
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
||
|
|
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class AK extends Yt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"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.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_e(t.enabled,this.defaultValue.enabled),autohide:_e(t.autohide,this.defaultValue.autohide),size:hi(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:hi(t.side,this.defaultValue.side,["right","left"]),showSlider:hi(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:_e(t.renderCharacters,this.defaultValue.renderCharacters),scale:Tt.clampedInt(t.scale,1,1,3),maxColumn:Tt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:_e(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:_e(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:ko.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:ko.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function PK(o){return o==="ctrlCmd"?Ye?"metaKey":"ctrlKey":"altKey"}class OK extends Yt{constructor(){super(84,"
|
||
|
|
|
||
|
|
`+e.stack):new Error(e.message+`
|
||
|
|
|
||
|
|
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const l9=new rq;function Me(o){hr(o)||l9.onUnexpectedError(o)}function Ci(o){hr(o)||l9.onUnexpectedExternalError(o)}function LF(o){if(o instanceof Error){const{name:e,message:t}=o,i=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:Yf.isErrorNoTelemetry(o)}}return o}const W1="Canceled";function hr(o){return o instanceof Pr?!0:o instanceof Error&&o.name===W1&&o.message===W1}class Pr extends Error{constructor(){super(W1),this.name=this.message}}function aq(){const o=new Error(W1);return o.name=o.message,o}function tr(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function qM(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class lq extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Yf extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Yf)return e;const t=new Yf;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class gt extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,gt.prototype)}}function Md(o,e){const t=this;let i=!1,n;return function(){return i||(i=!0,n=o.apply(t,arguments)),n}}function my(o){return typeof o=="object"&&o!==null&&typeof o.dispose=="function"&&o.dispose.length===0}function It(o){if(it.is(o)){const e=[];for(const t of o)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function Mr(...o){return be(()=>It(o))}function be(o){return{dispose:Md(()=>{o()})}}class K{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{It(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?K.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}class F{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new K,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)}}class Yi{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class cq{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class dq{constructor(e){this.object=e}dispose(){}}class GM{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{It(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const hq=globalThis.performance&&typeof globalThis.performance.now=="function";class on{static create(e){return new on(e)}constructor(e)
|
||
|
|
`).slice(2).join(`
|
||
|
|
`))}}class gq extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class fq extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class wx{constructor(e){this.value=e}}const pq=2;let O=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new ZM(e?.onListenerError??Me,this._options?.leakWarningThreshold??uq):void 0,this._perfMon=this._options?._profName?new B1(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new fq(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Me)(c),F.None}if(this._disposed)return F.None;t&&(e=e.bind(t));const n=new wx(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=YM.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof wx?(this._deliveryQueue??=new c9,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;const r=be(()=>{s?.(),this._removeListener(n)});return i instanceof K?i.add(r):Array.isArray(i)&&i.push(r),r},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(this._size*pq<=t.length){let s=0;for(let r=0;r<t.length;r++)t[r]?t[s++]=t[r]:n&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=s}}_deliver(e,t){if(!e)return;const i=this._options?.onListenerError||Me;if(!i){e.value(t);return}try{e.value(t)}catch(n){i(n)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof wx)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}};const mq=()=>new c9;class c9{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class wu extends O{constructor(e){super(e),this._isPaused=0,this._eventQueue=new is,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class d9 extends wu{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class _q extends O{constructor(e){super(e),this._queuedEvents=[]
|
||
|
|
`+ho),Oc&&Pv([U,Z,H],Ma=>{ho=vm(ho,Ma," ")}),v&&gg?v.createHTML(ho):ho},e.setConfig=function(){let qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mm(qe),fm=!0},e.clearConfig=function(){Bc=null,fm=!1},e.isValidAttribute=function(qe,G,Se){Bc||mm({});const Be=mn(qe),Ri=mn(G);return vi(Be,Ri,Se)},e.addHook=function(qe,G){typeof G=="function"&&(W[qe]=W[qe]||[],Cm(W[qe],G))},e.removeHook=function(qe){if(W[qe])return AF(W[qe])},e.removeHooks=function(qe){W[qe]&&(W[qe]=[])},e.removeAllHooks=function(){W={}},e}var vl=U9();vl.version;vl.isSupported;const $9=vl.sanitize;vl.setConfig;vl.clearConfig;vl.isValidAttribute;const j9=vl.addHook,K9=vl.removeHook;vl.removeHooks;vl.removeAllHooks;var Pe;(function(o){o.inMemory="inmemory",o.vscode="vscode",o.internal="private",o.walkThrough="walkThrough",o.walkThroughSnippet="walkThroughSnippet",o.http="http",o.https="https",o.file="file",o.mailto="mailto",o.untitled="untitled",o.data="data",o.command="command",o.vscodeRemote="vscode-remote",o.vscodeRemoteResource="vscode-remote-resource",o.vscodeManagedRemoteResource="vscode-managed-remote-resource",o.vscodeUserData="vscode-userdata",o.vscodeCustomEditor="vscode-custom-editor",o.vscodeNotebookCell="vscode-notebook-cell",o.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",o.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",o.vscodeNotebookCellOutput="vscode-notebook-cell-output",o.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",o.vscodeNotebookMetadata="vscode-notebook-metadata",o.vscodeInteractiveInput="vscode-interactive-input",o.vscodeSettings="vscode-settings",o.vscodeWorkspaceTrust="vscode-workspace-trust",o.vscodeTerminal="vscode-terminal",o.vscodeChatCodeBlock="vscode-chat-code-block",o.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",o.vscodeChatSesssion="vscode-chat-editor",o.webviewPanel="webview-panel",o.vscodeWebview="vscode-webview",o.extension="extension",o.vscodeFileResource="vscode-file",o.tmp="tmp",o.vsls="vsls",o.vscodeSourceControl="vscode-scm",o.commentsInput="comment",o.codeSetting="code-setting",o.outputChannel="output"})(Pe||(Pe={}));function Cy(o,e){return ve.isUri(o)?Zg(o.scheme,e):tA(o,e+":")}function FI(o,...e){return e.some(t=>Cy(o,t))}const YG="tkn";class XG{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return Ei.join(this._serverRootPath,Pe.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Me(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(r+=`&${YG}=${encodeURIComponent(s)}`),ve.from({scheme:qu?this._preferredWebSchema:Pe.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const q9=new XG,QG="vscode-app";class Z1{static{this.FALLBACK_AUTHORITY=QG}asBrowserUri(e){const t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===Pe.vscodeRemote?q9.rewrite(e):e.scheme===Pe.file&&(ll||rK===`${Pe.vscodeFileResource}://${Z1.FALLBACK_AUTHORITY}`)?e.with({scheme:Pe.vscodeFileResource,authority:e.authority||Z1.FALLBACK_AUTHORITY,query:null,fragment:null}):e}toUri(e,t){if(ve.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){const i=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(i))return ve.joinPath(ve.parse(i,!0),e);const n=Nq(i,e);return ve.file(n)}return ve.parse(t.toUrl(e))}}const vy=new Z1;var WI;(function(o){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);o.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(s){let r;typeof s=="string"?r=new URL(s)
|
||
|
|
| KEY '=~' REGEX
|
||
|
|
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=p("contextkey.parser.error.expectedButGot",`Expected: {0}
|
||
|
|
Received: '{1}'.`,e,xm.getLexeme(t)),s=t.offset,r=xm.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),Ym._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};class q{static false(){return ds.INSTANCE}static true(){return Ns.INSTANCE}static has(e){return Gu.create(e)}static equals(e,t){return Up.create(e,t)}static notEquals(e,t){return Iy.create(e,t)}static regex(e,t){return _b.create(e,t)}static in(e,t){return ky.create(e,t)}static notIn(e,t){return Dy.create(e,t)}static not(e){return Zu.create(e)}static and(...e){return Qh.create(e,null,!0)}static or(...e){return Yl.create(e,null,!0)}static{this._parser=new ZZ({regexParsingWithErrorRecovery:!1})}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}function YZ(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function y_(o,e){return o.cmp(e)}class ds{static{this.INSTANCE=new ds}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 Ns.INSTANCE}}class Ns{static{this.INSTANCE=new Ns}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 ds.INSTANCE}}class Gu{static create(e,t=null){const i=Mn.get(e);return typeof i=="boolean"?i?Ns.INSTANCE:ds.INSTANCE:new Gu(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:lH(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Mn.get(this.key);return typeof e=="boolean"?e?Ns.INSTANCE:ds.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Zu.create(this.key,this)),this.negated}}class Up{static create(e,t,i=null){if(typeof t=="boolean")return t?Gu.create(e,i):Zu.create(e,i);const n=Mn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Ns.INSTANCE:ds.INSTANCE:new Up(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Yu(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=Mn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ns.INSTANCE:ds.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=Iy.create(this.key,this.value,this)),this.negated}}class ky{static create(e,t){return new ky(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Yu(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?HZ.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=Dy.create(this.key,this.valueKey)),this.negated}}class Dy{static create(e,t){return new Dy(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=ky.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated
|
||
|
|
`}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
|
||
|
|
`}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Vx(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Vx({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Vx({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:iS.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:iS.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}function Jh(o,e){const t=o.getCount(),i=o.findTokenIndexAtOffset(e),n=o.getLanguageId(i);let s=i;for(;s+1<t&&o.getLanguageId(s+1)===n;)s++;let r=i;for(;r>0&&o.getLanguageId(r-1)===n;)r--;return new yY(o,n,r,s+1,o.getStartOffset(r),o.getEndOffset(s))}class yY{constructor(e,t,i,n,s,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}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)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function Va(o){return(o&3)!==0}const JF=typeof Buffer<"u";let zx;class Oy{static wrap(e){return JF&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Oy(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return JF?this.buffer.toString():(zx||(zx=new TextDecoder),zx.decode(this.buffer))}}function LY(o,e){return o[e+0]<<0>>>0|o[e+1]<<8>>>0}function xY(o,e,t){o[t+0]=e&255,e=e>>>8,o[t+1]=e&255}function ta(o,e){return o[e]*2**24+o[e+1]*2**16+o[e+2]*2**8+o[e+3]}function ia(o,e,t){o[t+3]=e,e=e>>>8,o[t+2]=e,e=e>>>8,o[t+1]=e,e=e>>>8,o[t]=e}function e4(o,e){return o[e]}function t4(o,e,t){o[t]=e}let Ux;function bH(){return Ux||(Ux=new TextDecoder("UTF-16LE")),Ux}let $x;function kY(){return $x||($x=new TextDecoder("UTF-16BE")),$x}let jx;function CH(){return jx||(jx=n9()?bH():kY()),jx}function DY(o,e,t){const i=new Uint16Array(o.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?IY(o,e,t):bH().decode(i)}function IY(o,e,t){const i=[];let n=0;for(let s=0;s<t;s++){const r=LY(o,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class jp{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 CH().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Ki(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bu
|
||
|
|
`)>=0;let t=null;try{t=D9(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 _X(t,this.wordSeparators?ar(this.wordSeparators,[]):null,i?this.searchString:null)}}function vX(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Fh(o,e,t){if(!t)return new bb(o,null);const i=[];for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return new bb(o,i)}class m4{constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class Bv{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Qg(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+g}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new L(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
|
||
|
|
`?new m4(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Fh(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<s;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,s);if(a<s){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=t.length;let m=-g;for(;(m=t.indexOf(u,m+g))!==-1;)if((!c||kA(c,t,f,m,g))&&(r[s++]=new bb(new L(i,m+1+n,i,m+1+g+n),null),s>=l))return s;return s}const d=new Qg(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Fh(new L(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Qg(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new A(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new L(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
|
||
|
|
`?new m4(l):null;i.reset(t.column-1);const d=i.next(l);return d?Fh(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new A(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Fh(new L(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Qg(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new L(1,1,t.lineNumber,t.column),i,n,10*CX);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new A(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Fh(new L(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function wX(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function SX(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function kA(o,e,t,i,n){return wX(o,e,t,i,n)&&SX(o,e,t,i,n)}class Qg{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){q1(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||kA(this._wordSeparators,e,t,n,s))return i}while(i);return null}}class DA{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),r=new _4(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${yX(Array.from(a))}`,"g");const c=new Qg(null,l),d=[];let h=!1,u,g=0,f=0,m=0;e:for(let _=n,b=s;_<=b;_++){const C=e.getLineContent(_),w=C.length;c.reset(0);do if(u=c.next(C),u){let v=u.index,S=u.index+u[0].length;if(v>0){const N=C.charCodeAt(v-1);Ki(N)&&v--}if(S+1<w){const N=C.charCodeAt(S-1);Ki(N)&&S++}const k=C.substring(v,S);let x=cb(v+1,jM,C,0);x&&x.endColumn<=v+1&&(x=null);const E=r.shouldHighlightNonBasicASCII(k,x?x.word:null);if(E!==0){if(E===3?g++:E===2?f++:E===1?m++:Ay(),d.length>=1e3){h=!0;break e}d.push(new L(_,v+1,_,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:g,invisibleCharacterCount:f,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new _4(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(s),a=hd.getLocales().filter(l=>!hd.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}c
|
||
|
|
`||o===" "}class Qw{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class NH{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class je{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const s=Math.min(e.start,t[i].start),r=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new je(s,r))}}static tryCreate(e,t){if(!(e>t))return new je(e,t)}static ofLength(e){return new je(0,e)}static ofStartAndLength(e,t){return new je(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new gt(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new je(this.start+e,this.endExclusive+e)}deltaStart(e){return new je(this.start+e,this.endExclusive)}deltaEnd(e){return new je(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new je(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new je(t,i)}intersects(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new gt(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new gt(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class IA{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new je(n,s))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new IA;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}function Cb(o,e){const t=LX(o,e);if(t!==-1)return o[t]}function LX(o,e,t=o.length-1){for(let i=t;i>=0;i--){const n=o[i];if(e(n))return i}return-1}function tp(o,e){const t=vb(o,e);return t===-1?void 0:o[t]}function vb(o,e,t=0,i=o.length){let n=t,s=i;for(;n<s;){const r=Math.floor((n+s)/2);e(o[r])?n=r+1:s=r}return n-1}function xX(o,e){const t=wb(o,e);return t===o.length?void 0:o[t]}function wb(o,e,t=0,i=o.length){let n=t,s=i;for(;n<s;){const r=Math.floor((n+s)/2);e(o[r])?s=r:n=r+1}return n}class By{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(By.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const t=vb(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}}function EA(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i<o.length;i++){const n=o[i];
|
||
|
|
`?(t++,i=0):i++;return new ks(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new L(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new L(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new A(e.lineNumber,e.column+this.columnCount):new A(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class NX{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
|
||
|
|
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new je(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new ks(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}class NA{constructor(e){this.edits=e,Du(()=>vA(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new A(1,1);for(const s of this.edits){const r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=C4(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const n=C4(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new TX(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const s of this.edits){const r=ks.ofText(s.text),a=A.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,n=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}}class dl{constructor(e,t){this.range=e,this.text=t}toSingleEditOperation(){return{range:this.range,text:this.text}}}function C4(o,e){if(o.lineNumber===e.lineNumber&&o.column===Number.MAX_SAFE_INTEGER)return L.fromPositions(e,e);if(!o.isBeforeOrEqual(e))throw new gt("start must be before end");return new L(o.lineNumber,o.column,e.lineNumber,e.column)}class TH{get endPositionExclusive(){return this.length.addToPosition(new A(1,1))}}class TX extends TH{constructor(e){super(),this.value=e,this._t=new NX(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class $n{static inverse(e,t,i){const n=[];let s=1,r=1;for(const l of e){const c=new $n(new Fe(s,l.original.startLineNumber),new Fe(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new $n(new Fe(s,t+1),new Fe(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const s of e){const r=s.original.intersect(t),a=s.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new $n(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new $n(this.modified,this.original)}join(e){return new $n(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new vo(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new gt("not a valid diff");return new vo(new L(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new vo(new L(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new L(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(v4(this.original.endLineNumberExclusive,e)&&v4(this.modified.endLineNumberExclusive,t))return new vo(new L(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new vo(L.fromPositions(new A(this.original.startLineNumber,1),Sg(new A(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L.fromPositions(new A(this.modified.startLineNumber,1),Sg(new A(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new vo(L.fromPositions(Sg(new A(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Sg(new A(this.original
|
||
|
|
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}}class WX{compute(e,t,i=VC.instance,n){if(e.length===0||t.length===0)return uc.trivial(e,t);const s=new Zx(e.length,t.length),r=new Zx(e.length,t.length),a=new Zx(e.length,t.length);for(let f=0;f<e.length;f++)for(let m=0;m<t.length;m++){if(!i.isValid())return uc.trivialTimedOut(e,t);const _=f===0?0:s.get(f-1,m),b=m===0?0:s.get(f,m-1);let C;e.getElement(f)===t.getElement(m)?(f===0||m===0?C=0:C=s.get(f-1,m-1),f>0&&m>0&&r.get(f-1,m-1)===3&&(C+=a.get(f-1,m-1)),C+=n?n(f,m):1):C=-1;const w=Math.max(_,b,C);if(w===C){const v=f>0&&m>0?a.get(f-1,m-1):0;a.set(f,m,v+1),r.set(f,m,3)}else w===_?(a.set(f,m,0),r.set(f,m,1)):w===b&&(a.set(f,m,0),r.set(f,m,2));s.set(f,m,w)}const l=[];let c=e.length,d=t.length;function h(f,m){(f+1!==c||m+1!==d)&&l.push(new ji(new je(f+1,c),new je(m+1,d))),c=f,d=m}let u=e.length-1,g=t.length-1;for(;u>=0&&g>=0;)r.get(u,g)===3?(h(u,g),u--,g--):r.get(u,g)===1?u--:g--;return h(-1,-1),l.reverse(),new uc(l,!1)}}class MH{compute(e,t,i=VC.instance){if(e.length===0||t.length===0)return uc.trivial(e,t);const n=e,s=t;function r(m,_){for(;m<n.length&&_<s.length&&n.getElement(m)===s.getElement(_);)m++,_++;return m}let a=0;const l=new BX;l.set(0,r(0,0));const c=new HX;c.set(0,l.get(0)===0?null:new y4(null,0,0,l.get(0)));let d=0;e:for(;;){if(a++,!i.isValid())return uc.trivialTimedOut(n,s);const m=-Math.min(a,s.length+a%2),_=Math.min(a,n.length+a%2);for(d=m;d<=_;d+=2){const b=d===_?-1:l.get(d+1),C=d===m?-1:l.get(d-1)+1,w=Math.min(Math.max(b,C),n.length),v=w-d;if(w>n.length||v>s.length)continue;const S=r(w,v);l.set(d,S);const k=w===b?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new y4(k,w,v,S-w):k),l.get(d)===n.length&&l.get(d)-d===s.length)break e}}let h=c.get(d);const u=[];let g=n.length,f=s.length;for(;;){const m=h?h.x+h.length:0,_=h?h.y+h.length:0;if((m!==g||_!==f)&&u.push(new ji(new je(m,g),new je(_,f))),!h)break;g=h.x,f=h.y,h=h.prev}return u.reverse(),new uc(u,!1)}}class y4{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class BX{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class HX{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class cS{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let s=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,s=s.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,s.length):s.length;for(let c=0;c<l;c++)this.elements.push(s.charCodeAt(c));n<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new je(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=x4(e>0?this.elements[e-1]:-1),i=x4(e
|
||
|
|
`).length>=15&&UX(h,g=>g.length>=2)>=2}),r=qX(o,r),r}function UX(o,e){let t=0;for(const i of o)e(i)&&t++;return t}function $X(o,e,t,i){const n=[],s=o.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Sb(l.original,e,l)),r=new Set(o.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Sb(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,d;for(const h of r){const u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),n.push(new $n(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function jX(o,e,t,i,n,s){const r=[],a=new xA;for(const u of o)for(let g=u.original.startLineNumber;g<u.original.endLineNumberExclusive-2;g++){const f=`${e[g-1]}:${e[g+1-1]}:${e[g+2-1]}`;a.add(f,{range:new Fe(g,g+3)})}const l=[];o.sort(rs(u=>u.modified.startLineNumber,Rr));for(const u of o){let g=[];for(let f=u.modified.startLineNumber;f<u.modified.endLineNumberExclusive-2;f++){const m=`${t[f-1]}:${t[f+1-1]}:${t[f+2-1]}`,_=new Fe(f,f+3),b=[];a.forEach(m,({range:C})=>{for(const v of g)if(v.originalLineRange.endLineNumberExclusive+1===C.endLineNumberExclusive&&v.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){v.originalLineRange=new Fe(v.originalLineRange.startLineNumber,C.endLineNumberExclusive),v.modifiedLineRange=new Fe(v.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),b.push(v);return}const w={modifiedLineRange:_,originalLineRange:C};l.push(w),b.push(w)}),g=b}if(!s.isValid())return[]}l.sort(q7(rs(u=>u.modifiedLineRange.length,Rr)));const c=new Xo,d=new Xo;for(const u of l){const g=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,f=c.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(g),_=f.getIntersection(m);for(const b of _.ranges){if(b.length<3)continue;const C=b,w=b.delta(-g);r.push(new $n(w,C)),c.addRange(C),d.addRange(w)}}r.sort(rs(u=>u.original.startLineNumber,Rr));const h=new By(o);for(let u=0;u<r.length;u++){const g=r[u],f=h.findLastMonotonous(k=>k.original.startLineNumber<=g.original.startLineNumber),m=tp(o,k=>k.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-f.original.startLineNumber,g.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(k=>k.original.startLineNumber<g.original.endLineNumberExclusive),C=tp(o,k=>k.modified.startLineNumber<g.modified.endLineNumberExclusive),w=Math.max(b.original.endLineNumberExclusive-g.original.endLineNumberExclusive,C.modified.endLineNumberExclusive-g.modified.endLineNumberExclusive);let v;for(v=0;v<_;v++){const k=g.original.startLineNumber-v-1,x=g.modified.startLineNumber-v-1;if(k>i.length||x>n.length||c.contains(x)||d.contains(k)||!k4(i[k-1],n[x-1],s))break}v>0&&(d.addRange(new Fe(g.original.startLineNumber-v,g.original.startLineNumber)),c.addRange(new Fe(g.modified.startLineNumber-v,g.modified.startLineNumber)));let S;for(S=0;S<w;S++){const k=g.original.endLineNumberExclusive+S,x=g.modified.endLineNumberExclusive+S;if(k>i.length||x>n.length||c.contains(x)||d.contains(k)||!k4(i[k-1],n[x-1],s))break}S>0&&(d.addRange(new Fe(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+S)),c.addRange(new Fe(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+S))),(v>0||S>0)&&(r[u]=new $n(new Fe(g.original.startLineNumber-v,g.original.endLineNumberExclusive+S),new Fe(g.modified.startLineNumber-v,g.modified.endLineNumberExclusive+S)))}return r}function k4(o,e,t){if(o.trim()===e.trim())return!0;if(o.length>300&&e.length>300)return!1;const n=new MH().compute(new cS([o],new L(1,1,1,o.length),!1),new cS([e],new L(1,1,1,e.length),!1),t);let s=0;const r=ji.invert(n.diffs,o.length);for(const d of r)d.seq1Range.forEach(h=>{XI(o.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;u<o.length;u++)XI(d.charCodeAt(u))||h++;return h}const l=a(o.length>e.length?o:e);return s/l>.6&&l>10}function KX(o){if(o.length===0)return o;o.sort(rs(t=>t.original.startLineNumber,Rr));const e=[o[0]];for(let t=1;t<o.length;t++){const i=
|
||
|
|
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function N4(o){let e=0;for(;e<o.length&&(o.charCodeAt(e)===32||o.charCodeAt(e)===9);)e++;return e}class AH{constructor(){this.dynamicProgrammingDiffing=new WX,this.myersDiffingAlgorithm=new MH}computeDiff(e,t,i){if(e.length<=1&&Jt(e,t,(S,k)=>S===k))return new Qw([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Qw([new No(new Fe(1,e.length+1),new Fe(1,t.length+1),[new vo(new L(1,1,e.length,e[e.length-1].length+1),new L(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?VC.instance:new FX(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(S){let k=r.get(S);return k===void 0&&(k=r.size,r.set(S,k)),k}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),d=new E4(l,e),h=new E4(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(S,k)=>e[S]===t[k]?t[k].length===0?.1:1+Math.log(1+t[k].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let g=u.diffs,f=u.hitTimeout;g=QI(d,h,g),g=QX(d,h,g);const m=[],_=S=>{if(s)for(let k=0;k<S;k++){const x=b+k,E=C+k;if(e[x]!==t[E]){const N=this.refineDiff(e,t,new ji(new je(x,x+1),new je(E,E+1)),n,s);for(const z of N.mappings)m.push(z);N.hitTimeout&&(f=!0)}}};let b=0,C=0;for(const S of g){Du(()=>S.seq1Range.start-b===S.seq2Range.start-C);const k=S.seq1Range.start-b;_(k),b=S.seq1Range.endExclusive,C=S.seq2Range.endExclusive;const x=this.refineDiff(e,t,S,n,s);x.hitTimeout&&(f=!0);for(const E of x.mappings)m.push(E)}_(e.length-b);const w=T4(m,e,t);let v=[];return i.computeMoves&&(v=this.computeMoves(w,e,t,l,c,n,s)),Du(()=>{function S(x,E){if(x.lineNumber<1||x.lineNumber>E.length)return!1;const N=E[x.lineNumber-1];return!(x.column<1||x.column>N.length+1)}function k(x,E){return!(x.startLineNumber<1||x.startLineNumber>E.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>E.length+1)}for(const x of w){if(!x.innerChanges)return!1;for(const E of x.innerChanges)if(!(S(E.modifiedRange.getStartPosition(),t)&&S(E.modifiedRange.getEndPosition(),t)&&S(E.originalRange.getStartPosition(),e)&&S(E.originalRange.getEndPosition(),e)))return!1;if(!k(x.modified,t)||!k(x.original,e))return!1}return!0}),new Qw(w,v,f)}computeMoves(e,t,i,n,s,r,a){return zX(e,t,i,n,s,r).map(d=>{const h=this.refineDiff(t,i,new ji(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=T4(h.mappings,t,i,!0);return new NH(d,u)})}refineDiff(e,t,i,n,s){const a=tQ(i).toRangeMapping2(e,t),l=new cS(e,a.originalRange,s),c=new cS(t,a.modifiedRange,s),d=l.length+c.length<500?this.dynamicProgrammingDiffing.compute(l,c,n):this.myersDiffingAlgorithm.compute(l,c,n);let h=d.diffs;return h=QI(l,c,h),h=YX(l,c,h),h=ZX(l,c,h),h=JX(l,c,h),{mappings:h.map(g=>new vo(l.translateRange(g.seq1Range),c.translateRange(g.seq2Range))),hitTimeout:d.hitTimeout}}}function T4(o,e,t,i=!1){const n=[];for(const s of BM(o.map(r=>eQ(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=s[0],a=s[s.length-1];n.push(new No(r.original.join(a.original),r.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return Du(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:vA(n,(s,r)=>r.original.startLineNumber-s.original.endLineNumberExclusive===r.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<r.original.startLineNumber&&s.modified.endLineNumberExclusive<r.modified.startLineNumber)),n}function eQ(o,e,t){let i=0,n=0;o.modifiedRange.endColumn===1&&o.originalRange.endColumn===1&&o.originalRange.startLineNumber+i<=o.originalRange.endLineNumber&&o.modifiedRange.startLineNumber+i<=o.modifiedRange.endLineNumber&&(n=-1),o.modifiedRange.startColumn-1>=t[o.modifiedRange.startLineNumber-1].length&&o.originalRange.startColumn-1>=e[o.originalRange.startLineNumber-1].length&&o.originalRange.startLineNumber<=o.originalRange.endLineNumber+n&&o.modifiedRange.startLineNumber<=
|
||
|
|
`)}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 kQ{constructor(e,t,i,n,s,r,a){this.id=++$H,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new V4),this.removedResources.has(t)||this.removedResources.set(t,new H4(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 V4),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new H4(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class jH{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
|
||
|
|
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new UH(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Xx{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 KH=new jH("","");KH.locked=!0;let sE=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
|
||
|
|
`))}pushElement(e,t=gS.None,i=ed.None){if(e.type===0){const n=Hv(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new Vv(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],r=[];for(const a of e.resources){const l=Hv(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),s.push(l),r.push(c))}s.length===1?this._pushElement(new Vv(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new kQ(e,s,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],s=e.strResources[t];let r;this._editStacks.has(s)?r=this._editStacks.get(s):(r=new jH(n,s),this._editStacks.set(s,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=Hv(s.resource),a=this.getUriComparisonKey(s.resource),l=new Vv(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=Hv(s.resource),a=this.getUriComparisonKey(s.resource),l=new Vv(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new UH(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof ed){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){Me(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return F.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?F.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(F.None);const i=e.actual.prepareUndoRedo();return i?my(i)?t(i):i.then(n=>t(n)):t(F.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||KH);return new Xx(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new zv(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new zv}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)
|
||
|
|
`)}}const Uy=new tJ;ri.add(t8.ColorContribution,Uy);function I(o,e,t,i,n){return Uy.registerColor(o,e,t,i,n)}function iJ(o,e){switch(o.op){case 0:return Kr(o.value,e)?.darken(o.factor);case 1:return Kr(o.value,e)?.lighten(o.factor);case 2:return Kr(o.value,e)?.transparent(o.factor);case 3:{const t=Kr(o.background,e);return t?Kr(o.value,e)?.makeOpaque(t):Kr(o.value,e)}case 4:for(const t of o.values){const i=Kr(t,e);if(i)return i}return;case 6:return Kr(e.defines(o.if)?o.then:o.else,e);case 5:{const t=Kr(o.value,e);if(!t)return;const i=Kr(o.background,e);return i?t.isDarkerThan(i)?$.getLighterColor(t,i,o.factor).transparent(o.transparency):$.getDarkerColor(t,i,o.factor).transparent(o.transparency):t.transparent(o.factor*o.transparency)}default:throw Ay()}}function Xu(o,e){return{op:0,value:o,factor:e}}function pa(o,e){return{op:1,value:o,factor:e}}function ze(o,e){return{op:2,value:o,factor:e}}function Lb(...o){return{op:4,values:o}}function nJ(o,e,t){return{op:6,if:o,then:e,else:t}}function J4(o,e,t,i){return{op:5,value:o,background:e,factor:t,transparency:i}}function Kr(o,e){if(o!==null){if(typeof o=="string")return o[0]==="#"?$.fromHex(o):e.getColor(o);if(o instanceof $)return o;if(typeof o=="object")return iJ(o,e)}}const i8="vscode://schemas/workbench-colors",n8=ri.as(Wy.JSONContribution);n8.registerSchema(i8,Uy.getColorSchema());const e5=new yt(()=>n8.notifySchemaChanged(i8),200);Uy.onDidChangeSchema(()=>{e5.isScheduled()||e5.schedule()});const Ke=I("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));I("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));I("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));I("descriptionForeground",{light:"#717171",dark:ze(Ke,.7),hcDark:ze(Ke,.7),hcLight:ze(Ke,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const mS=I("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),hl=I("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),ot=I("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Gt=I("contrastActiveBorder",{light:null,dark:null,hcDark:hl,hcLight:hl},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));I("selection.background",null,p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const sJ=I("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));I("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));I("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:$.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));I("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPreformatForeground","Foreground color for preformatted text segments."));I("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},p("te
|
||
|
|
`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function ste(o,e){return _E(o,e)!==0}function _E(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const ote=new RegExp(`(\\\\)?\\$\\((${xe.iconNameExpression}(?:${xe.iconModifierExpression})?)\\)`,"g");function Dd(o){const e=new Array;let t,i=0,n=0;for(;(t=ote.exec(o))!==null;){n=t.index||0,i<n&&e.push(o.substring(i,n)),i=(t.index||0)+t[0].length;const[,s,r]=t;e.push(s?`$(${r})`:Eu({id:r}))}return i<o.length&&e.push(o.substring(i)),e}function Eu(o){const e=ie("span");return e.classList.add(...xe.asClassNameArray(o)),e}function rte(o){const e=ate(o);if(e&&e.length>0)return new Uint32Array(e)}let mo=0;const td=new Uint32Array(10);function ate(o){if(mo=0,Aa(o,nk,4352),mo>0||(Aa(o,sk,4449),mo>0)||(Aa(o,ok,4520),mo>0)||(Aa(o,gh,12593),mo))return td.subarray(0,mo);if(o>=44032&&o<=55203){const e=o-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i<nk.length?Aa(i,nk,0):4352+i-12593<gh.length&&Aa(4352+i,gh,12593),n<sk.length?Aa(n,sk,0):4449+n-12593<gh.length&&Aa(4449+n-12593,gh,12593),s>=0&&(s<ok.length?Aa(s,ok,0):4520+s-12593<gh.length&&Aa(4520+s-12593,gh,12593)),mo>0)return td.subarray(0,mo)}}function Aa(o,e,t){o>=t&&o<t+e.length&<e(e[o-t])}function lte(o){o!==0&&(td[mo++]=o&255,o>>8&&(td[mo++]=o>>8&255),o>>16&&(td[mo++]=o>>16&255))}const nk=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),sk=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),ok=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),gh=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function YA(...o){return function(e,t){for(let i=0,n=o.length;i<n;i++){const s=o[i](e,t);if(s)return s}return null}}k8.bind(void 0,!1);const Tb=k8.bind(void 0,!0);function k8(o,e,t){if(!t||t.length<e.length)return null;let i;return o?i=tA(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function D8(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t===-1?null:[{start:t,end:t+o.length}]}function I8(o,e){return bE(o.toLowerCase(),e.toLowerCase(),0,0)}function bE(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]===e[i]){let n=null;return(n=bE(o,e,t+1,i+1))?JA({start:i,end:i+1},n):null}return bE(o,e,t,i+1)}function XA(o){return 97<=o&&o<=122}function Jy(o){return 65<=o&&o<=90}function QA(o){return 48<=o&&o<=57}function E8(o){return o===32||o===9||o===10||o===13}const N8=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>N8.add(o.charCodeAt(0)));function CS(o){return E8(o)||N8.has(o)}function u5(o,e){return o===e||CS(o)&&CS(e)}const rk=new Map;function g5(o){if(rk.has(o))return rk.get(o);let e;const t=rte(o);return t&&(e=t),rk.set(o,e),e}function T8(o){return XA(o)||Jy(o)||QA(o)}function JA(o,e){return e.length===0?e=[o]:o.end===e[0].start?e[0].start=o.start:e.unshift(o),e}function R8(o,e){for(let t=e;t<o.length;t++){const i=o.charCodeAt(t);if(Jy(i)||QA(i)||t>0&&!T8(o.charCodeAt(t-1)))return t}return o.length}function CE(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=CE(o,e,t+1,i+1);!n&&(s=R8(e,s))<e.length;)n=CE(o,e,t+1,s),s++;return n===null?null:JA({start:i,end:i+1},n)}}function cte(o){let e=0,t=0,i=0,n=0,s=0;for(let d=0;d<o.length;d++)s=o.charCodeAt(d),Jy(s)&&e++,XA(s)&&t++,T8(s)&&i++,QA(s)&&n++;const r=e/o.length,a=t/o.length,l=i/o.length,c=n/o.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:c}}function dte(o){const{upperPercent:e,lowerPercent:t}=o;return t===0&&e>.6}funct
|
||
|
|
`:`
|
||
|
|
|
||
|
|
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`
|
||
|
|
${Bte(t,e)}
|
||
|
|
`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Ro(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function lp(o){return _a(o)?!o.value:Array.isArray(o)?o.every(lp):!0}function _a(o){return o instanceof Rn?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0):!1}function Fte(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&Rb(ve.from(o.baseUri),ve.from(e.baseUri)))}function Wte(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Bte(o,e){const t=o.match(/^`+/gm)?.reduce((n,s)=>n.length>s.length?n:s).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,o,`${"`".repeat(i)}`].join(`
|
||
|
|
`)}function qv(o){return o.replace(/"/g,""")}function ck(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Hte(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}class s2{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const SE=new s2("id#");let On={};(function(){function o(e,t){t(On)}o.amd=!0,(function(e,t){typeof o=="function"&&o.amd?o(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))})(this,(function(e){function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}e.defaults=t();function i(lt){e.defaults=lt}const n=/[&<>"']/,s=new RegExp(n.source,"g"),r=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,a=new RegExp(r.source,"g"),l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=lt=>l[lt];function d(lt,T){if(T){if(n.test(lt))return lt.replace(s,c)}else if(r.test(lt))return lt.replace(a,c);return lt}const h=/(^|[^\[])\^/g;function u(lt,T){let R=typeof lt=="string"?lt:lt.source;T=T||"";const P={replace:(B,j)=>{let te=typeof j=="string"?j:j.source;return te=te.replace(h,"$1"),R=R.replace(B,te),P},getRegex:()=>new RegExp(R,T)};return P}function g(lt){try{lt=encodeURI(lt).replace(/%25/g,"%")}catch{return null}return lt}const f={exec:()=>null};function m(lt,T){const R=lt.replace(/\|/g,(j,te,ae)=>{let De=!1,Ae=te;for(;--Ae>=0&&ae[Ae]==="\\";)De=!De;return De?"|":" |"}),P=R.split(/ \|/);let B=0;if(P[0].trim()||P.shift(),P.length>0&&!P[P.length-1].trim()&&P.pop(),T)if(P.length>T)P.splice(T);else for(;P.length<T;)P.push("");for(;B<P.length;B++)P[B]=P[B].trim().replace(/\\\|/g,"|");return P}function _(lt,T,R){const P=lt.length;if(P===0)return"";let B=0;for(;B<P&<.charAt(P-B-1)===T;)B++;return lt.slice(0,P-B)}function b(lt,T){if(lt.indexOf(T[1])===-1)return-1;let R=0;for(let P=0;P<lt.length;P++)if(lt[P]==="\\")P++;else if(lt[P]===T[0])R++;else if(lt[P]===T[1]&&(R--,R<0))return P;return-1}function C(lt,T,R,P){const B=T.href,j=T.title?d(T.title):null,te=lt[1].replace(/\\([\[\]])/g,"$1");if(lt[0].charAt(0)!=="!"){P.state.inLink=!0;const ae={type:"link",raw:R,href:B,title:j,text:te,tokens:P.inlineTokens(te)};return P.state.inLink=!1,ae}return{type:"image",raw:R,href:B,title:j,text:d(te)}}function w(lt,T){const R=lt.match(/^(\s+)(?:```)/);if(R===null)return T;const P=R[1];return T.split(`
|
||
|
|
`).map(B=>{const j=B.match(/^\s+/);if(j===null)return B;const[te]=j;return te.length>=P.length?B.slice(P.length):B}).join(`
|
||
|
|
`)}class v{options;rules;lexer;constructor(T){this.options=T||e.defaults}space(T){const R=this.rules.block.newline.exec(T);if(R&&R[0].length>0)return{type:"space",raw:R[0]}}code(T){const R=this.rules.block.code.exec(T);if(R){const P=R[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:R[0],codeBlockStyle:"indented",text:this.options.pedantic?P:_(P,`
|
||
|
|
`)}}}fences(T){const R=this.rules.block.fences.exec(T);if(R){const P=R[0],B=w(P,R[3]||"");return{type:"code",raw:P,lang:R[2]?R[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):R[2],text:B}}}heading(T){const R=this.rules.block.heading.exec(T);if(R){let P=R[2].trim();if(/#$/.test(P)){const B=_(P,"#");(this.options.pedantic||!B||/ $/.test(B))&&(P=B.trim())}return{type:"heading",raw:R[0],depth:R[1].length,text:P,tokens:this.lexer.inline(P)}}}hr(T){const R=this.rules.block.hr.exec(T);if(R)return{type:"hr",raw:_(R[0],`
|
||
|
|
`)}}blockquote(T){const R=this.rules.block.blockquote.exec(T);if(R){let P=_(R[0],`
|
||
|
|
`).split(`
|
||
|
|
`),B="",j="";const te=[];for(;P.length>0;){let ae=!1;const De=[];let Ae;for(Ae=0;Ae<P.length;Ae++)if(/^ {0,3}>/.test(P[Ae]))De.push(P[Ae]),ae=!0;else if(!ae)De.push(P[Ae]);else break;P=P.slice(Ae);const st=De.join(`
|
||
|
|
`),kt=st.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
||
|
|
$1`).replace(/^ {0,3}>[ \t]?/gm,"");B=B?`${B}
|
||
|
|
${st}`:st,j=j?`${j}
|
||
|
|
${kt}`:kt;const Pt=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(kt,te,!0),this.lexer.state.top=Pt,P.length===0)break;const Xi=te[te.length-1];if(Xi?.type==="code")break;if(Xi?.type==="blockquote"){const vi=Xi,Ws=vi.raw+`
|
||
|
|
`+P.join(`
|
||
|
|
`),Uo=this.blockquote(Ws);te[te.length-1]=Uo,B=B.substring(0,B.length-vi.raw.length)+Uo.raw,j=j.substring(0,j.length-vi.text.length)+Uo.text;break}else if(Xi?.type==="list"){const vi=Xi,Ws=vi.raw+`
|
||
|
|
`+P.join(`
|
||
|
|
`),Uo=this.list(Ws);te[te.length-1]=Uo,B=B.substring(0,B.length-Xi.raw.length)+Uo.raw,j=j.substring(0,j.length-vi.raw.length)+Uo.raw,P=Ws.substring(te[te.length-1].raw.length).split(`
|
||
|
|
`);continue}}return{type:"blockquote",raw:B,tokens:te,text:j}}}list(T){let R=this.rules.block.list.exec(T);if(R){let P=R[1].trim();const B=P.length>1,j={type:"list",raw:"",ordered:B,start:B?+P.slice(0,-1):"",loose:!1,items:[]};P=B?`\\d{1,9}\\${P.slice(-1)}`:`\\${P}`,this.options.pedantic&&(P=B?P:"[*+-]");const te=new RegExp(`^( {0,3}${P})((?:[ ][^\\n]*)?(?:\\n|$))`);let ae=!1;for(;T;){let De=!1,Ae="",st="";if(!(R=te.exec(T))||this.rules.block.hr.test(T))break;Ae=R[0],T=T.substring(Ae.length);let kt=R[2].split(`
|
||
|
|
`,1)[0].replace(/^\t+/,_m=>" ".repeat(3*_m.length)),Pt=T.split(`
|
||
|
|
`,1)[0],Xi=!kt.trim(),vi=0;if(this.options.pedantic?(vi=2,st=kt.trimStart()):Xi?vi=R[1].length+1:(vi=R[2].search(/[^ ]/),vi=vi>4?1:vi,st=kt.slice(vi),vi+=R[1].length),Xi&&/^ *$/.test(Pt)&&(Ae+=Pt+`
|
||
|
|
`,T=T.substring(Pt.length+1),De=!0),!De){const _m=new RegExp(`^ {0,${Math.min(3,vi-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),qe=new RegExp(`^ {0,${Math.min(3,vi-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),G=new RegExp(`^ {0,${Math.min(3,vi-1)}}(?:\`\`\`|~~~)`),Se=new RegExp(`^ {0,${Math.min(3,vi-1)}}#`);for(;T;){const Be=T.split(`
|
||
|
|
`,1)[0];if(Pt=Be,this.options.pedantic&&(Pt=Pt.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),G.test(Pt)||Se.test(Pt)||_m.test(Pt)||qe.test(T))break;if(Pt.search(/[^ ]/)>=vi||!Pt.trim())st+=`
|
||
|
|
`+Pt.slice(vi);else{if(Xi||kt.search(/[^ ]/)>=4||G.test(kt)||Se.test(kt)||qe.test(kt))break;st+=`
|
||
|
|
`+Pt}!Xi&&!Pt.trim()&&(Xi=!0),Ae+=Be+`
|
||
|
|
`,T=T.substring(Be.length+1),kt=Pt.slice(vi)}}j.loose||(ae?j.loose=!0:/\n *\n *$/.test(Ae)&&(ae=!0));let Ws=null,Uo;this.options.gfm&&(Ws=/^\[[ xX]\] /.exec(st),Ws&&(Uo=Ws[0]!=="[ ] ",st=st.replace(/^\[[ xX]\] +/,""))),j.items.push({type:"list_item",raw:Ae,task:!!Ws,checked:Uo,loose:!1,text:st,tokens:[]}),j.raw+=Ae}j.items[j.items.length-1].raw=j.items[j.items.length-1].raw.trimEnd(),j.items[j.items.length-1].text=j.items[j.items.length-1].text.trimEnd(),j.raw=j.raw.trimEnd();for(let De=0;De<j.items.length;De++)if(this.lexer.state.top=!1,j.items[De].tokens=this.lexer.blockTokens(j.items[De].text,[]),!j.loose){const Ae=j.items[De].tokens.filter(kt=>kt.type==="space"),st=Ae.length>0&&Ae.some(kt=>/\n.*\n/.test(kt.raw));j.loose=st}if(j.loose)for(let De=0;De<j.items.length;De++)j.items[De].loose=!0;return j}}html(T){const R=this.rules.block.html.exec(T);if(R)return{type:"html",block:!0,raw:R[0],pre:R[1]==="pre"||R[1]==="script"||R[1]==="style",text:R[0]}}def(T){const R=this.rules.block.def.exec(T);if(R){const P=R[1].toLowerCase().replace(/\s+/g," "),B=R[2]?R[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",j=R[3]?R[3].substring(1,R[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):R[3];return{type:"def",tag:P,raw:R[0],href:B,title:j}}}table(T){const R=this.rules.block.table.exec(T);if(!R||!/[:|]/.test(R[2]))return;const P=m(R[1]),B=R[2].replace(/^\||\| *$/g,"").split("|"),j=R[3]&&R[3].trim()?R[3].replace(/\n[ \t]*$/,"").split(`
|
||
|
|
`):[],te={type:"table",raw:R[0],header:[],align:[],rows:[]};if(P.length===B.length){for(const ae of B)/^ *-+: *$/.test(ae)?te.align.push("right"):/^ *:-+: *$/.test(ae)?te.align.push("center"):/^ *:-+ *$/.test(ae)?te.align.push("left"):te.align.push(null);for(let ae=0;ae<P.length;ae++)te.header.push({text:P[ae],tokens:this.lexer.inline(P[ae]),header:!0,align:te.align[ae]});for(const ae of j)te.rows.push(m(ae,te.header.length).map((De,Ae)=>({text:De,tokens:this.lexer.inline(De),header:!1,align:te.align[Ae]})));return te}}lheading(T){const R=this.rules.block.lheading.exec(T);if(R)return{type:"heading",raw:R[0],depth:R[2].charAt(0)==="="?1:2,text:R[1],tokens:this.lexer.inline(R[1])}}paragraph(T){const R=this.rules.block.paragraph.exec(T);if(R){const P=R[1].charAt(R[1].length-1)===`
|
||
|
|
`?R[1].slice(0,-1):R[1];return{type:"paragraph",raw:R[0],text:P,tokens:this.lexer.inline(P)}}}text(T){const R=this.rules.block.text.exec(T);if(R)return{type:"text",raw:R[0],text:R[0],tokens:this.lexer.inline(R[0])}}escape(T){const R=this.rules.inline.escape.exec(T);if(R)return{type:"escape",raw:R[0],text:d(R[1])}}tag(T){const R=this.rules.inline.tag.exec(T);if(R)return!this.lexer.state.inLink&&/^<a /i.test(R[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(R[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(R[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(R[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:R[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:R[0]}}link(T){const R=this.rules.inline.link.exec(T);if(R){const P=R[2].trim();if(!this.options.pedantic&&/^</.test(P)){if(!/>$/.test(P))return;const te=_(P.slice(0,-1),"\\");if((P.length-te.length)%2===0)return}else{const te=b(R[2],"()");if(te>-1){const De=(R[0].indexOf("!")===0?5:4)+R[1].length+te;R[2]=R[2].substring(0,te),R[0]=R[0].substring(0,De).trim(),R[3]=""}}let B=R[2],j="";if(this.options.pedantic){const te=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(B);te&&(B=te[1],j=te[3])}else j=R[3]?R[3].slice(1,-1):"";return B=B.trim(),/^</.test(B)&&(this.options.pedantic&&!/>$/.test(P)?B=B.slice(1):B=B.slice(1,-1)),C(R,{href:B&&B.replace(this.rules.inline.anyPunctuation,"$1"),title:j&&j.replace(this.rules.inline.anyPunctuation,"$1")},R[0],this.lexer)}}reflink(T,R){let P;if((P=this.rules.inline.reflink.exec(T))||(P=this.rules.inline.nolink.exec(T))){const B=(P[2]||P[1]).replace(/\s+/g," "),j=R[B.toLowerCase()];if(!j){const te=P[0].charAt(0);return{type:"text",raw:te,text:te}}return C(P,j,P[0],this.lexer)}}emStrong(T,R,P=""){let B=this.rules.inline.emStrongLDelim.exec(T);if(!B||B[3]&&P.match(/[\p{L}\p{N}]/u))return;if(!(B[1]||B[2]||"")||!P||this.rules.inline.punctuation.exec(P)){const te=[...B[0]].length-1;let ae,De,Ae=te,st=0;const kt=B[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(kt.lastIndex=0,R=R.slice(-1*T.length+te);(B=kt.exec(R))!=null;){if(ae=B[1]||B[2]||B[3]||B[4]||B[5]||B[6],!ae)continue;if(De=[...ae].length,B[3]||B[4]){Ae+=De;continue}else if((B[5]||B[6])&&te%3&&!((te+De)%3)){st+=De;continue}if(Ae-=De,Ae>0)continue;De=Math.min(De,De+Ae+st);const Pt=[...B[0]][0].length,Xi=T.slice(0,te+B.index+Pt+De);if(Math.min(te,De)%2){const Ws=Xi.slice(1,-1);return{type:"em",raw:Xi,text:Ws,tokens:this.lexer.inlineTokens(Ws)}}const vi=Xi.slice(2,-2);return{type:"strong",raw:Xi,text:vi,tokens:this.lexer.inlineTokens(vi)}}}}codespan(T){const R=this.rules.inline.code.exec(T);if(R){let P=R[2].replace(/\n/g," ");const B=/[^ ]/.test(P),j=/^ /.test(P)&&/ $/.test(P);return B&&j&&(P=P.substring(1,P.length-1)),P=d(P,!0),{type:"codespan",raw:R[0],text:P}}}br(T){const R=this.rules.inline.br.exec(T);if(R)return{type:"br",raw:R[0]}}del(T){const R=this.rules.inline.del.exec(T);if(R)return{type:"del",raw:R[0],text:R[2],tokens:this.lexer.inlineTokens(R[2])}}autolink(T){const R=this.rules.inline.autolink.exec(T);if(R){let P,B;return R[2]==="@"?(P=d(R[1]),B="mailto:"+P):(P=d(R[1]),B=P),{type:"link",raw:R[0],text:P,href:B,tokens:[{type:"text",raw:P,text:P}]}}}url(T){let R;if(R=this.rules.inline.url.exec(T)){let P,B;if(R[2]==="@")P=d(R[0]),B="mailto:"+P;else{let j;do j=R[0],R[0]=this.rules.inline._backpedal.exec(R[0])?.[0]??"";while(j!==R[0]);P=d(R[0]),R[1]==="www."?B="http://"+R[0]:B=R[0]}return{type:"link",raw:R[0],text:P,href:B,tokens:[{type:"text",raw:P,text:P}]}}}inlineText(T){const R=this.rules.inline.text.exec(T);if(R){let P;return this.lexer.state.inRawBlock?P=R[0]:P=d(R[0]),{type:"text",raw:R[0],text:P}}}}const S=/^(?: *(?:\n|$))+/,k=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,x=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N=/^ {0,3}(#{1,6})(?=\s|$)(.*)(
|
||
|
|
]`).replace("lheading",W).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ki=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pi=/^( {2,}|\\)\n(?!\s*$)/,pr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pc="\\p{P}\\p{S}",Lv=u(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Pc).getRegex(),Oc=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,gm=u(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Pc).getRegex(),Dl=u("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Pc).getRegex(),fm=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Pc).getRegex(),pm=u(/\\([punct])/,"gu").replace(/punct/g,Pc).getRegex(),Fc=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ug=u(me).replace("(?:-->|$)","-->").getRegex(),gg=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ug).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ch=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xv=u(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ch).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kv=u(/^!?\[(label)\]\[(ref)\]/).replace("label",ch).replace("ref",H).getRegex(),fg=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",H).getRegex(),dh=u("reflink|nolink(?!\\()","g").replace("reflink",kv).replace("nolink",fg).getRegex(),Ta={_backpedal:f,anyPunctuation:pm,autolink:Fc,blockSkip:Oc,br:Pi,code:zo,del:f,emStrongLDelim:gm,emStrongRDelimAst:Dl,emStrongRDelimUnd:fm,escape:ki,link:xv,nolink:fg,punctuation:Lv,reflink:kv,reflinkSearch:dh,tag:gg,text:pr,url:f},Wc={...Ta,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",ch).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ch).getRegex()},pg={...Ta,escape:u(ki).replace("])","~|])").getRegex(),url:u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Dv={...pg,br:u(Pi).replace("{2,}","*").getRegex(),text:u(pg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},hh={normal:Xt,gfm:ci,pedantic:xt},Il={normal:Ta,gfm:pg,breaks:Dv,pedantic:Wc};class co{tokens;options;state;tokenizer;inlineQueue;constructor(T){this.tokens=[],this.tokens.links=Object.create(null),this.options=T||e.defaults,this.options.tokenizer=this.options.tokenizer||new v,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const R={block:hh.normal,inline:Il.normal};this.options.pedantic?(R.block=hh.pedantic,R.inline=Il.pedantic):this.options.gfm&&(R.block=hh.gfm,this.options.breaks?R.inline=Il.breaks
|
||
|
|
`),this.blockTokens(T,this.tokens);for(let R=0;R<this.inlineQueue.length;R++){const P=this.inlineQueue[R];this.inlineTokens(P.src,P.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(T,R=[],P=!1){this.options.pedantic?T=T.replace(/\t/g," ").replace(/^ +$/gm,""):T=T.replace(/^( *)(\t+)/gm,(ae,De,Ae)=>De+" ".repeat(Ae.length));let B,j,te;for(;T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(ae=>(B=ae.call({lexer:this},T,R))?(T=T.substring(B.raw.length),R.push(B),!0):!1))){if(B=this.tokenizer.space(T)){T=T.substring(B.raw.length),B.raw.length===1&&R.length>0?R[R.length-1].raw+=`
|
||
|
|
`:R.push(B);continue}if(B=this.tokenizer.code(T)){T=T.substring(B.raw.length),j=R[R.length-1],j&&(j.type==="paragraph"||j.type==="text")?(j.raw+=`
|
||
|
|
`+B.raw,j.text+=`
|
||
|
|
`+B.text,this.inlineQueue[this.inlineQueue.length-1].src=j.text):R.push(B);continue}if(B=this.tokenizer.fences(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.heading(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.hr(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.blockquote(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.list(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.html(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.def(T)){T=T.substring(B.raw.length),j=R[R.length-1],j&&(j.type==="paragraph"||j.type==="text")?(j.raw+=`
|
||
|
|
`+B.raw,j.text+=`
|
||
|
|
`+B.raw,this.inlineQueue[this.inlineQueue.length-1].src=j.text):this.tokens.links[B.tag]||(this.tokens.links[B.tag]={href:B.href,title:B.title});continue}if(B=this.tokenizer.table(T)){T=T.substring(B.raw.length),R.push(B);continue}if(B=this.tokenizer.lheading(T)){T=T.substring(B.raw.length),R.push(B);continue}if(te=T,this.options.extensions&&this.options.extensions.startBlock){let ae=1/0;const De=T.slice(1);let Ae;this.options.extensions.startBlock.forEach(st=>{Ae=st.call({lexer:this},De),typeof Ae=="number"&&Ae>=0&&(ae=Math.min(ae,Ae))}),ae<1/0&&ae>=0&&(te=T.substring(0,ae+1))}if(this.state.top&&(B=this.tokenizer.paragraph(te))){j=R[R.length-1],P&&j?.type==="paragraph"?(j.raw+=`
|
||
|
|
`+B.raw,j.text+=`
|
||
|
|
`+B.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=j.text):R.push(B),P=te.length!==T.length,T=T.substring(B.raw.length);continue}if(B=this.tokenizer.text(T)){T=T.substring(B.raw.length),j=R[R.length-1],j&&j.type==="text"?(j.raw+=`
|
||
|
|
`+B.raw,j.text+=`
|
||
|
|
`+B.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=j.text):R.push(B);continue}if(T){const ae="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(ae);break}else throw new Error(ae)}}return this.state.top=!0,R}inline(T,R=[]){return this.inlineQueue.push({src:T,tokens:R}),R}inlineTokens(T,R=[]){let P,B,j,te=T,ae,De,Ae;if(this.tokens.links){const st=Object.keys(this.tokens.links);if(st.length>0)for(;(ae=this.tokenizer.rules.inline.reflinkSearch.exec(te))!=null;)st.includes(ae[0].slice(ae[0].lastIndexOf("[")+1,-1))&&(te=te.slice(0,ae.index)+"["+"a".repeat(ae[0].length-2)+"]"+te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ae=this.tokenizer.rules.inline.blockSkip.exec(te))!=null;)te=te.slice(0,ae.index)+"["+"a".repeat(ae[0].length-2)+"]"+te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ae=this.tokenizer.rules.inline.anyPunctuation.exec(te))!=null;)te=te.slice(0,ae.index)+"++"+te.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;T;)if(De||(Ae=""),De=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(st=>(P=st.call({lexer:this},T,R))?(T=T.substring(P.raw.length),R.push(P),!0):!1))){if(P=this.tokenizer.escape(T)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.tag(T)){T=T.substring(P.raw.length),B=R[R.length-1],B&&P.type==="text"&&B.type==="text"?(B.raw+=P.raw,B.text+=P.text):R.push(P);continue}if(P=this.tokenizer.link(T)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(P.raw.length),B=R[R.length-1],B&&P.type==="text"&&B.type==="text"?(B.raw+=P.raw,B.text+=P.text):R.push(P);continue}if(P=this.tokenizer.emStrong(T,te,Ae)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.codespan(T)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.br(T)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.del(T)){T=T.substring(P.raw.length),R.push(P);continue}if(P=this.tokenizer.autolink(T)){T=T.substring(P.raw.length),R.push(P);continue}if(!this.state.inLink&&(P=this.tokenizer.url(T))){T=T.substring(P.raw.length),R.push(P);continue}if(j=T,this.options.extensions&&this.options.extensions.startInline){let st=1/0;const kt=T.slice(1);let Pt;this.options.extensions.startInline.forEach(Xi=>{Pt=Xi.call({lexer:this},kt),typeof Pt=="number"&&Pt>=0&&(st=Math.min(st,Pt))}),st<1/0&&st>=0&&(j=T.substring(0,st+1))}if(P=this.tokenizer.inlineText(j)){T=T.substring(P.raw.length),P.raw.slice(-1)!=="_"&&(Ae=P.raw.slice(-1)),De=!0,B=R[R.length-1],B&&B.type==="text"?(B.raw+=P.raw,B.text+=P.text):R.push(P);continue}if(T){const st="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return R}}class Ra{options;parser;constructor(T){this.options=T||e.defaults}space(T){return""}code({text:T,lang:R,escaped:P}){const B=(R||"").match(/^\S*/)?.[0],j=T.replace(/\n$/,"")+`
|
||
|
|
`;return B?'<pre><code class="language-'+d(B)+'">'+(P?j:d(j,!0))+`</code></pre>
|
||
|
|
`:"<pre><code>"+(P?j:d(j,!0))+`</code></pre>
|
||
|
|
`}blockquote({tokens:T}){return`<blockquote>
|
||
|
|
${this.parser.parse(T)}</blockquote>
|
||
|
|
`}html({text:T}){return T}heading({tokens:T,depth:R}){return`<h${R}>${this.parser.parseInline(T)}</h${R}>
|
||
|
|
`}hr(T){return`<hr>
|
||
|
|
`}list(T){const R=T.ordered,P=T.start;let B="";for(let ae=0;ae<T.items.length;ae++){const De=T.items[ae];B+=this.listitem(De)}const j=R?"ol":"ul",te=R&&P!==1?' start="'+P+'"':"";return"<"+j+te+`>
|
||
|
|
`+B+"</"+j+`>
|
||
|
|
`}listitem(T){let R="";if(T.task){const P=this.checkbox({checked:!!T.checked});T.loose?T.tokens.length>0&&T.tokens[0].type==="paragraph"?(T.tokens[0].text=P+" "+T.tokens[0].text,T.tokens[0].tokens&&T.tokens[0].tokens.length>0&&T.tokens[0].tokens[0].type==="text"&&(T.tokens[0].tokens[0].text=P+" "+T.tokens[0].tokens[0].text)):T.tokens.unshift({type:"text",raw:P+" ",text:P+" "}):R+=P+" "}return R+=this.parser.parse(T.tokens,!!T.loose),`<li>${R}</li>
|
||
|
|
`}checkbox({checked:T}){return"<input "+(T?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:T}){return`<p>${this.parser.parseInline(T)}</p>
|
||
|
|
`}table(T){let R="",P="";for(let j=0;j<T.header.length;j++)P+=this.tablecell(T.header[j]);R+=this.tablerow({text:P});let B="";for(let j=0;j<T.rows.length;j++){const te=T.rows[j];P="";for(let ae=0;ae<te.length;ae++)P+=this.tablecell(te[ae]);B+=this.tablerow({text:P})}return B&&(B=`<tbody>${B}</tbody>`),`<table>
|
||
|
|
<thead>
|
||
|
|
`+R+`</thead>
|
||
|
|
`+B+`</table>
|
||
|
|
`}tablerow({text:T}){return`<tr>
|
||
|
|
${T}</tr>
|
||
|
|
`}tablecell(T){const R=this.parser.parseInline(T.tokens),P=T.header?"th":"td";return(T.align?`<${P} align="${T.align}">`:`<${P}>`)+R+`</${P}>
|
||
|
|
`}strong({tokens:T}){return`<strong>${this.parser.parseInline(T)}</strong>`}em({tokens:T}){return`<em>${this.parser.parseInline(T)}</em>`}codespan({text:T}){return`<code>${T}</code>`}br(T){return"<br>"}del({tokens:T}){return`<del>${this.parser.parseInline(T)}</del>`}link({href:T,title:R,tokens:P}){const B=this.parser.parseInline(P),j=g(T);if(j===null)return B;T=j;let te='<a href="'+T+'"';return R&&(te+=' title="'+R+'"'),te+=">"+B+"</a>",te}image({href:T,title:R,text:P}){const B=g(T);if(B===null)return P;T=B;let j=`<img src="${T}" alt="${P}"`;return R&&(j+=` title="${R}"`),j+=">",j}text(T){return"tokens"in T&&T.tokens?this.parser.parseInline(T.tokens):T.text}}class El{strong({text:T}){return T}em({text:T}){return T}codespan({text:T}){return T}del({text:T}){return T}html({text:T}){return T}text({text:T}){return T}link({text:T}){return""+T}image({text:T}){return""+T}br(){return""}}class rn{options;renderer;textRenderer;constructor(T){this.options=T||e.defaults,this.options.renderer=this.options.renderer||new Ra,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new El}static parse(T,R){return new rn(R).parse(T)}static parseInline(T,R){return new rn(R).parseInline(T)}parse(T,R=!0){let P="";for(let B=0;B<T.length;B++){const j=T[B];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[j.type]){const ae=j,De=this.options.extensions.renderers[ae.type].call({parser:this},ae);if(De!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(ae.type)){P+=De||"";continue}}const te=j;switch(te.type){case"space":{P+=this.renderer.space(te);continue}case"hr":{P+=this.renderer.hr(te);continue}case"heading":{P+=this.renderer.heading(te);continue}case"code":{P+=this.renderer.code(te);continue}case"table":{P+=this.renderer.table(te);continue}case"blockquote":{P+=this.renderer.blockquote(te);continue}case"list":{P+=this.renderer.list(te);continue}case"html":{P+=this.renderer.html(te);continue}case"paragraph":{P+=this.renderer.paragraph(te);continue}case"text":{let ae=te,De=this.renderer.text(ae);for(;B+1<T.length&&T[B+1].type==="text";)ae=T[++B],De+=`
|
||
|
|
`+this.renderer.text(ae);R?P+=this.renderer.paragraph({type:"paragraph",raw:De,text:De,tokens:[{type:"text",raw:De,text:De}]}):P+=De;continue}default:{const ae='Token with "'+te.type+'" type was not found.';if(this.options.silent)return console.error(ae),"";throw new Error(ae)}}}return P}parseInline(T,R){R=R||this.renderer;let P="";for(let B=0;B<T.length;B++){const j=T[B];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[j.type]){const ae=this.options.extensions.renderers[j.type].call({parser:this},j);if(ae!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(j.type)){P+=ae||"";continue}}const te=j;switch(te.type){case"escape":{P+=R.text(te);break}case"html":{P+=R.html(te);break}case"link":{P+=R.link(te);break}case"image":{P+=R.image(te);break}case"strong":{P+=R.strong(te);break}case"em":{P+=R.em(te);break}case"codespan":{P+=R.codespan(te);break}case"br":{P+=R.br(te);break}case"del":{P+=R.del(te);break}case"text":{P+=R.text(te);break}default:{const ae='Token with "'+te.type+'" type was not found.';if(this.options.silent)return console.error(ae),"";throw new Error(ae)}}}return P}}class mr{options;constructor(T){this.options=T||e.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(T){return T}postprocess(T){return T}processAllTokens(T){return T}}class mg{defaults=t();options=this.setOptions;parse=this.parseMarkdown(co.lex,rn.parse);parseInline=this.parseMarkdown(co.lexInline,rn.parseInline);Parser=rn;Renderer=Ra;TextRenderer=El;Lexer=co;Tokenizer=v;Hooks=mr;constructor(...T){this.use(...T)}walkTokens(T,R){let P=[];for(const B of T)switch(P=P.concat(R.call(this,B)),B.type){case"table":{const j=B;for(const te of j.header)P=P.concat(this.walkTokens(te.tokens,R));for(const te of j.rows)for(const ae of te)P=P.concat(this.walkTokens(ae.tokens,R));break}case"list":{const j=B;P=P.concat(this.walkTokens(j.items,R));break}default:{const j=B;this.defaults.extensions?.childTokens?.[j.type]?this.defaults.extensions.childTokens[j.type].forEach(te=>{const ae=j[te].flat(1/0);P=P.concat(this.walkTokens(ae,R))}):j.tokens&&(P=P.concat(this.walkTokens(j.tokens,R)))}}return P}use(...T){const R=this.defaults.extensions||{renderers:{},childTokens:{}};return T.forEach(P=>{const B={...P};if(B.async=this.defaults.async||B.async||!1,P.extensions&&(P.extensions.forEach(j=>{if(!j.name)throw new Error("extension name required");if("renderer"in j){const te=R.renderers[j.name];te?R.renderers[j.name]=function(...ae){let De=j.renderer.apply(this,ae);return De===!1&&(De=te.apply(this,ae)),De}:R.renderers[j.name]=j.renderer}if("tokenizer"in j){if(!j.level||j.level!=="block"&&j.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const te=R[j.level];te?te.unshift(j.tokenizer):R[j.level]=[j.tokenizer],j.start&&(j.level==="block"?R.startBlock?R.startBlock.push(j.start):R.startBlock=[j.start]:j.level==="inline"&&(R.startInline?R.startInline.push(j.start):R.startInline=[j.start]))}"childTokens"in j&&j.childTokens&&(R.childTokens[j.name]=j.childTokens)}),B.extensions=R),P.renderer){const j=this.defaults.renderer||new Ra(this.defaults);for(const te in P.renderer){if(!(te in j))throw new Error(`renderer '${te}' does not exist`);if(["options","parser"].includes(te))continue;const ae=te,De=P.renderer[ae],Ae=j[ae];j[ae]=(...st)=>{let kt=De.apply(j,st);return kt===!1&&(kt=Ae.apply(j,st)),kt||""}}B.renderer=j}if(P.tokenizer){const j=this.defaults.tokenizer||new v(this.defaults);for(const te in P.tokenizer){if(!(te in j))throw new Error(`tokenizer '${te}' does not exist`);if(["options","rules","lexer"].includes(te))continue;const ae=te,De=P.tokenizer[ae],Ae=j[ae];j[ae]=(...st)=>{let kt=De.apply(j,st);return kt===!1&&(kt=Ae.apply(j,st)),kt}}B.tokenizer=j}if(P.hooks){const j=this.defaults.hooks||new mr;for(const te in P.hooks){if(!(te in j))throw new Error(`hook '${te}' does not exist`);if(te==="options")continue;const ae=te,De=P.hooks[ae],Ae=j[ae];mr.passThroughHooks.has(te)?j[ae]=st=>{if(this.defaults.async)retu
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,T){const B="<p>An error occurred:</p><pre>"+d(P.message+"",!0)+"</pre>";return R?Promise.resolve(B):B}if(R)return Promise.reject(P);throw P}}}const $r=new mg;function ti(lt,T){return $r.parse(lt,T)}ti.options=ti.setOptions=function(lt){return $r.setOptions(lt),ti.defaults=$r.defaults,i(ti.defaults),ti},ti.getDefaults=t,ti.defaults=e.defaults,ti.use=function(...lt){return $r.use(...lt),ti.defaults=$r.defaults,i(ti.defaults),ti},ti.walkTokens=function(lt,T){return $r.walkTokens(lt,T)},ti.parseInline=$r.parseInline,ti.Parser=rn,ti.parser=rn.parse,ti.Renderer=Ra,ti.TextRenderer=El,ti.Lexer=co,ti.lexer=co.lex,ti.Tokenizer=v,ti.Hooks=mr,ti.parse=ti;const uh=ti.options,_x=ti.setOptions,bx=ti.use,mn=ti.walkTokens,Bc=ti.parseInline,Cx=ti,Iv=rn.parse,mm=co.lex;e.Hooks=mr,e.Lexer=co,e.Marked=mg,e.Parser=rn,e.Renderer=Ra,e.TextRenderer=El,e.Tokenizer=v,e.getDefaults=t,e.lexer=mm,e.marked=ti,e.options=uh,e.parse=Cx,e.parseInline=Bc,e.parser=Iv,e.setOptions=_x,e.use=bx,e.walkTokens=mn}))})();On.Hooks||exports.Hooks;On.Lexer||exports.Lexer;On.Marked||exports.Marked;On.Parser||exports.Parser;var F8=On.Renderer||exports.Renderer;On.TextRenderer||exports.TextRenderer;On.Tokenizer||exports.Tokenizer;var Vte=On.defaults||exports.defaults;On.getDefaults||exports.getDefaults;var tL=On.lexer||exports.lexer;On.marked||exports.marked;On.options||exports.options;var W8=On.parse||exports.parse;On.parseInline||exports.parseInline;var zte=On.parser||exports.parser;On.setOptions||exports.setOptions;On.use||exports.use;On.walkTokens||exports.walkTokens;function Ute(o){return JSON.stringify(o,$te)}function yE(o){let e=JSON.parse(o);return e=LE(e),e}function $te(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function LE(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return ve.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof Oy||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t<o.length;++t)o[t]=LE(o[t],e+1);else for(const t in o)Object.hasOwnProperty.call(o,t)&&(o[t]=LE(o[t],e+1))}return o}const dk=Object.freeze({image:({href:o,title:e,text:t})=>{let i=[],n=[];return o&&({href:o,dimensions:i}=Hte(o),n.push(`src="${qv(o)}"`)),t&&n.push(`alt="${qv(t)}"`),e&&n.push(`title="${qv(e)}"`),i.length&&(n=n.concat(i)),"<img "+n.join(" ")+">"},paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>`},link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof o!="string"?"":(o===i&&(i=ck(i)),e=typeof e=="string"?qv(ck(e)):"",o=ck(o),o=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${o}" title="${e||o}" draggable="false">${i}</a>`)}});function iL(o,e={},t={}){const i=new K;let n=!1;const s=ZA(e),r=function(m){let _;try{_=yE(decodeURIComponent(m))}catch{}return _?(_=Y7(_,b=>{if(o.uris&&o.uris[b])return ve.revive(o.uris[b])}),encodeURIComponent(JSON.stringify(_))):m},a=function(m,_){const b=o.uris&&o.uris[m];let C=ve.revive(b);return _?m.startsWith(Pe.data+":")?m:(C||(C=ve.parse(m)),vy.uriToBrowserUri(C).toString(!0)):!C||ve.parse(m).toString()===C.toString()?m:(C.query&&(C=C.with({query:r(C.query)})),C.toString())},l=new F8;l.image=dk.image,l.link=dk.link,l.paragraph=dk.paragraph;const c=[],d=[];if(e.codeBlockRendererSync?l.code=({text:m,lang:_})=>{const b=SE.nextId(),C=e.codeBlockRendererSync(v5(_),m);return d.push([b,C]),`<div class="code" data-code="${b}">${w_(m)}</div>`}:e.codeBlockRenderer&&(l.code=({text:m,lang:_})=>{const b=SE.nextId(),C=e.codeBlockRenderer(v5(_),m);return c.push(C.then(w=>[b,w])),`<div class="code" data-code="${b}">${w_(m)}</div>`}),e.actionHandler){const m=function(C){let w=C.target;if(!(w.tagName!=="A"&&(w=w.parentElement,!w||w.tagName!=="A")))try{let v=w.dataset.href;v&&(o.baseUri&&(v=hk(ve.from(o.baseUri),v)),e.actionHandler.callback(v,C))}catch(v){Me(v)}finally{C.preventDefault()}},_=e.actionHandler.disposables.add(new Je(s,"click")),b=e.actionHandler.disp
|
||
|
|
`,o.html=e=>"",o.heading=function({tokens:e}){return this.parser.parseInline(e)+`
|
||
|
|
`},o.hr=()=>"",o.list=function({items:e}){return e.map(t=>this.listitem(t)).join(`
|
||
|
|
`)+`
|
||
|
|
`},o.listitem=({text:e})=>e+`
|
||
|
|
`,o.paragraph=function({tokens:e}){return this.parser.parseInline(e)+`
|
||
|
|
`},o.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+`
|
||
|
|
`+t.map(i=>i.map(n=>this.tablecell(n)).join(" ")).join(`
|
||
|
|
`)+`
|
||
|
|
`},o.tablerow=({text:e})=>e,o.tablecell=function({tokens:e}){return this.parser.parseInline(e)},o.strong=({text:e})=>e,o.em=({text:e})=>e,o.codespan=({text:e})=>e,o.br=e=>`
|
||
|
|
`,o.del=({text:e})=>e,o.image=e=>"",o.text=({text:e})=>e,o.link=({text:e})=>e,o}const Qte=new Ca(o=>Xte());function vS(o){let e="";return o.forEach(t=>{e+=t.raw}),e}function B8(o){if(o.tokens)for(let e=o.tokens.length-1;e>=0;e--){const t=o.tokens[e];if(t.type==="text"){const i=t.raw.split(`
|
||
|
|
`),n=i[i.length-1];if(n.includes("`"))return oie(o);if(n.includes("**"))return hie(o);if(n.match(/\*\w/))return rie(o);if(n.match(/(^|\s)__\w/))return uie(o);if(n.match(/(^|\s)_\w/))return aie(o);if(Jte(n)||eie(n)&&o.tokens.slice(0,e).some(s=>s.type==="text"&&s.raw.match(/\[[^\]]*$/))){const s=o.tokens.slice(e+1);return s[0]?.type==="link"&&s[1]?.type==="text"&&s[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?cie(o):lie(o)}else if(n.match(/(^|\s)\[\w*/))return die(o)}}}function Jte(o){return!!o.match(/(^|\s)\[.*\]\(\w*/)}function eie(o){return!!o.match(/^[^\[]*\]\([^\)]*$/)}function tie(o){const e=o.items[o.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if(t?.type==="text"&&!("inRawBlock"in e)&&(i=B8(t)),!i||i.type!=="paragraph")return;const n=vS(o.items.slice(0,-1)),s=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!s)return;const r=s+vS(e.tokens.slice(0,-1))+i.raw,a=tL(n+r)[0];if(a.type==="list")return a}const iie=3;function nie(o){for(let e=0;e<iie;e++){const t=sie(o);if(t)o=t;else break}return o}function sie(o){let e,t;for(e=0;e<o.length;e++){const i=o[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=gie(o.slice(e));break}if(e===o.length-1&&i.type==="list"){const n=tie(i);if(n){t=[n];break}}if(e===o.length-1&&i.type==="paragraph"){const n=B8(i);if(n){t=[n];break}}}if(t){const i=[...o.slice(0,e),...t];return i.links=o.links,i}return null}function oie(o){return eh(o,"`")}function rie(o){return eh(o,"*")}function aie(o){return eh(o,"_")}function lie(o){return eh(o,")")}function cie(o){return eh(o,'")')}function die(o){return eh(o,"](https://microsoft.com)")}function hie(o){return eh(o,"**")}function uie(o){return eh(o,"__")}function eh(o,e){const t=vS(Array.isArray(o)?o:[o]);return tL(t+e)[0]}function gie(o){const e=vS(o),t=e.split(`
|
||
|
|
`);let i,n=!1;for(let s=0;s<t.length;s++){const r=t[s].trim();if(typeof i>"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(`
|
||
|
|
`):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+`
|
||
|
|
|${" --- |".repeat(i)}`;return tL(a)}}function w5(o,e){return j9(o,e),be(()=>K9(o))}class Ni{static{this.defaultTokenMetadata=(32768|2<<24)>>>0}static createEmpty(e,t){const i=Ni.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new Ni(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const s=new Array;for(const{text:r,metadata:a}of e)s.push(i+r.length,a),i+=r.length,n+=r;return new Ni(new Uint32Array(s),n,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof Ni?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,s=n+(i<<1);for(let r=n;r<s;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=Ls.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Ls.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Ls.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Ls.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Ls.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Ls.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Ni.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new o2(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let s=0;s<n;s++)e[s<<1]=e[s+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 s=i+Math.floor((n-i)/2),r=e[s<<1];if(r===t)return s+1;r<t?i=s+1:r>t&&(n=s)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const s=new Array;let r=0;for(;;){const 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 c=this._tokens[(t<<1)+1];s.push(n.length,c),t++,r=a}else if(l){if(l.offset>r){n+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];s.push(n.length,c),r=l.offset}n+=l.text,s.push(n.length,l.tokenMetadata),i++}else break}return new Ni(new Uint32Array(s),n,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i<t;i++)e(i)}}class o2{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let s=this._firstTokenIndex,r=e.getCount();s<r&&!(e.getStartOffset(s)>=i);s++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof o2?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}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}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)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTo
|
||
|
|
:host {
|
||
|
|
all: initial; /* 1st rule so subsequent properties are reset. */
|
||
|
|
}
|
||
|
|
|
||
|
|
.codicon[class*='codicon-'] {
|
||
|
|
font: normal normal normal 16px/1 codicon;
|
||
|
|
display: inline-block;
|
||
|
|
text-decoration: none;
|
||
|
|
text-rendering: auto;
|
||
|
|
text-align: center;
|
||
|
|
-webkit-font-smoothing: antialiased;
|
||
|
|
-moz-osx-font-smoothing: grayscale;
|
||
|
|
user-select: none;
|
||
|
|
-webkit-user-select: none;
|
||
|
|
-ms-user-select: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
:host {
|
||
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
|
||
|
|
}
|
||
|
|
|
||
|
|
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
|
||
|
|
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
|
||
|
|
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
|
||
|
|
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
|
||
|
|
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
|
||
|
|
|
||
|
|
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
|
||
|
|
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
|
||
|
|
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
|
||
|
|
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
|
||
|
|
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
|
||
|
|
|
||
|
|
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
|
||
|
|
:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
|
||
|
|
:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
|
||
|
|
:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
|
||
|
|
:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
|
||
|
|
`;var Lie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xie=function(o,e){return function(t,i){e(t,i,o)}};let yS=class extends F{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new SS(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(ye(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};yS=Lie([xie(0,Jd)],yS);class kie extends yS{getContextViewElement(){return this.contextView.getViewElement()}}class Die{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(e===void 0||Is(e)||Zi(e))n=e;else if(!lb(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new oi;const s=this._cancellationTokenSource.token;if(n=await e.markdown(s),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n?.dispose()}hasContent(e){return e?_a(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var Iie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tm=function(o,e){return function(t,i){e(t,i,o)}};let NE=class extends F{constructor(e,t,i,n,s){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=s,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new yS(this._layoutService))}showHover(e,t,i){if(D5(this._currentHoverOptions)===D5(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),s=Ln();i||(n&&s?s.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=s):this._lastFocusedElementBeforeOpen=void 0);const r=new K,a=this._instantiationService.createInstance(EE,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&J9(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const l=Zi(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ye(l))}if(this._contextViewHandler.showContextView(new Eie(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(V(ye(e.container).do
|
||
|
|
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=sL.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Xs(a,l)}return!0}}class Fie{constructor(){this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const k_=new Fie,xS={kind:0},Wie={kind:1};function Bie(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class D_{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const s=n.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=D_.handleRemovals([].concat(e).concat(t));for(let n=0,s=this._keybindings.length;n<s;n++){const r=this._keybindings[n];if(r.chords.length===0)continue;const a=r.when?.substituteConstants();a&&a.type===0||this._addKeyPress(r.chords[0],r)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!YZ(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,s=e.length;n<s;n++){const r=e[n];if(r.command&&r.command.charAt(0)==="-"){const a=r.command.substring(1);t.has(a)?t.get(a).push(r):t.set(a,[r])}}if(t.size===0)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];if(!r.command||r.command.length===0){i.push(r);continue}if(r.command.charAt(0)==="-")continue;const a=t.get(r.command);if(!a||!r.isDefault){i.push(r);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(r,c.chords,d)){l=!0;break}}if(!l){i.push(r);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){r=!1;break}r&&D_.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:$I(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 s=i[n];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),xS;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,c=s.length;l<c;l++){const d=s[l];if(n.length>d.chords.length)continue;let h=!0;for(let u=1;u<n.length;u++)if(d.chords[u]!==n[u]){h=!1;break}h&&r.push(d)}}const a=this._findCommand(e,r);return a?n.length<a.chords.length?(this._log(`\\
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
|
||
|
|
`),e.listFocusAndSelectionForeground&&i.push(`
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
|
||
|
|
`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=hc(e.listFocusAndSelectionOutline,hc(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(`
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
|
||
|
|
.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
|
||
|
|
`);const s=hc(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(`
|
||
|
|
.monaco-list${t}.drop-target,
|
||
|
|
.monaco-list${t} .monaco-list-rows.drop-target,
|
||
|
|
.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
|
||
|
|
`),e.listDropBetweenBackground&&(i.push(`
|
||
|
|
.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
|
||
|
|
.monaco-list${t} .monaco-list-row.drop-target-before::before {
|
||
|
|
content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
|
||
|
|
background-color: ${e.listDropBetweenBackground};
|
||
|
|
}`),i.push(`
|
||
|
|
.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
|
||
|
|
.monaco-list${t} .monaco-list-row.drop-target-after::after {
|
||
|
|
content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
|
||
|
|
background-color: ${e.listDropBetweenBackground};
|
||
|
|
}`)),e.tableColumnsBorder&&i.push(`
|
||
|
|
.monaco-table > .monaco-split-view2,
|
||
|
|
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
|
||
|
|
border-color: ${e.tableColumnsBorder};
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
|
||
|
|
border-color: transparent;
|
||
|
|
}
|
||
|
|
`),e.tableOddRowsBackgroundColor&&i.push(`
|
||
|
|
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
|
||
|
|
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
|
||
|
|
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
|
||
|
|
background-color: ${e.tableOddRowsBackgroundColor};
|
||
|
|
}
|
||
|
|
`),this.styleElement.textContent=i.join(`
|
||
|
|
`)}}const Qne={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:$.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:$.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:$.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Jne={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function ese(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n<o.length&&o[n]===e+(n-t);)i.push(o[n++]);return i}function $E(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):t.push(e[n++]);return t}function tse(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):n++;return t}const U5=(o,e)=>o-e;class ise{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class nse{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new K}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:er(n);i.disposables.add(Te(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class sse{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class Ho{get onDidChangeFocus(){return se.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return se.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){r
|
||
|
|
`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=hc(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=ye(this.selectElement),i=bi(this.selectElement),n=ye(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Vh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,f=Math.floor((r-s-u)/this.getHeight()),m=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<Vh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||f<1&&m<1?!1:(f<Vh.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>f&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendCh
|
||
|
|
[{1}] {2}`,n,c2.modifierLabels[Ys].altKey,l)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&use(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(xe.isThemeIcon(n)){const s=xe.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=be(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=ip(this._themeService.getColorTheme().type)?vc(n.dark):vc(n.light),i.classList.add("icon"),this._itemClassDispose.value=Mr(be(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};zd=cL([xs(2,bt),xs(3,Li),xs(4,ke),xs(5,zi),xs(6,oo),xs(7,ro)],zd);class f2 extends zd{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=f2._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=p({key:"content2",comment:['A label with keybindg like "ESC to dismiss"']},"{1} to {0}",this._action.label,t):this.label.textContent=p({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let jE=class extends MS{constructor(e,t,i,n,s){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(xe.isThemeIcon(e.item.icon)?xe.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),ht(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!xe.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=ip(this._themeService.getColorTheme().type)?vc(i.dark):vc(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};jE=cL([xs(2,bt),xs(3,oo),xs(4,zi)],jE);let KE=class extends aa{constructor(e,t,i,n,s,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t?.persistLastActionId?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(zd,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??new ku};this._dropdown=new MS(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Js&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(zd,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends ku{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(mA(this._container,ie(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setAct
|
||
|
|
.monaco-menu {
|
||
|
|
font-size: 13px;
|
||
|
|
border-radius: 5px;
|
||
|
|
min-width: 160px;
|
||
|
|
}
|
||
|
|
|
||
|
|
${K5(J.menuSelection)}
|
||
|
|
${K5(J.menuSubmenu)}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar {
|
||
|
|
text-align: right;
|
||
|
|
overflow: hidden;
|
||
|
|
white-space: nowrap;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .actions-container {
|
||
|
|
display: flex;
|
||
|
|
margin: 0 auto;
|
||
|
|
padding: 0;
|
||
|
|
width: 100%;
|
||
|
|
justify-content: flex-end;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .actions-container {
|
||
|
|
display: inline-block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.reverse .actions-container {
|
||
|
|
flex-direction: row-reverse;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item {
|
||
|
|
cursor: pointer;
|
||
|
|
display: inline-block;
|
||
|
|
transition: transform 50ms ease;
|
||
|
|
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled {
|
||
|
|
cursor: default;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .icon,
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .codicon {
|
||
|
|
display: inline-block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .codicon {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-label {
|
||
|
|
font-size: 11px;
|
||
|
|
margin-right: 4px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
|
||
|
|
color: var(--vscode-disabledForeground);
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Vertical actions */
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
text-align: left;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
display: block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
display: block;
|
||
|
|
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
|
||
|
|
padding-top: 1px;
|
||
|
|
padding: 30px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
|
||
|
|
margin-left: 6px;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Action Items */
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.select-container {
|
||
|
|
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
|
||
|
|
flex: 1;
|
||
|
|
max-width: 170px;
|
||
|
|
min-width: 60px;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
margin-right: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
margin-left: 0;
|
||
|
|
overflow: visible;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .actions-container {
|
||
|
|
display: block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
padding: 0;
|
||
|
|
transform: none;
|
||
|
|
display: flex;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.active {
|
||
|
|
transform: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
|
||
|
|
flex: 1 1 auto;
|
||
|
|
display: flex;
|
||
|
|
height: 2em;
|
||
|
|
align-items: center;
|
||
|
|
position: relative;
|
||
|
|
margin: 0 4px;
|
||
|
|
border-radius: 4px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
|
||
|
|
opacity: unset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label {
|
||
|
|
flex: 1 1 auto;
|
||
|
|
text-decoration: none;
|
||
|
|
padding: 0 1em;
|
||
|
|
background: none;
|
||
|
|
font-size: 12px;
|
||
|
|
line-height: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
display: inline-block;
|
||
|
|
flex: 2 1 auto;
|
||
|
|
padding: 0 1em;
|
||
|
|
text-align: right;
|
||
|
|
font-size: 12px;
|
||
|
|
line-height: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
|
||
|
|
font-size: 16px !important;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
|
||
|
|
margin-left: auto;
|
||
|
|
margin-right: -20px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
|
||
|
|
opacity: 0.4;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
|
||
|
|
display: inline-block;
|
||
|
|
box-sizing: border-box;
|
||
|
|
margin: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
position: static;
|
||
|
|
overflow: visible;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
|
||
|
|
position: absolute;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
width: 100%;
|
||
|
|
height: 0px !important;
|
||
|
|
opacity: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
|
||
|
|
padding: 0.7em 1em 0.1em 1em;
|
||
|
|
font-weight: bold;
|
||
|
|
opacity: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
|
||
|
|
color: inherit;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
|
||
|
|
position: absolute;
|
||
|
|
visibility: hidden;
|
||
|
|
width: 1em;
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
|
||
|
|
visibility: visible;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Context Menu */
|
||
|
|
|
||
|
|
.context-view.monaco-menu-container {
|
||
|
|
outline: 0;
|
||
|
|
border: none;
|
||
|
|
animation: fadeIn 0.083s linear;
|
||
|
|
-webkit-app-region: no-drag;
|
||
|
|
}
|
||
|
|
|
||
|
|
.context-view.monaco-menu-container :focus,
|
||
|
|
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
|
||
|
|
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
|
||
|
|
outline: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.hc-black .context-view.monaco-menu-container,
|
||
|
|
.hc-light .context-view.monaco-menu-container,
|
||
|
|
:host-context(.hc-black) .context-view.monaco-menu-container,
|
||
|
|
:host-context(.hc-light) .context-view.monaco-menu-container {
|
||
|
|
box-shadow: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
|
||
|
|
background: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Vertical Action Bar Styles */
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
padding: 4px 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
|
||
|
|
height: 2em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .keybinding {
|
||
|
|
font-size: inherit;
|
||
|
|
padding: 0 2em;
|
||
|
|
max-height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
|
||
|
|
font-size: inherit;
|
||
|
|
width: 2em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
font-size: inherit;
|
||
|
|
margin: 5px 0 !important;
|
||
|
|
padding: 0;
|
||
|
|
border-radius: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
|
||
|
|
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
margin-left: 0;
|
||
|
|
margin-right: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
font-size: 60%;
|
||
|
|
padding: 0 1.8em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
|
||
|
|
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
height: 100%;
|
||
|
|
mask-size: 10px 10px;
|
||
|
|
-webkit-mask-size: 10px 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .action-item {
|
||
|
|
cursor: default;
|
||
|
|
}`;if(e){t+=`
|
||
|
|
/* Arrows */
|
||
|
|
.monaco-scrollable-element > .scrollbar > .scra {
|
||
|
|
cursor: pointer;
|
||
|
|
font-size: 11px !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .visible {
|
||
|
|
opacity: 1;
|
||
|
|
|
||
|
|
/* Background rule added for IE9 - to allow clicks on dom node */
|
||
|
|
background:rgba(0,0,0,0);
|
||
|
|
|
||
|
|
transition: opacity 100ms linear;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .invisible {
|
||
|
|
opacity: 0;
|
||
|
|
pointer-events: none;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .invisible.fade {
|
||
|
|
transition: opacity 800ms linear;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Scrollable Content Inset Shadow */
|
||
|
|
.monaco-scrollable-element > .shadow {
|
||
|
|
position: absolute;
|
||
|
|
display: none;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.top {
|
||
|
|
display: block;
|
||
|
|
top: 0;
|
||
|
|
left: 3px;
|
||
|
|
height: 3px;
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.left {
|
||
|
|
display: block;
|
||
|
|
top: 3px;
|
||
|
|
left: 0;
|
||
|
|
height: 100%;
|
||
|
|
width: 3px;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.top-left-corner {
|
||
|
|
display: block;
|
||
|
|
top: 0;
|
||
|
|
left: 0;
|
||
|
|
height: 3px;
|
||
|
|
width: 3px;
|
||
|
|
}
|
||
|
|
`;const i=o.scrollbarShadow;i&&(t+=`
|
||
|
|
.monaco-scrollable-element > .shadow.top {
|
||
|
|
box-shadow: ${i} 0 6px 6px -6px inset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .shadow.left {
|
||
|
|
box-shadow: ${i} 6px 0 6px -6px inset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .shadow.top.left {
|
||
|
|
box-shadow: ${i} 6px 6px 6px -6px inset;
|
||
|
|
}
|
||
|
|
`);const n=o.scrollbarSliderBackground;n&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider {
|
||
|
|
background: ${n};
|
||
|
|
}
|
||
|
|
`);const s=o.scrollbarSliderHoverBackground;s&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider:hover {
|
||
|
|
background: ${s};
|
||
|
|
}
|
||
|
|
`);const r=o.scrollbarSliderActiveBackground;r&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider.active {
|
||
|
|
background: ${r};
|
||
|
|
}
|
||
|
|
`)}return t}class xse{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Ln();let i;const n=Zi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(ie(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=V(this.block,ee.MOUSE_DOWN,d=>d.stopPropagation()));const a=new K,l=e.actionRunner||new ku;l.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Nf(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},wse),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=ye(s);return a.add(V(c,ee.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(V(c,ee.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Er(c,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===s)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),Mr(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{e.onHide?.(!!s),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Ln()===this.lastContainer||qi(Ln(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!hr(e.error)&&this.notificationService.error(e.error)}}var kse=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yg=function(o,e){return function(t,i){e(t,i,o)}};let YE=class extends F{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new xse(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new O),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new O)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=XE.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),ic.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};YE=kse([yg(0,Pn),yg(1,Li),yg(2,Nc),yg(3,bt),yg(4,Fo),yg(5,ke)],YE);var XE;(function(o){function e(i){return i&&i.menuId instanceof M}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(r){const d=n.getMenuActions(r,l??s,a);Sse(d,c)}return i.getAction
|
||
|
|
`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let f=0;f<60;f++)h.push(new id(Ii(0,f),0,-1,$i.getEmpty(),new zh(Ii(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new id(Ii(1,f),0,-1,$i.getEmpty(),new zh(Ii(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,m=r[0];if(m===`
|
||
|
|
`)a++,l=f+1;else{if(c!==f){let _;if(d===a){const b=f-c;if(b<h.length)_=h[b];else{const C=Ii(0,b);_=new id(C,0,-1,$i.getEmpty(),new zh(C))}}else{const b=a-d,C=f-l;if(b===1&&C<u.length)_=u[C];else{const w=Ii(b,C);_=new id(w,0,-1,$i.getEmpty(),new zh(w))}}s.push(_)}s.push(t.getToken(m)),c=f+m.length,d=a}}const g=e.length;if(c!==g){const f=d===a?Ii(0,g-c):Ii(a-d,g-l);s.push(new id(f,0,-1,$i.getEmpty(),new zh(f)))}this.length=Ii(a,g-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new lq}}class y2{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=Ii(0,s.bracketText.length),a=i(s),l=$i.getEmpty().add(a,Y5);n.set(s.bracketText,new id(r,1,a,l,zS.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=Ii(0,s.bracketText.length);let a=$i.getEmpty();const l=s.getOpeningBrackets();for(const c of l)a=a.add(i(c),Y5);n.set(s.bracketText,new id(r,2,i(l[0]),a,zS.create(r,s,a)))}return new y2(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>Eoe(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Eoe(o){let e=Ro(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class LV{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=y2.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Noe(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?xV(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())X5(i,n)<=X5(n,r)?(i=pk(i,n),n=r):n=pk(n,r);return pk(i,n)}function xV(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=fl.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return fl.create23(o[0],o[1],t>=3?o[2]:null,e)}function X5(o,e){return Math.abs(o.listHeight-e.listHeight)}function pk(o,e){return o.listHeight===e.listHeight?fl.create23(o,e,null,!1):o.listHeight>e.listHeight?Toe(o,e):Roe(e,o)}function Toe(o,e){o=o.toMutable();let t=o;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=fl.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?fl.create23(o,n,null,!1):o}function Roe(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=fl.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?fl.create23(n,o,null,!1):o}class Moe{constructor(e){this.lastOffset=ns,this.nextNodes=[e],this.offsets=[ns],this.idxs=[]}readLongestNodeAt(e,t){if(Tf(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=Rm(this.nextNodes);if(!i)return;const n=Rm(this.offsets);if(Tf(e,n))return;if(Tf(n,e))if(pi(n,i.length)<=e)this.nextNodeAf
|
||
|
|
`?0:1}function Kl(o){return o?o instanceof EV||o instanceof Voe:!1}class L2{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Kl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Kl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Kl(i)&&i.canAppend(this._model))return i;const n=new EV(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],oN(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=L2._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),s.append(this._model,l.map(c=>c.textChange),oN(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Me(i),null}}}class NV extends F{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function uL(o,e){let t=0,i=0;const n=o.length;for(;i<n;){const s=o.charCodeAt(i);if(s===32)t++;else if(s===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var du;(function(o){o[o.Disabled=0]="Disabled",o[o.EnabledForActive=1]="EnabledForActive",o[o.Enabled=2]="Enabled"})(du||(du={}));class tu{constructor(e,t,i,n,s,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}}class N_{constructor(e,t){this.top=e,this.endColumn=t}}class zoe extends NV{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return uL(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new gt("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide);let a=-2,l=-1,c=-2,d=-1;const h=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let E=x-2;E>=0;E--){const N=this._computeIndentLevel(E);if(N>=0){a=E,l=N;break}}}if(c===-2){c=-1,d=-1;for(let E=x;E<n;E++){const N=this._computeIndentLevel(E);if(N>=0){c=E,d=N;break}}}};let u=-2,g=-1,f=-2,m=-1;const _=x=>{if(u===-2){u=-1,g=-1;for(let E=x-2;E>=0;E--){const N=this._computeIndentLevel(E);if(N>=0){u=E,g=N;break}}}if(f!==-1&&(f===-2||f<x-1)){f=-1,m=-1;for(let E=x;E<n;E++){const N=this._computeIndentLevel(E);if(N>=0){f=E,m=N;break}}}};let b=0,C=!0,w=0,v=!0,S=0,k=0;for(let x=0;C||v;x++){const E=e-x,N=e+x;x>1&&(E<1||E<t)&&(C=!1),x>1&&(N>n||N>i)&&(v=!1),x>5e4&&(C=!1,v=!1);let z=-1;if(C&&E>=1){const U=this._computeIndentLevel(E-1);U>=0?(c=E-1,d=U,z=Math.ceil(U/this.textModel.getOptions().indentSize)):(h(E),z=this._getIndentLevelForWhitespaceLine(r,l,d))}let W=-1;if(v&&N<=n){const U=this._computeIndentLevel(N-1);U>=0?(u=N-1,g=U,W=Math.ceil(U/this.textModel.getOptions().indentSize)):(_(N),W=this._getIndentLevelForWhitespaceLine(r,g,m))}if(x===0){k=z;continue}if(x===1){if(N<=n&&W>=0&&k+1===W){C=!1,b=N,w=N,S=W;continue}if(E>=1&&z>=0&&z-1===k){v=!1,b=E,w=E,S=z;continue}if(b=e,w=e,S=k,S===0)return{startLineNumber:b,endLineNumber:w,indent:S}}C&&(z>=S?b=E:C=!1),v&&(W>=S?w=N:v=!1)}return{startLineNumber:b,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,n){const s=[];for(let h=e;h<=t;h++)s.push([]);const r=!0,a=this.textModel.bracketPairs.getBr
|
||
|
|
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const m=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f<u.length;f++)g=this.rbInsertRight(g,u[f]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)s=this.rbInsertRight(s,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===We)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const f=s.next();nw(this,s),this.validateCRLFWithPrevNode(f),this.computeBufferMetadata();return}this.deleteNodeHead(s,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const d=s.next();for(let u=d;u!==We&&u!==r;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new Vs(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
|
||
|
|
`,Fl(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
|
||
|
|
`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r<i.length;r++)s=this.rbInsertRight(s,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,d=n.end.line,h=0,u=0,g=0;for(;c<=d&&(h=c+(d-c)/2|0,g=r[h],h!==d);)if(u=r[h+1],l<g)d=h-1;else if(l>=u)c=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)nw(this,e[t])}createNewPieces(e){if(e.length>Tl){const d=[];for(;e.length>Tl;){const u=e.charCodeAt(Tl-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,Tl-1),e=e.substring(Tl-1)):(g=e.substring(0,Tl),e=e.substring(Tl));const f=Wl(g);d.push(new Vs(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Uh(g,f))}const h=Wl(e);return d.push(new Vs(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Uh(e,h)),d}let t=this._buffers[0].buffer.length;const i=Wl(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new Vs(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==We;)if(i.left!==We&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==We;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==We;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this.
|
||
|
|
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=Wl(t,!1);for(let g=0;g<s.length;g++)s[g]+=n;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,d=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-d;e.piece=new Vs(e.piece.bufferIndex,e.piece.start,l,h,c),this._lastChangeBufferPos=l,Fl(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==We;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==We;)if(i.left!==We&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==We;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
|
||
|
|
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===We||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===We||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Vs(e.piece.bufferIndex,e.piece.start,s,a,r),Fl(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Vs(t.piece.bufferIndex,l,t.piece.end,d,c),Fl(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r
|
||
|
|
`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)nw(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=`
|
||
|
|
`,i.piece.length===1)nw(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new Vs(n.bufferIndex,s,n.end,a,r),Fl(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===We)return t(We);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===We)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new rN(t,1);if(i.left=We,i.right=We,i.parent=We,i.size_left=0,i.lf_left=0,this.root===We)this.root=i,i.color=0;else if(e.right===We)e.right=i,i.parent=e;else{const s=x2(e.right);s.left=i,i.parent=s}return r3(this,i),i}rbInsertLeft(e,t){const i=new rN(t,1);if(i.left=We,i.right=We,i.parent=We,i.size_left=0,i.lf_left=0,this.root===We)this.root=i,i.color=0;else if(e.left===We)e.left=i,i.parent=e;else{const n=OV(e.left);n.right=i,i.parent=n}return r3(this,i),i}}class Mf extends F{constructor(e,t,i,n,s,r,a){super(),this._onDidChangeContent=this._register(new O),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new lre(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new L(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const l=r.length-a.length,c=e.endLineNumber-e.startLineNumber;s=l*c}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let r=n;r<=s;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===s?e.endColumn-1:a.length;for(let d=l;d<c;d++)Ki(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}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=Gn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ga(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
|
||
|
|
`;case 2:return`\r
|
||
|
|
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const b=_.range;if(_.text){let k=!0;r||(k=!OC(_.text),r=k),!n&&k&&(n=Qf(_.text)),!s&&k&&(s=N9(_.text))}let C="",w=0,v=0,S=0;if(_.text){let k;[w,v,S,k]=Hd(_.text);const x=this.getEOL();k===0||k===(x===`\r
|
||
|
|
`?2:1)?C=_.text:C=_.text.replace(/\r\n|\r|\n/g,x)}l[m]={sortIndex:m,identifier:_.identifier||null,range:b,rangeOffset:this.getOffsetAt(b.startLineNumber,b.startColumn),rangeLength:this.getValueLengthInRange(b),text:C,eolCount:w,firstLineLength:v,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(Mf._sortOpsAscending);let c=!1;for(let m=0,_=l.length-1;m<_;m++){const b=l[m].range.getEndPosition(),C=l[m+1].range.getStartPosition();if(C.isBeforeOrEqual(b)){if(C.isBefore(b))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const d=i||t?Mf._getInverseEditRanges(l):[],h=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],b=d[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let C=b.startLineNumber;C<=b.endLineNumber;C++){let w="";C===b.startLineNumber&&(w=this.getLineContent(_.range.startLineNumber),Gn(w)!==-1)||h.push({lineNumber:C,oldContent:w})}}let u=null;if(i){let m=0;u=[];for(let _=0;_<l.length;_++){const b=l[_],C=d[_],w=this.getValueInRange(b.range),v=b.rangeOffset+m;m+=b.text.length-w.length,u[_]={sortIndex:b.sortIndex,identifier:b.identifier,range:C,text:w,textChange:new vn(b.rangeOffset,w,v,b.text)}}c||u.sort((_,b)=>_.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((m,_)=>_.lineNumber-m.lineNumber),f=[];for(let m=0,_=h.length;m<_;m++){const b=h[m].lineNumber;if(m>0&&h[m-1].lineNumber===b)continue;const C=h[m].oldContent,w=this.getLineContent(b);w.length===0||w===C||Gn(w)!==-1||f.push(b)}}return this._onDidChangeContent.fire(),new bX(u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new L(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g<f;g++){const m=e[g],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new L(r,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,h,u]=Hd(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Mf._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&r===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const c=new L(s,r,a,l);t.push({range:c,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,d;s?s.range.endLineNumber===l.range.startLineNumber?(c=i,d=n+(l.range.startColumn-s.range.endColumn)):(c=i+(l.range.startLineNumber-s.range.endLineNumber),d=l.range.startColumn):(c=l.range.startLineNumber,d=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new L(c,d,c,d+l.firstLineLength):h=new L(c,d,c+u-1,l.lastLineLength+1)}else h=new L(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class cre{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._
|
||
|
|
`:`\r
|
||
|
|
`:i>t/2?`\r
|
||
|
|
`:`
|
||
|
|
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
|
||
|
|
`&&(this._cr>0||this._lf>0)||t===`
|
||
|
|
`&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s<r;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=Wl(a);i[s]=new Uh(a,l)}const n=new Mf(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class WV{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&&rA(e)&&(this.BOM=cG,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=ore(this._tmpLineStarts,e);this.chunks.push(new Uh(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Qf(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=N9(e)))}finish(e=!0){return this._finish(),new cre(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Wl(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class dre{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),s=this._store.slice(e+t),r=hre(i,this._default);this._store=n.concat(r,s)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=gy(this._store,e,i)}}function hre(o,e){const t=[];for(let i=0;i<o;i++)t[i]=e;return t}class ure{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class aN{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new ure(e,[t]))}finalize(){return this._tokens}}class gre{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new lN(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class fre extends gre{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),r=Mm(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=Mm(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new Ni(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtO
|
||
|
|
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=F.None}_assertNotDisposed(){if(this._isDisposed)throw new gt("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new hu(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw tr();const{textBuffer:t,disposable:i}=h3(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new u3,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Af([new Sre],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
|
||
|
|
`:`
|
||
|
|
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Af([new xre],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=c,s.cachedVersionId=e,s.start=l-a,s.end=c-a,Ud(s)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=Nre?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Xw({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=J5(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),C2(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(E9.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.
|
||
|
|
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new gt("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new gt("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new gt("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof L&&!(e instanceof fe)?e:new L(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Ki(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new A(1,1);if(n>r)return new A(r,this.getLineMaxColumn(r));if(s<=1)return new A(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new A(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Ki(l))return new A(n,s-1)}return new A(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof A&&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,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=Ki(a),d=Ki(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof L&&!(e instanceof fe)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Ki(c),u=Ki(d);return!h&&!u?new L(s,r,a,l):s===a&&r===l?new L(s,r-1,a,l-1):h&&u?new L(s,r-1,a,l+1):h?new L(s,r-1,a,l):new L(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new L(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=Ere){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>L.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>L.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(`
|
||
|
|
`)<0){const u=new Ih(e,i,n,s).parseSearchRequest();if(!u)return[];d=g=>this.findMatchesLineByLine(g,u,r,a)}else d=h=>Bv.findMatches(this,new Ih(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
|
||
|
|
`)<0){const c=new Ih(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new L(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return Bv.findNextMatch(this,new Ih(e,i,n,s),a,r),u.length>0||(h=new L(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return Bv.findNextMatch(this,new Ih(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return Bv.findPreviousMatch(this,new Ih(e,i,n,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
|
||
|
|
`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Gx?e:new Gx(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const s=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let d=!1;for(let h=0,u=s.length;h<u;h++){const g=s[h].range,f=g.startLineNumber>c.endLineNumber,m=c.startLineNumber>g.endLineNumber;if(!f&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const c=this._trimAutoWhitespaceLines[a],d=this.getLineMaxColumn(c);let h=!0;for(let u=0,g=s.length;u<g;u++){const f=s[u].range,m=s[u].text;if(!(c<f.startLineNumber||c>f.endLineNumber)&&!(c===f.startLineNumber&&f.startColumn===d&&f.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
|
||
|
|
`)&&!(c===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
|
||
|
|
`)){h=!1;break}}if(h){const u=new L(c,1,c,d);t.push(new Gx(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!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),s=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c<d;c++){const h=r[c];this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,d=r.length;c<d;c++){const h=r[c],[u]=Hd(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,f=h.range.endLineNumber,m=f-g,_=u,b=Math.min(m,_),C=_-m,w=s-l-C+g,v=w,S=w+_,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new A(v,1)),this.getOffsetAt(new A(S,this.getLineMaxColumn(S))),0),x=wa.fromDecorations(k),E=new _c(x);for(let N=b;N>=0;N--){const z=g+N,W=w+N;E.takeFromEndWhile(Z=>Z.lineNumber>W);const U=E.takeFromEndWhile(Z=>Z.lineNumber===W);a.push(new d3(z,this.getLineContent(W),U))}if(b<m){const N=g+b;a.push(new yre(N+1,f))}if(b<_){const N=new _c(x),z=g+b,W=_-b,U=s-l-W+z+1,Z=[],H=[];for(let Q=0;Q<W;Q++){const le=U+Q;H[Q]=this.getLineContent(le),N.takeWhile(ge=>ge.lineNumber<le),Z[Q]=N.takeWhile(ge=>ge.lineNumber===le)}a.push(new Lre(z+1,g+_,H,Z))}l+=C}this._emitContentChangedEvent(new Af(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,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=Array.from(e).map(n=>new d3(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new VV(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(s,f3(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Me(s)}return i.addDecoration=Am,i.changeDecoration=Am,i.changeDecorationOptions=Am,i.removeDecoration=A
|
||
|
|
`?r=2:a===`
|
||
|
|
`&&(r=1);let l=Tn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Tn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Tn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Tn.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Ys===3||Ys===2?`
|
||
|
|
`:`\r
|
||
|
|
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=Hg._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const r=i[n],a=this._models[r],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const d=t[l+c],h=this.getCreationOptions(l,c,a.model.isForSimpleWidget);Hg._setModelOptionsForModel(a.model,h,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&Xs(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(_h(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(_h(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(_h(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(da,e,t,s,i);if(i&&this._disposedModels.has(_h(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const g of d.past)Kl(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of d.future)Kl(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>Kl(g)&&g.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=_h(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Hre(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,ls,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=_h(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Pe.file||e.scheme===Pe.vscodeRemote||e.scheme===Pe.vscodeUserData||e.scheme===Pe.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=_h(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!=
|
||
|
|
`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};fN=Qre([m3(0,$e),m3(1,yl)],fN);$.white.toString(),$.white.toString();class KS extends F{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new O),this._onDidEscape=this._register(new O),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Qt.addTarget(this._element)),[ee.CLICK,Ot.Tap].forEach(s=>{this._register(V(this._element,s,r=>{if(!this.enabled){et.stop(r);return}this._onDidClick.fire(r)}))}),this._register(V(this._element,ee.KEY_DOWN,s=>{const r=new Mt(s);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(s),a=!0):r.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&et.stop(r,!0)})),this._register(V(this._element,ee.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(V(this._element,ee.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(va(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Dd(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||_a(this._label)&&_a(e)&&Fte(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(_a(e)){const n=iL(e,{inline:!0});n.dispose();const s=n.element.querySelector("p")?.innerHTML;if(s){const r=$9(s,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else fn(t)}else this.options.supportIcons?fn(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=Gte(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...xe.asClassNameArray(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")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(Ia().setupManagedHover(this.options.hoverDelegate??ps("mouse"),this._element,e)):this._hov
|
||
|
|
top: ${this.virtualDelegate.headerRowHeight+1}px;
|
||
|
|
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
|
||
|
|
}`),this.styleElement.textContent=t.join(`
|
||
|
|
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}var _o;(function(o){o[o.Expanded=0]="Expanded",o[o.Collapsed=1]="Collapsed",o[o.PreserveOrExpanded=2]="PreserveOrExpanded",o[o.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(_o||(_o={}));var iu;(function(o){o[o.Unknown=0]="Unknown",o[o.Twistie=1]="Twistie",o[o.Element=2]="Element",o[o.Filter=3]="Filter"})(iu||(iu={}));class Lo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class A2{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 P2(o){return typeof o=="object"&&"visibility"in o&&"data"in o}function Ub(o){switch(o){case!0:return 1;case!1:return 0;default:return o}}function kk(o){return typeof o.collapsible=="boolean"}class Iae{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new MC,this._onDidChangeCollapseState=new O,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new O,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new O,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new or(P9),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=n.allowNonCollapsibleParents??!1,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=it.empty(),n={}){if(e.length===0)throw new Lo(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=it.empty(),s,r=s.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],c=t[t.length-1],d=new Ja({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const h=t.slice(0,-1),u=(m,_,b)=>{if(r>0)for(let C=0;C<b;C++)m--,_--,this.spliceSmart(e,[...h,m,0],Number.MAX_SAFE_INTEGER,l[_].children,s,r-1)};let g=Math.min(a.children.length,c+i),f=l.length;for(const m of d.changes.sort((_,b)=>b.originalStart-_.originalStart))u(g,f,g-(m.originalStart+m.originalLength)),g=m.originalStart,f=m.modifiedStart-c,this.spliceSimple([...h,g],m.originalLength,it.slice(l,f,f+m.modifiedLength),s);u(g,f,g)}spliceSimple(e,t,i=it.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=it.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,h,n)),g=e[e.length-1];let f=0;for(let S=g;S>=0&&S<a.children.length;S--){const k=a.children[S];if(k.visible){f=k.visibleChildIndex;break}}const m=[];let _=0,b=0;for(const S of u)m.push(S),b+=S.renderNodeCount,S.visible&&(S.visibleChildIndex=f+_++);const C=bF(a.children,g,t,m);r?a.lastDiffIds?bF(a.lastDiffIds,g,t,m.map(S=>r.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of C)S.visible&&w++;if(w!==0)for(let S=g+m.length;S<a.children.length;S++){const k=a.children[S];k.visible&&(k.visibleChildIndex-=w)}if(a.visibleChildrenCount+=_-w,c&&d){const S=C.reduce((k,x)=>k+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this.list.splice(l,S,h)}if(C.length>0&&s){const S=k=>{s(k),k.children.forEach(S)};C.forEach(S)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:C});let v=a;for(;v;){if(v.visibility===2){this.refilterDelayer.t
|
||
|
|
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=$l(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=$l(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=$l(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=$l(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=$l(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=$l(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){It(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class F2{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Iae(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,s){return i.sorter.compare(n.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=it.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=it.empty(),i){const n=new Set,s=new Set,r=l=>{if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.add(d),this.nodesByIdentity.set(d,c)}i.onDidCreateNode?.(c)},a=l=>{if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.has(d)||this.nodesByIden
|
||
|
|
`?-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 Om{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||Xs(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class i0 extends F{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Om(Y(e,ie(".monaco-icon-label")))),this.labelContainer=Y(this.domNode.element,ie(".monaco-icon-label-container")),this.nameContainer=Y(this.labelContainer,ie("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new Cle(this.nameContainer,!!t.supportIcons)):this.nameNode=new _le(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??ps("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let l;!a||!Zi(a)?(l=ie(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,l.style.backgroundImage=vc(i?.iconPath)}else a&&a.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Nd?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(l.element,i?.descriptionTitle)):(l.textContent=t&&i?.labelEscapeNewLines?Nd.escapeNewLines(t,[]):t||"",this.setupHover(l.element,i?.descriptionTitle||""),l.empty=!t)}if(i?.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(s,r){Is(r)?s.title=n2(r):r?.markdownNotSupportedFallback?s.title=r.markdownNotSupportedFallback:s.removeAttribute("title")})(e,t);else{const n=Ia().setupManagedHover(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()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new Om(wZ(this.nameContainer,ie("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new Om(Y(e.element,ie("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new Om(Y(this.labelContainer,ie("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new Nd(Y(e.element,ie("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new Om(Y(e.element,ie("span.label-description"))))}return this.descriptionNode}}class _le{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Xs(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=Y(this.container,ie("a.label-name",{id: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],s=
|
||
|
|
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}};LN=yN=Ile([Tk(1,Jd),Tk(2,Ce),Tk(3,ke)],LN);var Ele=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fm=function(o,e){return function(t,i){e(t,i,o)}};let xN=class extends vQ{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(uN))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new O),this._onHide=this._register(new O),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(Os).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(fN))},n=this._register(this.instantiationService.createInstance(LN,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{ye(e.activeContainer)===ye(n.container)&&n.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}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?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=He.None){return this.controller.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ce(a5),quickInputForeground:ce(Oee),quickInputTitleBackground:ce(Fee),widgetBorder:ce(c8),widgetShadow:ce(qp)},inputBox:PS,toggle:AS,countBadge:aV,button:_se,progressBar:bse,keybindingLabel:mse,list:Ju({listBackground:a5,listFocusBackground:Eb,listFocusForeground:Ib,listInactiveFocusForeground:Ib,listInactiveSelectionIconForeground:KA,listInactiveFocusBackground:Eb,listFocusOutline:Gt,listInactiveFocusOutline:Gt}),pickerGroup:{pickerGroupBorder:ce(Wee),pickerGroupForeground:ce(C8)}}}};xN=Ele([Fm(0,Ce),Fm(1,ke),Fm(2,zi),Fm(3,Jd),Fm(4,$e)],xN);var S6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$h=function(o,e){return function(t,i){e(t,i,o)}};let kN=class extends xN{constructor(e,t,i,n,s,r){super(t,i,n,new nE(e.getContainerDomNode(),s),r),this.host=void 0;const a=qb.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInf
|
||
|
|
`)}const Ble={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:{[Wr]:"#FFFFFE",[Sl]:"#000000",[a8]:"#E5EBF1",[tv]:"#D3D3D3",[iv]:"#939393",[HA]:"#ADD6FF4D"}},Hle={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:{[Wr]:"#1E1E1E",[Sl]:"#D4D4D4",
|
||
|
|
`)}}const ig=new $le;ri.add(Ule.IconContribution,ig);function $t(o,e,t,i){return ig.registerIcon(o,e,t,i)}function L6(){return ig}function jle(){const o=v9();for(const e in o){const t="\\"+o[e].toString(16);ig.registerIcon(e,{fontCharacter:t})}}jle();const x6="vscode://schemas/icons",k6=ri.as(Wy.JSONContribution);k6.registerSchema(x6,ig.getIconSchema());const F3=new yt(()=>k6.notifySchemaChanged(x6),200);ig.onDidChange(()=>{F3.isScheduled()||F3.schedule()});const D6=$t("widget-close",J.close,p("widgetClose","Icon for the close action in widgets."));$t("goto-previous-location",J.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));$t("goto-next-location",J.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));xe.modify(J.sync,"spin");xe.modify(J.loading,"spin");function Kle(o){const e=new K,t=e.add(new O),i=L6();return e.add(i.onDidChange(()=>t.fire())),o&&e.add(o.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=o?o.getProductIconTheme():new I6,s={},r=[],a=[];for(const l of i.getIcons()){const c=n.getIcon(l);if(!c)continue;const d=c.font,h=`--vscode-icon-${l.id}-font-family`,u=`--vscode-icon-${l.id}-content`;d?(s[d.id]=d.definition,a.push(`${h}: ${Fx(d.id)};`,`${u}: '${c.fontCharacter}';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Fx(d.id)}; }`)):(a.push(`${u}: '${c.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(const l in s){const c=s[l],d=c.weight?`font-weight: ${c.weight};`:"",h=c.style?`font-style: ${c.style};`:"",u=c.src.map(g=>`${vc(g.location)} format('${g.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${Fx(l)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(`
|
||
|
|
`)}}}class I6{getIcon(e){const t=L6();let i=e.defaults;for(;xe.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Ql="vs",Pf="vs-dark",uu="hc-black",gu="hc-light",E6=ri.as(t8.ColorContribution),qle=ri.as(BH.ThemingContribution);class N6{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(g1(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,$.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=IN(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,$.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=E6.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ql:return Jo.LIGHT;case uu:return Jo.HIGH_CONTRAST_DARK;case gu:return Jo.HIGH_CONTRAST_LIGHT;default:return Jo.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=IN(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=y6.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Ls.getForeground(s),a=Ls.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function g1(o){return o===Ql||o===Pf||o===uu||o===gu}function IN(o){switch(o){case Ql:return Ble;case Pf:return Hle;case uu:return Vle;case gu:return zle}}function cw(o){const e=IN(o);return new N6(o,e)}class Gle extends F{constructor(){super(),this._onColorThemeChange=this._register(new O),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new O),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new I6,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ql,cw(Ql)),this._knownThemes.set(Pf,cw(Pf)),this._knownThemes.set(uu,cw(uu)),this._knownThemes.set(gu,cw(gu));const e=this._register(Kle(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
|
||
|
|
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ql),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),M9(Et,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return Q1(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Mo(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),F.None}_registerShadowDomContainer(e){const t=Mo(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!g1(t.base)&&!g1(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new N6(e,t)),g1(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(Ql),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=Et.matchMedia("(forced-colors: active)").matches;if(e!==fa(this._theme.type)){let t;ip(this._theme.type)?t=e?uu:Pf:t=e?gu:Ql,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};qle.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of E6.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${FA(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(`
|
||
|
|
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(Wle(s)),this._themeCSS=e.join(`
|
||
|
|
`),this._updateCSS(),ui.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
|
||
|
|
${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Vo=Xe("themeService");var Zle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rk=function(o,e){return function(t,i){e(t,i,o)}};let EN=class extends F{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new O,this._onDidChangeReducedMotion=new O,this._onDidChangeLinkUnderline=new O,this._accessibilityModeEnabledContext=KC.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=Et.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(V(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};EN=Zle([Rk(0,ke),Rk(1,Jd),Rk(2,$e)],EN);var yL=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},al=function(o,e){return function(t,i){e(t,i,o)}},Vg,o_;let NN=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new TN(i)}createMenu(e,t,i){return new o0(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new o0(e,this._hiddenStates,{emitEventsForSubmen
|
||
|
|
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
|
||
|
|
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
|
||
|
|
`);return e.join(`
|
||
|
|
`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}class nm{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}const lce=!1;class U3 extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph:
|
||
|
|
${e.toString()}`}}class a0{constructor(e=new nm,t=!1,i,n=lce){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ce,this),this._globalGraph=n?i?._globalGraph??new z3(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,It(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)my(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends a0{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=Ko.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw qM("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof Za?(i=Ko.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Ko.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=la.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Za)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Za?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 z3(l=>l.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const l=r.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),n.lookupOrInsertNode(l),s++>1e3)throw new U3(n);for(const c of la.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),d instanceof Za){const h={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};n.insertEdge(l,h),r.push(h)}}}}for(;;){const l=n.roots();if(l.length===0){if(!n.isEmpty())throw new U3(n);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Za){const h=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,h)}n.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e
|
||
|
|
`).slice(3,4).join(`
|
||
|
|
`)):Ko._None}static traceCreation(e,t){return e?new Ko(1,t.name):Ko._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Ko(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Ko._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(`
|
||
|
|
`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ko._totals.toFixed(2)}ms)`];(e>2||t)&&Ko.all.add(n.join(`
|
||
|
|
`))}}const cce=new Set([Pe.inMemory,Pe.vscodeSourceControl,Pe.walkThrough,Pe.walkThroughSnippet,Pe.vscodeChatCodeBlock]);class dce{constructor(){this._byResource=new Wi,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new Wi,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??it.empty():ve.isUri(e)?this._byResource.get(e)?.values()??it.empty():it.map(it.concat(...this._byOwner.values()),t=>t[1])}}class hce{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Wi,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(cce.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===fi.Error?t.errors+=1:i===fi.Warning?t.warnings+=1:i===fi.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 Xc{constructor(){this._onMarkerChanged=new d9({delay:0,merge:Xc._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new dce,this._stats=new hce(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(j7(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=Xc._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=it.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(qn(t)){const s=new Wi;for(const{resource:r,marker:a}of t){const l=Xc._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Xc._accept(l,n)){const c=a.push(l);if(s>0&&c===s)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Xc._accept(l,n)){const c=r.push(l);if(s>0&&c===s)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Xc._accept(c,n)){const d=a.push(c);if(s>0&&d===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Wi;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class uce extends F{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=un.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=un.createEmptyModel(this.logService);const e=ri.as(Vr.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.
|
||
|
|
|
||
|
|
`+t),Et.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:yi.Error,message:e,detail:t})}}class l0{static{this.NO_OP=new LQ}info(e){return this.notify({severity:yi.Info,message:e})}warn(e){return this.notify({severity:yi.Warning,message:e})}error(e){return this.notify({severity:yi.Error,message:e})}notify(e){switch(e.severity){case yi.Error:console.error(e.message);break;case yi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return l0.NO_OP}prompt(e,t,i,n){return l0.NO_OP}status(e,t){return F.None}}let FN=class{constructor(e){this._onWillExecuteCommand=new O,this._onDidExecuteCommand=new O,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=nt.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)}}};FN=xl([Ti(0,Ce)],FN);let _p=class extends Vie{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new K;f.add(V(g,ee.KEY_DOWN,m=>{const _=new Mt(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add(V(g,ee.KEY_UP,m=>{const _=new Mt(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new wce(g,f))},l=g=>{for(let f=0;f<this._domNodeListeners.length;f++){const m=this._domNodeListeners[f];m.domNode===g&&(this._domNodeListeners.splice(f,1),m.dispose())}},c=g=>{g.getOption(61)||a(g.getContainerDomNode())},d=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return Mr(nt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:RI(i.keybinding,Ys),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),be(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(hs.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new D_(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return Et.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new T5(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=Mb.resolveKeybinding(a,Ys);for(const c of l)i[n++]=new T5(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new bc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Mb([t],Ys)}};_p=xl([Ti(0,ke),Ti(1,Ft),Ti(2,Pn),Ti(3,Li),Ti(4,Dn),Ti(5,ut)],_p);class wce extends F{constructor(e,t){super(),this.domNode=e,this._register(t)}}function $3(o){return o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof ve)}let c0=class{constructor(e){this.logService=e,this._onDidCha
|
||
|
|
`:`\r
|
||
|
|
`}};BN=xl([Ti(0,$e)],BN);class Sce{publicLog2(){}}class d0{static{this.SCHEME="inmemory"}constructor(){const e=ve.from({scheme:d0.SCHEME,authority:"model",path:"/"});this.workspace={id:z8,folders:[new tne({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===d0.SCHEME?this.workspace.folders[0]:null}}function h0(o,e,t){if(!e||!(o instanceof c0))return;const i=[];Object.keys(e).forEach(n=>{Tie(n)&&i.push([`editor.${n}`,e[n]]),t&&Rie(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let HN=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:l2.convert(e),n=new Map;for(const a of i){if(!(a instanceof Id))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(ni.replaceMove(L.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:Su(WE.bulkEditServiceSummary,s,r),isApplied:s>0}}};HN=xl([Ti(0,Ut)],HN);class yce{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return lr(e)}}let VN=class extends kie{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};VN=xl([Ti(0,Jd),Ti(1,ut)],VN);class Lce{constructor(){this._neverEmitter=new O,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class xce extends TS{constructor(){super()}}class kce extends fce{constructor(){super(new iY)}}let zN=class extends YE{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};zN=xl([Ti(0,Pn),Ti(1,Li),Ti(2,Nc),Ti(3,bt),Ti(4,Fo),Ti(5,ke)],zN);const UN={amdModuleId:"vs/editor/common/services/editorSimpleWorker",esmModuleLocation:void 0,label:"editorWorkerService"};let $N=class extends JI{constructor(e,t,i,n,s){super(UN,e,t,i,n,s)}};$N=xl([Ti(0,Ut),Ti(1,Hy),Ti(2,Dn),Ti(3,ai),Ti(4,ue)],$N);class Dce{async playSignal(e,t){}}tt(Dn,kce,0);tt($e,c0,0);tt(Hy,WN,0);tt(WH,BN,0);tt(Tu,d0,0);tt(dp,yce,0);tt(Pn,Sce,0);tt(zC,vce,0);tt(AA,Cce,0);tt(Li,l0,0);tt(Ll,Xc,0);tt(ei,xce,0);tt(Vo,Gle,0);tt(Ut,dN,0);tt(b2,tN,0);tt(ke,PN,0);tt(V8,bce,0);tt(th,tP,0);tt(Ur,fse,0);tt(Fs,$N,0);tt(qC,HN,0);tt(U8,Lce,0);tt(As,ON,0);tt(ro,EN,0);tt(fr,ale,0);tt(Ft,FN,0);tt(bt,_p,0);tt(gr,DN,0);tt(Nc,VN,0);tt(Os,eN,0);tt(Mc,AN,0);tt(oo,zN,0);tt(Fo,NN,0);tt(sh,Dce,0);tt(HV,mce,0);var Ee;(function(o){const e=new nm;for(const[l,c]of n4())e.set(l,c);const t=new a0(e,!0);e.set(Ce,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Za?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new O;function r(l){if(n)return t;n=!0;for(const[d,h]of n4())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=Xe(d);e.get(h)instanceof Za&&e.set(h,l[d])}const c=pce();for(const d of c)try{t.createInstance(d)}catch(h){Me(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new K,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(Ee||(Ee={}));function Ice(o,e){return new Ece(o,e)}class Ece extends dS{constructor(e,t){const i={amdModuleId:UN.amdModuleId,esmModuleLocation:UN.esmModuleLocation,label:t.label};super(i,t.keepIdleModels||!1,e),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._foreig
|
||
|
|
`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const f=h,m=d.depth,_=u?u.groups.length:0,b=d.state;let C=null,w=null,v=null,S=null,k=null;if(u){C=u.matches;const N=u.groups.shift();w=N.matched,v=N.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let N=this._lexer.tokenizer[b];if(!N&&(N=dw(this._lexer,b),!N))throw Kt(this._lexer,"tokenizer state is not defined: "+b);const z=a.substr(h);for(const W of N)if((h===0||!W.matchOnlyAtLineStart)&&(C=z.match(W.resolveRegex(b)),C)){w=C[0],v=W.action;break}}if(C||(C=[""],w=""),v||(h<l&&(C=[a.charAt(h)],w=C[0]),v=this._lexer.defaultToken),w===null)break;for(h+=w.length;jce(v)&&q3(v)&&v.test;)v=v.test(w,C,b,h===l);let x=null;if(typeof v=="string"||Array.isArray(v))x=v;else if(v.group)x=v.group;else if(v.token!==null&&v.token!==void 0){if(v.tokenSubst?x=nd(this._lexer,v.token,w,C,b):x=v.token,v.nextEmbedded)if(v.nextEmbedded==="@pop"){if(!c)throw Kt(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw Kt(this._lexer,"cannot enter embedded language from within an embedded language");k=nd(this._lexer,v.nextEmbedded,w,C,b)}if(v.goBack&&(h=Math.max(0,h-v.goBack)),v.switchTo&&typeof v.switchTo=="string"){let N=nd(this._lexer,v.switchTo,w,C,b);if(N[0]==="@"&&(N=N.substr(1)),dw(this._lexer,N))d=d.switchTo(N);else throw Kt(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(v.transform&&typeof v.transform=="function")throw Kt(this._lexer,"action.transform not supported");if(v.next)if(v.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Kt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(v.next==="@pop"){if(d.depth<=1)throw Kt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(v.next==="@popall")d=d.popall();else{let N=nd(this._lexer,v.next,w,C,b);if(N[0]==="@"&&(N=N.substr(1)),dw(this._lexer,N))d=d.push(N);else throw Kt(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}v.log&&typeof v.log=="string"&&Kce(this._lexer,this._lexer.languageId+": "+nd(this._lexer,v.log,w,C,b))}if(x===null)throw Kt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const E=N=>{const z=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,W=this._getNestedEmbeddedLanguageData(z);if(h<l){const U=e.substr(h);return this._nestedTokenize(U,t,sd.create(d,W),n+h,s)}else return sd.create(d,W)};if(Array.isArray(x)){if(u&&u.groups.length>0)throw Kt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(C.length!==x.length+1)throw Kt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let z=1;z<C.length;z++)N+=C[z].length;if(N!==w.length)throw Kt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:C,groups:[]};for(let z=0;z<x.length;z++)u.groups[z]={action:x[z],matched:C[z+1]};h-=w.length;continue}else{if(x==="@rematch"&&(h-=w.length,w="",C=null,x="",k!==null))return E(k);if(w.length===0){if(l===0||m!==d.depth||b!==d.state||(u?u.groups.length:0)!==_)continue;throw Kt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let N=null;if(W6(x)&&x.indexOf("@brackets")===0){const z=x.substr(9),W=Qce(this._lexer,w);if(!W)throw Kt(this._lexer,"@brackets token returned but no bracket defined as: "+w);N=G3(W.token+z)}else{const z=x===""?"":x+this._lexer.tokenPostfix;N=G3(z)}f<r&&s.emit(f+n,N)}if(k!==null)return E(k)}return sd.create(d,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new rf(e,cp);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),ui.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=ui.get(e);return t?new rf(e,t.getInitialState()):new rf(e,cp)}};Yb=KN=Zce([Yce(4,$e)],Yb);function Qc
|
||
|
|
${a}: ${r};`}return i+=`
|
||
|
|
}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Cde(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class rv extends F{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class lo extends rv{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class La{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=i[n-r-1];return s}}class vde{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class wde extends vde{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 Sde{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class DL{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const s=e[i];t[i]=new DL(s.left,s.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toStrin
|
||
|
|
target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Bi.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Vn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Vn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Vn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Vn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Vn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Vn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Vn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Vn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Vn.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const J3={isAfterLines:!0};function Mk(o){return{isAfterLines:!1,horizontalDistanceToText:o}}class Hn{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=La.collect(t,this._viewHelper.viewDomNode);return!!(Xn.isChildOfContentWidgets(i)||Xn.isChildOfOverflowingContentWidgets(i)||Xn.isChildOfOverlayWidgets(i)||Xn.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const r=new Cp(this._context,this._viewHelper,e),a=new Nde(r,t,i,n,s);try{const l=Hn._createMouseTarget(r,a);if(l.type===6&&r.stickyTabStops&&l.position!==null){const c=Hn._snapToSoftTabBoundary(l.position,r.viewModel),d=L.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,d,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let n=null;return!Xn.isChildOfOverflowGuard(t.targetPath)&&!Xn.isChildOfOverflowingContentWidgets(t.targetPath)&&!Xn.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(n=n||t.fulfillUnknown()),n=n||Hn._hitTestContentWidget(e,i),n=n||Hn._hitTestOverlayWidget(e,i),n=n||Hn._hitTestMinimap(e,i),n=n||Hn._hitTestScrollbarSlider(e,i),n=n||Hn._hitTestViewZone(e,i),n=n||Hn._hitTestMargin(e,i),n=n||Hn._hitTestViewCursor(e,i),n=n||Hn._hitTestTextArea(e,i),n=n||Hn._hitTestViewLines(e,i),n=n||Hn._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Xn.isChildOfContentWidgets(t.targetPath)||Xn.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Xn.isChildOfOverlayWidgets(t.targetPath)||Xn.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Xn.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillConten
|
||
|
|
`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(Ad(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(K1(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Ad(e.value,t.value),e.selectionEnd),n=Math.min(K1(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}}class lf{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t;return new L(n,1,s+1,1)}static fromEditorSelection(e,t,i,n){const r=lf._getPageOfLine(t.startLineNumber,i),a=lf._getRangeForPage(r,i),l=lf._getPageOfLine(t.endLineNumber,i),c=lf._getRangeForPage(l,i);let d=a.intersectRanges(new L(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=L.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=c.intersectRanges(new L(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const b=e.modifyPosition(f.getStartPosition(),500);f=L.fromPositions(f.getStartPosition(),b)}const m=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const b=a.intersectRanges(t),C=c.intersectRanges(t);_=e.getValueInRange(b,1)+"…"+e.getValueInRange(C,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new wn(h+_+m,h.length,h.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var Pde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eW=function(o,e){return function(t,i){e(t,i,o)}},p0;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(p0||(p0={}));const GN={forceCopyWithSyntaxHighlighting:!1};class Qb{static{this.INSTANCE=new Qb}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)}}class Ode{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let ZN=class extends F{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new O),this.onFocus=this._onFocus.event,this._onBlur=this._register(new O),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new O),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new O),this.onCut=this._onCut.event,this._onPaste=this._register(new O),this.onPaste=this._onPaste.event,this._onType=this._register(new O),this.onType=this._onType.event,this._onCo
|
||
|
|
`):t.text,i),e.preventDefault(),e.clipboardData&&YN.setTextData(e.clipboardData,t.text,t.html,i)}};ZN=Pde([eW(4,ro),eW(5,Dn)],ZN);const YN={getTextData(o){const e=o.getData(_i.text);let t=null;const i=o.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&o.files.length>0?[Array.prototype.slice.call(o.files,0).map(s=>s.name).join(`
|
||
|
|
`),null]:[e,t]},setTextData(o,e,t,i){o.setData(_i.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}};class Fde extends F{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Je(this._actual,"keydown")).event,this.onKeyUp=this._register(new Je(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Je(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Je(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Je(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Je(this._actual,"beforeinput")).event,this.onInput=this._register(new Je(this._actual,"input")).event,this.onCut=this._register(new Je(this._actual,"cut")).event,this.onCopy=this._register(new Je(this._actual,"copy")).event,this.onPaste=this._register(new Je(this._actual,"paste")).event,this.onFocus=this._register(new Je(this._actual,"focus")).event,this.onBlur=this._register(new Je(this._actual,"blur")).event,this._onSyntheticTap=this._register(new O),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>bd.onKeyDown())),this._register(this.onBeforeInput(()=>bd.onBeforeInput())),this._register(this.onInput(()=>bd.onInput())),this._register(this.onKeyUp(()=>bd.onKeyUp())),this._register(V(this._actual,p0.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=xu(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Ln()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const r=xu(n);r?s=r.activeElement:s=Ln();const a=ye(s),l=s===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){sr&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),sr&&a.parent!==a&&n.focus();return}try{const h=CZ(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),vZ(n,h)}catch{}}}class Wde extends aP{constructor(e,t,i){super(e,t,i),this._register(Qt.addTarget(this.viewHelper.linesContentDomNode)),this._register(V(this.viewHelper.linesContentDomNode,Ot.Tap,s=>this.onTap(s))),this._register(V(this.viewHelper.linesContentDomNode,Ot.Change,s=>this.onChange(s))),this._register(V(this.viewHelper.linesContentDomNode,Ot.Contextmenu,s=>this._onContextMenu(new jd(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(V(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new mde(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatch
|
||
|
|
`),v=C.substring(w+1),S=v.lastIndexOf(" "),k=v.length-S-1,x=f.getStartPosition(),E=Math.min(x.column-1,k),N=x.column-1-E,z=v.substring(0,v.length-E),{tabSize:W}=this._context.viewModel.model.getOptions(),U=Ude(this.textArea.domNode.ownerDocument,z,this._fontInfo,W);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:U}})(),{distanceToModelLineEnd:b}=(()=>{const C=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),w=C.indexOf(`
|
||
|
|
`),v=w===-1?C:C.substring(0,w),S=v.indexOf(" "),k=S===-1?v.length:v.length-S-1,x=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column,k);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column-E}})();this._context.viewModel.revealRange("keyboard",!0,L.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new zde(this._context,f.startLineNumber,m,_,b),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Wf} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${Wf}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(k_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=ar(t,[]);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=ar(this._context.configuration.options.get(132),[]);let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Ki(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(2)===1){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=p("accessibilityModeOff","The editor is not accessible at this time.");return i?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",r,i):n?p("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,n):s?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,s):r}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===ka.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(146).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Ak?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.
|
||
|
|
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:Ak?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;pn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?$.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Jb.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+IL.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};XN=Vde([tW(3,bt),tW(4,Ce)],XN);function Ude(o,e,t,i){if(e.length===0)return 0;const n=o.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const s=o.createElement("span");pn(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),n.appendChild(s),o.body.appendChild(n);const r=s.offsetWidth;return n.remove(),r}const $de=()=>!0,jde=()=>!1,Kde=o=>o===" "||o===" ";class kg{static shouldRecreate(e){return e.hasChanged(146)||e.hasChanged(132)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(129)||e.hasChanged(50)||e.hasChanged(92)||e.hasChanged(131)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(146),a=s.get(50);this.readOnly=s.get(92),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(117),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(129),this.wordSeparators=s.get(132),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(77),this.multiCursorPaste=s.get(79),this.multiCursorLimit=s.get(80),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.wordSegmenterLocales=s.get(131),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=c?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=Jh(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return C2(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Kde;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":re
|
||
|
|
* 'to': A mandatory logical position value providing where to move the cursor.
|
||
|
|
\`\`\`
|
||
|
|
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
|
||
|
|
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
|
||
|
|
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
|
||
|
|
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
|
||
|
|
\`\`\`
|
||
|
|
* 'by': Unit to move. Default is computed based on 'to' value.
|
||
|
|
\`\`\`
|
||
|
|
'line', 'wrappedLine', 'character', 'halfLine'
|
||
|
|
\`\`\`
|
||
|
|
* 'value': Number of units to move. Default is '1'.
|
||
|
|
* 'select': If 'true' makes the selection. Default is 'false'.
|
||
|
|
`,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},o.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}o.parse=t})(_0||(_0={}));class dP{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new K6(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class hP{constructor(e,t){this.model=e,this.indentationLineProcessor=new K6(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=Jh(t,e.startColumn-1);let n;if(uP(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+r;n=t.sliceAndInflate(a,l,0)}else{const r=e.startColumn-1;n=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=Jh(i,t.column-1),s=t.column-1-n.firstCharOffset,r=n.firstCharOffset+s,a=n.firstCharOffset+n.getLineLength(),l=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=g=>{this.model.tokenization.forceTokenization(g);const f=this.model.tokenization.getLineToken
|
||
|
|
`){const r=[];for(let a=0,l=i.length;a<l;a++)r[a]=this._enter(e,t,!1,i[a]);return new Ts(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(e.autoIndent===0)return Th(n,`
|
||
|
|
`,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=Dt(l).substring(0,n.startColumn-1);return Th(n,`
|
||
|
|
`+e.normalizeIndentation(c),i)}const s=Bf(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Mi.None)return Th(n,`
|
||
|
|
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mi.Indent)return Th(n,`
|
||
|
|
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mi.IndentOutdent){const l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),d=`
|
||
|
|
`+c+`
|
||
|
|
`+l;return i?new p1(n,d,!0):new m0(n,d,-1,c.length-l.length,!0)}else if(s.indentAction===Mi.Outdent){const l=b0(e,s.indentation);return Th(n,`
|
||
|
|
`+e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=Dt(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=the(e.autoIndent,t,n,{unshiftIndent:c=>b0(e,c),shiftIndent:c=>pP(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=Gn(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new p1(n,`
|
||
|
|
`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new m0(n,`
|
||
|
|
`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Th(n,`
|
||
|
|
`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new p1(new L(1,1,1,1),`
|
||
|
|
`);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class dhe{static getEdits(e,t,i,n,s,r){const a=this._distributePasteToCursors(e,i,n,s,r);return a?(i=i.sort(L.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substring(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substring(0,i.length-1));const r=Cl(i);if(r.length===t.length)return r}return null}static _distributedPaste(e,t,i,n){const s=[];for(let r=0,a=i.length;r<a;r++)s[r]=new yn(i[r],n[r]);return new Ts(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,s){const r=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],d=c.getPosition();if(s&&!c.isEmpty()&&(s=!1),s&&n.indexOf(`
|
||
|
|
`)!==n.length-1&&(s=!1),s){const h=new L(d.lineNumber,1,d.lineNumber,1);r[a]=new cP(h,n,c,!0)}else r[a]=new yn(c,n)}return new Ts(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class hhe{static getEdits(e,t,i,n,s,r,a,l){const c=n.map(d=>this._compositionType(i,d,s,r,a,l));return new Ts(4,c,{shouldPushStackElementBefore:TL(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new L(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new m0(d,i,0,r)}}class uhe{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r<a;r++)n[r]=new yn(t[r],i);const s=fP(i,e);return new Ts(s,n,{shouldPushStackElementBefore:TL(e,s),shouldPushStackElementAfter:!1})}}class ghe{static getCommands(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const d=e.normalizeIndentation(c);if(!l.startsWith(d)){n[s]=new yn(new L(a.startLineNumber,1,a.startLineNumber,l.length+1),d,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new cr(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,s="";const r=eC(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(ga(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Bf(e.autoIndent,t,new L(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===Mi.Indent&&(s=pP(e,s)),n===Mi.Outdent&&(s=b0(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d<c;d++)s+=" "}else s=" ";return new yn(i,s,n)}}class gP extends m0{constructor(e,t,i,n,s,r){super(e,t,i,n),this._openCharacter=s,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new L(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new L(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class fhe extends gP{constructor(e,t,i,n){const s=(i?t:"")+n,r=0,a=-n.length;super(e,s,r,a,t,n)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,n,t)}}class phe extends gP{constructor(e,t,i,n){const s=i+n,r=0,a=i.length;super(t,s,r,a,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:s}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length!==2)throw new Error("There should be two inverse edit operations!");const n=i[0].range,s=i[1].range,r=n.plusRange(s);return this._computeCursorStateWithRange(e,r,t)}}function fP(o,e){return o===" "?e===5||e===6?6:5:4}function TL(o,e){return nW(o)&&!nW(e)?!0:o===5?!1:iW(o)!==iW(e)}function iW(o){return o===6||o===5?"space":o}function nW(o){return o===4||o===5||o===6}function G6(o,e,t,i,n){if(o.autoClosingOvertype==="never"||!o.autoClosingPairs.autoClosingPairsCloseSingleChar.has(n))return!1;for(let s=0,r=t.length;s<r;s++){const a=t[s];if(!a.isEmpty())ret
|
||
|
|
`)>=0)return null;const r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,f]=s[h],m=c[h],_=m.range.startLineNumber,b=m.range.startColumn-1+g,C=m.range.startColumn-1+f;r.push(new L(_,C+1,_,C+2)),a.push(new L(_,b+1,_,C+2))}const d=n(c);return d&&(this._isHandling=!0),d});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 s=K_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Me(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return wW.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new q_(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(rd.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let s=0;for(;s<n;){const r=sA(t,s),a=t.substr(s,r);this._executeEditOperation(rd.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=r}}else this._executeEditOperation(rd.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,r){if(t.length===0&&i===0&&n===0){if(s!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new fe(c.lineNumber,c.column+s,c.lineNumber,c.column+s)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(rd.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,r)}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation(rd.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Ou.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Ts(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Ts(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class K_{static from(e,t){return new K_(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class wW{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._mod
|
||
|
|
`:this.model.getEOL();e=e.slice(0),e.sort(L.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d<l.length;d++)d>0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===ls||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new L(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===as.fontFamily;let c;return l?c=as.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${as.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,g=c===s?r-1:h.length;h===""?l+="<br>":l+=mie(h,d.inflate(),t,u,g,a,kn)}return l}_getColorMap(){const e=ui.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=$.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Aue);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new j_(e,!1,i
|
||
|
|
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
|
||
|
|
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Rh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Rh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return Rh._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>L.lift(i)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Bi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!A.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!L.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!A.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new L(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelec
|
||
|
|
`:`\r
|
||
|
|
`),await this._clipboardService.writeText(w)})),i.getOption(92)||_.push(new Qs("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),_},autoSelectFirstItem:!0})};this._register(li(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:m,height:_}=bi(this._diffActions),b=Math.floor(d/3);f.preventDefault(),g(f.posx,m+_+b)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(f=>{f.event.leftButton&&(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()&&(f.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),g(f.event.posx,f.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=bi(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const MW=Ec("diffEditorWidget",{createHTML:o=>o});function Kge(o,e,t,i){pn(i,e.fontInfo);const n=t.length>0,s=new jp(1e4);let r=0,a=0;const l=[];for(let u=0;u<o.lineTokens.length;u++){const g=u+1,f=o.lineTokens[u],m=o.lineBreakData[u],_=ss.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(m){let b=0;for(const C of m.breakOffsets){const w=f.sliceAndInflate(b,C,0);r=Math.max(r,AW(a,w,ss.extractWrapped(_,b,C),n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++,b=C}l.push(m.breakOffsets.length)}else l.push(1),r=Math.max(r,AW(a,f,_,n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++}r+=e.scrollBeyondLastColumn;const c=s.build(),d=MW?MW.createHTML(c):c;i.innerHTML=d;const h=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:h,viewLineCounts:l}}class qge{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class FP{static fromEditor(e){const t=e.getOptions(),i=t.get(50),n=t.get(146);return new FP(e.getModel()?.getOptions().tabSize||0,i,t.get(33),i.typicalHalfwidthCharacterWidth,t.get(105),t.get(67),n.decorationsWidth,t.get(118),t.get(100),t.get(95),t.get(51))}constructor(e,t,i,n,s,r,a,l,c,d,h){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h}}function AW(o,e,t,i,n,s,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(o*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=Po.isBasicASCII(l,n),d=Po.containsRTL(l,c,s),h=ov(new oh(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Dr.OFF,null),a);return a.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}var Gge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PW=function(o,e){return function(t,i){e(t,i,o)}};let pT=class extends F{constructor(e,t,i,n,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=U
|
||
|
|
`);let r=t;return s!==-1&&(r=t.substring(0,s)),qW(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return qW(o,t,e.createById(i),n)}function qW(o,e,t,i){return o.createModel(e,t,i)}var _fe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GW=function(o,e){return function(t,i){e(t,i,o)}};class bfe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let T0=class extends F{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Ue(this,void 0),this._collapsed=pe(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Ue(this,500),this.contentHeight=pe(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ue(this,0),this._modifiedWidth=Ue(this,0),this._originalContentWidth=Ue(this,0),this._originalWidth=Ue(this,0),this.maxScroll=pe(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Ge("div.multiDiffEntry",[Ge("div.header@header",[Ge("div.header-content",[Ge("div.collapse-button@collapseButton"),Ge("div.file-path",[Ge("div.title.modified.show-file-icons@primaryPath",[]),Ge("div.status.deleted@status",["R"]),Ge("div.title.original.show-file-icons@secondaryPath",[])]),Ge("div.actions@actions")])]),Ge("div.editorParent",[Ge("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Lc,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Zs(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Zs(this.editor.getOriginalEditor()).isFocused,this.isFocused=pe(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new K),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new KS(this._elements.collapseButton,{});this._register(Te(l=>{r.element.className="",r.icon=this._collapsed.read(l)?J.chevronRight:J.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Te(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{t_(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(Te(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild
|
||
|
|
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:gc(t,a.open),close:gc(t,a.close)});else throw Kt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function cpe(o){ep.registerLanguage(o)}function dpe(){let o=[];return o=o.concat(ep.getLanguages()),o}function hpe(o){return Ee.get(ei).languageIdCodec.encodeLanguageId(o)}function upe(o,e){return Ee.withServices(()=>{const i=Ee.get(ei).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function gpe(o,e){return Ee.withServices(()=>{const i=Ee.get(ei).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function fpe(o,e){if(!Ee.get(ei).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ee.get(ai).register(o,e,100)}class ppe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return lC.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new _y(n.tokens,n.endState)}}class lC{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new db(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=lC._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new JM(r,a)}tokenize(e,t,i){return lC.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new _y(s,r)}}function mpe(o){return typeof o.getInitialState=="function"}function _pe(o){return"tokenizeEncoded"in o}function Cz(o){return o&&typeof o.then=="function"}function bpe(o){const e=Ee.get(Vo);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=$.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function vz(o,e){return _pe(e)?new ppe(o,e):new lC(o,e,Ee.get(ei),Ee.get(Vo))}function zP(o,e){const t=new Gq(async()=>{const i=await Promise.resolve(e.create());return i?mpe(i)?vz(o,i):new Yb(Ee.get(ei),Ee.get(Vo),o,bz(o,i),Ee.get($e)):null});return ui.registerFactory(o,t)}function Cpe(o,e){if(!Ee.get(ei).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return Cz(e)?zP(o,{create:()=>e}):ui.register(o,vz(o,e))}function vpe(o,e){const t=i=>new Yb(Ee.get(ei),Ee.get(Vo),o,bz(o,i),Ee.get($e));return Cz(e)?zP(o,{create:()=>e}):ui.register(o,t(e))}function wpe(o,e){return Ee.get(ue).referenceProvider.register(o,e)}function Spe(o,e){return Ee.get(ue).renameProvider.register(o,e)}function ype(o,e){return Ee.get(ue).newSymbolNamesProvider.register(o,e)}function Lpe(o,e){return Ee.get(ue).signatureHelpProvider.register(o,e)}function xpe(o,e){return Ee.get(ue).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function kpe(o,e){return Ee.
|
||
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
||
|
|
* Released under the MIT license
|
||
|
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
|
*-----------------------------------------------------------------------------*/var sme=Object.defineProperty,ome=Object.getOwnPropertyDescriptor,rme=Object.getOwnPropertyNames,ame=Object.prototype.hasOwnProperty,lme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of rme(e))!ame.call(o,n)&&n!==t&&sme(o,n,{get:()=>e[n],enumerable:!(i=ome(e,n))||i.enumerable});return o},cme=(o,e,t)=>(lme(o,e,"default"),t),a_={};cme(a_,lv);var Vz={},Kk={},dme=class zz{static getOrCreate(e){return Kk[e]||(Kk[e]=new zz(e)),Kk[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Vz[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Le(o){const e=o.id;Vz[e]=o,a_.languages.register(o);const t=dme.getOrCreate(e);a_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),a_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();a_.languages.setLanguageConfiguration(e,i.conf)})}Le({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>we(()=>import("./abap.js"),[],import.meta.url)});Le({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>we(()=>import("./apex.js"),[],import.meta.url)});Le({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>we(()=>import("./azcli.js"),[],import.meta.url)});Le({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>we(()=>import("./bat.js"),[],import.meta.url)});Le({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>we(()=>import("./bicep.js"),[],import.meta.url)});Le({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>we(()=>import("./cameligo.js"),[],import.meta.url)});Le({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>we(()=>import("./clojure.js"),[],import.meta.url)});Le({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>we(()=>import("./coffee.js"),[],import.meta.url)});Le({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>we(()=>import("./cpp.js"),[],import.meta.url)});Le({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>we(()=>import("./cpp.js"),[],import.meta.url)});Le({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>we(()=>import("./csharp.js"),[],import.meta.url)});Le({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>we(()=>import("./csp.js"),[],import.meta.url)});Le({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>we(()=>import("./css.js"),[],import.meta.url)});Le({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>we(()=>import("./cypher.js"),[],import.meta.url)});Le({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>we(()=>import("./dart.js"),[],import.meta.url)});Le({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>we(()=>import("./dockerfile.js"),[],import.meta.url)});Le({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>we(()=>import("./ecl.js"),[],import.meta.url)});Le({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>we(()=>import("./elixir.js"),[],import.meta.url)});Le({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>we(()=>import("./flow9.js"),[],import.meta.url)});Le({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>we(()=>import("./fsharp.js"),[],import.meta.url)});Le({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","A
|
||
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
||
|
|
* Released under the MIT license
|
||
|
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
|
*-----------------------------------------------------------------------------*/var hme=Object.defineProperty,ume=Object.getOwnPropertyDescriptor,gme=Object.getOwnPropertyNames,fme=Object.prototype.hasOwnProperty,pme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gme(e))!fme.call(o,n)&&n!==t&&hme(o,n,{get:()=>e[n],enumerable:!(i=ume(e,n))||i.enumerable});return o},mme=(o,e,t)=>(pme(o,e,"default"),t),rm={};mme(rm,lv);var KP=class{constructor(e,t,i){this._onDidChange=new rm.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},qP={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},GP={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Uz=new KP("css",qP,GP),$z=new KP("scss",qP,GP),jz=new KP("less",qP,GP);rm.languages.css={cssDefaults:Uz,lessDefaults:jz,scssDefaults:$z};function ZP(){return we(()=>import("./cssMode.js"),__vite__mapDeps([13,1,2]),import.meta.url)}rm.languages.onLanguage("less",()=>{ZP().then(o=>o.setupMode(jz))});rm.languages.onLanguage("scss",()=>{ZP().then(o=>o.setupMode($z))});rm.languages.onLanguage("css",()=>{ZP().then(o=>o.setupMode(Uz))});/*!-----------------------------------------------------------------------------
|
||
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
||
|
|
* Released under the MIT license
|
||
|
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
|
*-----------------------------------------------------------------------------*/var _me=Object.defineProperty,bme=Object.getOwnPropertyDescriptor,Cme=Object.getOwnPropertyNames,vme=Object.prototype.hasOwnProperty,wme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cme(e))!vme.call(o,n)&&n!==t&&_me(o,n,{get:()=>e[n],enumerable:!(i=bme(e,n))||i.enumerable});return o},Sme=(o,e,t)=>(wme(o,e,"default"),t),WL={};Sme(WL,lv);var yme=class{constructor(e,t,i){this._onDidChange=new WL.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Lme={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},BL={format:Lme,suggest:{},data:{useDefaultDataProvider:!0}};function HL(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===G_,documentFormattingEdits:o===G_,documentRangeFormattingEdits:o===G_}}var G_="html",JW="handlebars",eB="razor",Kz=VL(G_,BL,HL(G_)),xme=Kz.defaults,qz=VL(JW,BL,HL(JW)),kme=qz.defaults,Gz=VL(eB,BL,HL(eB)),Dme=Gz.defaults;WL.languages.html={htmlDefaults:xme,razorDefaults:Dme,handlebarDefaults:kme,htmlLanguageService:Kz,handlebarLanguageService:qz,razorLanguageService:Gz,registerHTMLLanguageService:VL};function Ime(){return we(()=>import("./htmlMode.js"),__vite__mapDeps([14,1,2]),import.meta.url)}function VL(o,e=BL,t=HL(o)){const i=new yme(o,e,t);let n;const s=WL.languages.onLanguage(o,async()=>{n=(await Ime()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
|
||
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
||
|
|
* Released under the MIT license
|
||
|
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
|
*-----------------------------------------------------------------------------*/var Eme=Object.defineProperty,Nme=Object.getOwnPropertyDescriptor,Tme=Object.getOwnPropertyNames,Rme=Object.prototype.hasOwnProperty,Mme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Tme(e))!Rme.call(o,n)&&n!==t&&Eme(o,n,{get:()=>e[n],enumerable:!(i=Nme(e,n))||i.enumerable});return o},Ame=(o,e,t)=>(Mme(o,e,"default"),t),cv={};Ame(cv,lv);var Pme=class{constructor(e,t,i){this._onDidChange=new cv.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Ome={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Fme={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Zz=new Pme("json",Ome,Fme),Wme=()=>Yz().then(o=>o.getWorker());cv.languages.json={jsonDefaults:Zz,getWorker:Wme};function Yz(){return we(()=>import("./jsonMode.js"),__vite__mapDeps([15,1,2]),import.meta.url)}cv.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});cv.languages.onLanguage("json",()=>{Yz().then(o=>o.setupMode(Zz))});/*!-----------------------------------------------------------------------------
|
||
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
||
|
|
* Released under the MIT license
|
||
|
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
|
*-----------------------------------------------------------------------------*/var Bme=Object.defineProperty,Hme=Object.getOwnPropertyDescriptor,Vme=Object.getOwnPropertyNames,zme=Object.prototype.hasOwnProperty,Ume=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vme(e))!zme.call(o,n)&&n!==t&&Bme(o,n,{get:()=>e[n],enumerable:!(i=Hme(e,n))||i.enumerable});return o},$me=(o,e,t)=>(Ume(o,e,"default"),t),jme="5.4.5",yp={};$me(yp,lv);var Xz=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(Xz||{}),Qz=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(Qz||{}),Jz=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(Jz||{}),eU=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(eU||{}),tU=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(tU||{}),iU=class{constructor(o,e,t,i,n){this._onDidChange=new yp.Emitter,this._onDidExtraLibsChange=new yp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},Kme=jme,nU={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},sU=new iU({allowNonTsExtensio
|
||
|
|
`),split:o=>o.split(`\r
|
||
|
|
`),parse:o=>KL.split(o).filter(e=>!e.startsWith("#"))});class Rt{static{this.sep="."}static{this.None=new Rt("@@none@@")}static{this.Empty=new Rt("")}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+Rt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Rt((this.value?[this.value,...e]:e).join(Rt.sep))}}const tB={EDITORS:"CodeEditors",FILES:"CodeFiles"};class b_e{}const C_e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ri.add(C_e.DragAndDropContribution,new b_e);class M0{static{this.INSTANCE=new M0}constructor(){}static getInstance(){return M0.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}function gU(o){const e=new dU;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,YP(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,v_e(n))}}return e}function v_e(o){const e=o.path?ve.parse(o.path):void 0;return __e(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const w_e=Object.freeze([tB.EDITORS,tB.FILES,Ob.RESOURCES,Ob.INTERNAL_URI_LIST]);function fU(o,e=!1){const t=gU(o),i=t.get(Ob.INTERNAL_URI_LIST);if(i)t.replace(_i.uriList,i);else if(e||!t.has(_i.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ve.file(a).toString()):n.push(ve.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(_i.uriList,YP(KL.create(n)))}for(const n of w_e)t.delete(n);return t}var XP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cC=function(o,e){return function(t,i){e(t,i,o)}};class QP{async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}class Fu extends QP{constructor(){super(...arguments),this.kind=Fu.kind,this.dropMimeTypes=[_i.text],this.pasteMimeTypes=[_i.text]}static{this.id="text"}static{this.kind=new Rt("text.plain")}async getEdit(e,t){const i=e.get(_i.text);if(!i||e.has(_i.uriList))return;const n=await i.asString();return{handledMimeType:_i.text,title:p("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}}class pU extends QP{constructor(){super(...arguments),this.kind=new Rt("uri.absolute"),this.dropMimeTypes=[_i.uriList],this.pasteMimeTypes=[_i.uriList]}async getEdit(e,t){const i=await mU(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===Pe.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:_i.uriList,insertText:s,title:r,kind:this.kind}}}let A0=class extends QP{constructor(e){super(),this._workspaceContextService=e,this.kind=new Rt("uri.relative"),this.dropMimeTypes=[_i.uriList],this.pasteMimeTypes=[_i.uriList]}async getEdit(e,t){const i=await mU(e);if(!i.length||t.isCancellationRequested)return;const n=Ar(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?Ote(r.uri,s):void 0}));if(n.length)return{handledMimeType:_i.uriList,insertText:n.join(" "),title:i.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};A0=XP([cC(
|
||
|
|
`):o}function rB(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?p("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function O0(o=null,e=!1){if(!o)return p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Ar(o),i=O0(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Is(o))return o;if(o.detail){const t=o.detail;if(t.error)return qk(t.error,e);if(t.exception)return qk(t.exception,e)}return o.stack?qk(o,e):o.message?o.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var vU=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zf=function(o,e){return function(t,i){e(t,i,o)}},RT;let MT=class extends F{static{RT=this}static{this.baseId="editor.widget.postEditWidget"}constructor(e,t,i,n,s,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(be(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(be((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(h=>{s.containsPosition(h.position)||this.dispose()})),this._register(se.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ie(".post-edit-widget"),this.button=this._register(new KS(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(V(this.domNode,ee.CLICK,()=>this.showSelector()))}getId(){return RT.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=bi(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>au({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};MT=RT=vU([zf(7,oo),zf(8,ke),zf(9,bt)],MT);let F0=class extends F{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Yi),this._register(se.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async _=>{const b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,n,s))},c=(_,b)=>{hr(_)||(this._notificationService.error(b),i&&this.show(e[0],t,l))};let d;try{d=await n(a,s)}catch(_){return c(_,p("resolveError",`Error resolving edit '{0}':
|
||
|
|
{1}`,a.title,O0(_)))}if(s.isCancellationRequested)return;const h=bU(r.uri,e,d),u=e[0],g=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let f,m;try{f=await this._bulkEditService.apply(h,{editor:this._editor,token:s}),m=r.getDecorationRange(g[0])}catch(_){return c(_,p("applyError",`Error applying edit '{0}':
|
||
|
|
{1}`,a.title,O0(_)))}finally{r.deltaDecorations(g,[])}s.isCancellationRequested||i&&f.isApplied&&t.allEdits.length>1&&this.show(m??u,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(MT,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};F0=vU([zf(4,Ce),zf(5,qC),zf(6,Li)],F0);var I_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ig=function(o,e){return function(t,i){e(t,i,o)}},Ah;const wU="editor.changePasteType",tO=new re("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),Gk="application/vnd.code.copyMetadata";let xc=class extends F{static{Ah=this}static{this.ID="editor.contrib.copyPasteActionController"}static get(e){return e.getContribution(Ah.ID)}constructor(e,t,i,n,s,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(V(l,"copy",c=>this.handleCopy(c))),this._register(V(l,"cut",c=>this.handleCopy(c))),this._register(V(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new P0("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(F0,"pasteIntoEditor",e,tO,{id:wU,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},zp().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const n=this._editor.getOption(37);let s=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!n)return;s=[new L(s[0].startLineNumber,1,s[0].startLineNumber,1+t.getLineLength(s[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,kn),c={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:c});return}const h=gU(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),g=jL();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:c});const f=Gi(async m=>{const _=Ar(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,s,h,m)}catch(C){console.error(C);return}})));_.reverse();for(const b of _)for(const[C,w]of b)h.replace(C,w);return h});Ah._currentCopyOperation?.dataTransferPromise.cancel(),Ah._currentCopyOperation={handle:g,dataTransferPromise:f}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;eo.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||this._editor.getOption(92)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e),s=fU(e.clipboardData);s.delete(Gk);const r=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],_i.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(l=>{const c=this._pasteAsActionContext?.preferred;return c&&l.providedPasteEditKinds&&!this.providerMatchesPreference(l,c)?!1
|
||
|
|
`),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=Vl._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new fe(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(ni.delete(new L(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(ni.insert(new A(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=Vl.nextVisibleColumn(h,n,d.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Vl.nextVisibleColumn(h,n,d.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class bO extends de{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ai);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>L.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d<l.length;d++){const h=l[d];c.selection.endLineNumber===h.selection.startLineNumber&&(c.index<h.index?h.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=h))}for(const d of l)s.push(new Vl(i,d.selection,r.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class UCe extends bO{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class $Ce extends bO{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2081),weight:100}})}}class jCe extends bO{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2099),weight:100}})}}class KCe extends de{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(ai);if(!t.hasModel())return;const n=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new wd(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}X(UCe);X($Ce);X(jCe);X(KCe);var qCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(
|
||
|
|
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<n){const l=o.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Ac=new re("findWidgetVisible",!1);Ac.toNegated();const tx=new re("findInputFocussed",!1),vO=new re("replaceInputFocussed",!1),Lw={primary:545,mac:{primary:2593}},xw={primary:565,mac:{primary:2613}},kw={primary:560,mac:{primary:2608}},Dw={primary:554,mac:{primary:2602}},Iw={primary:558,mac:{primary:2606}},Ht={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},Sd=19999,sve=240;class Y_{constructor(e,t){this._toDispose=new K,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Hr,this._decorations=new vr(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new yt(()=>{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,It(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)},sve)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new L(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,Sd);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=wb(n.map(l=>l.range),l=>L.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decoratio
|
||
|
|
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return BB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return HB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(WB|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{kn&&ll&&!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(FB,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
|
||
|
|
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return BB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return HB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new pR(null,this._contextViewProvider,{width:Nve,label:mve,placeholder:_ve,appendCaseSensitiveLabel:this._keybindingLabelFor(Ht.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ht.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ht.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>MB(this._keybindingService),inputBoxStyles:PS,toggleStyles:AS},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),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(d=>{d.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),cs&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(up());this._prevBtn=this._register(new Mg({label:bve+this._keybindingLabelFor(Ht.PreviousMatchFindAction),icon:gve,hoverDelegate:i,onTrigger:()=>{cd(this._codeEditor.getAction(Ht.PreviousMatchFindAction)).run().then(void 0,Me)}},this._hoverService)),this._nextBtn=this._register(new Mg({label:Cve+this._keybindingLabelFor(Ht.NextMatchFindAction),icon:fve,hoverDelegate:i,onTrigger:()=>{cd(this._codeEditor.getAction(Ht.NextMatchFindAction)).run().then(void 0,Me)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",n.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new em({icon:dve,title:vve+this._keybindingLabelFor(Ht.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:ce(UC),inputActiveOptionBorder:ce(qy),inputActiveOptionForeground:ce(Gy)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._cl
|
||
|
|
* 'levels': Number of levels to unfold. If not set, defaults to 1.
|
||
|
|
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
|
||
|
|
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
|
||
|
|
`,constraint:H$,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?F$(t,!1,s,r):dm(t,!1,s,r)}}class gwe extends Fn{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2142),weight:100}})}invoke(e,t,i,n){dm(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class fwe extends Fn{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
|
||
|
|
* 'levels': Number of levels to fold.
|
||
|
|
* 'direction': If 'up', folds given number of levels up otherwise folds down.
|
||
|
|
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
|
||
|
|
If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
|
||
|
|
`,constraint:H$,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?Kve(t,!0,s):a==="up"?F$(t,!0,r||1,s):dm(t,!0,r||1,s)}}class pwe extends Fn{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);xO(t,1,n)}}class mwe extends Fn{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);dm(t,!0,Number.MAX_VALUE,n)}}class _we extends Fn{constructor(){super({id:"editor.toggleFoldRecursively",label:p("toggleFoldRecursivelyAction.label","Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);xO(t,Number.MAX_VALUE,n)}}class bwe extends Fn{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DO(t,Co.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Ro(a.blockCommentStartToken));kO(t,l,!0)}}}}class Cwe extends Fn{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DO(t,Co.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);kO(t,l,!0)}}}}class vwe extends Fn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DO(t,Co.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);kO(t,l,!1)}}}}class wwe extends Fn{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);W$(t,!0,n)}}class Swe extends Fn{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);W$(t,!1,n)}}class ywe extends Fn{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2069),weight:100}})}invoke(e,t,i){dm(t,!0)}}class Lwe extends Fn{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:In,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2088),weight:100}})}invoke(e,t,i){dm(t,!1)}}class CC extends Fn{static{this.ID_PREFIX="editor.foldLevel"}static{this.ID=e=>CC.ID_PREFIX+e}getFoldingLevel(){return parseInt(this.id.substr(CC.ID_PREFIX.length))}invoke(e,t,i){qve(t,this.getFo
|
||
|
|
`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class Y0{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=Cl(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class SR{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new Y0(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=Cl(this.text)}renderForScreenReader(e){return this.newLines.join(`
|
||
|
|
`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function KB(o,e){return Jt(o,e,U$)}function U$(o,e){return o===e?!0:!o||!e?!1:o instanceof vC&&e instanceof vC||o instanceof SR&&e instanceof SR?o.equals(e):!1}const Fwe=[];function Wwe(){return Fwe}class $${constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new gt(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new L(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function j$(o,e){const t=new K,i=o.createDecorationsCollection();return t.add(YC({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function Bwe(o,e){return new A(o.lineNumber+e.lineNumber-1,e.lineNumber===1?o.column+e.column-1:e.column)}function qB(o,e){return new A(o.lineNumber-e.lineNumber+1,o.lineNumber-e.lineNumber===0?o.column-e.column+1:o.column)}var Hwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Vwe=function(o,e){return function(t,i){e(t,i,o)}};const GB="ghost-text";let yR=class extends F{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Ue(this,!1),this.currentTextModel=wt(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=pe(this,n=>{if(this.isDisposed.read(n))return;const s=this.currentTextModel.read(n);if(s!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof SR?r.columnRange:void 0,l=[],c=[];function d(m,_){if(c.length>0){const b=c[c.length-1];_&&b.decorations.push(new ss(b.content.length+1,b.content.length+1+m[0].length,_,0)),b.content+=m[0],m=m.slice(1)}for(const b of m)c.push({content:b,decorations:_?[new ss(1,b.length+1,_,0)]:[]})}const h=s.getLineContent(r.lineNumber);let u,g=0;for(const m of r.parts){let _=m.lines;u===void 0?(l.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):d([h.substring(g,m.column-1)],void 0),_.length>0&&(d(_,GB),u===void 0&&m.column<=h.length&&(u=m.column)),g=m.column-1}u!==void 0&&d([h.substring(g)],void 0);const f=u!==void 0?new $$(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:f,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:s}}),this.decorations=pe(this,n=>{const s=this.uiState.read(n);if(!s)return[];const r=[];s.replacedRange&&r.push({range:s.replacedRange.toRange(s.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),s.hiddenRange&&r.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of s.inlineTexts)r.push({range:L.fromPositions(new A(s.lineNumber,a.column)),options:{description:GB,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Nr.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new zwe(this.editor,this.languageService.languageIdCodec,pe(n=>{const s=this.uiState.read(n);return s?{lineNumber:s.lineNumber,additionalLines:s.additionalLines,minReservedLineCount:s.additionalReservedLineCount,targetTextModel:s.targetTextModel}:void 0}))),this._register(be(()=>{this.isDisposed.set(!0,void 0)})),this._register(j$(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.vie
|
||
|
|
`),n=e.replace(/\r\n|\r/g,`
|
||
|
|
`)}withRange(e){return new X0(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new dl(this.range,this.insertText)}}function Gwe(o,e){const t=e.getWordAtPosition(o),i=e.getLineMaxColumn(o.lineNumber);return t?new L(o.lineNumber,t.startColumn,o.lineNumber,i):L.fromPositions(o,o.with(void 0,i))}function YB(o,e,t,i){const s=t.getLineContent(e.lineNumber).substring(0,e.column-1)+o,a=t.tokenization.tokenizeLineWithEdit(e,s.length-(e.column-1),o)?.sliceAndInflate(e.column-1,s.length,0);return a?$we(a,i):o}function bu(o,e,t){const i=t?o.range.intersectRanges(t):o.range;if(!i)return o;const n=e.getValueInRange(i,1),s=Ad(n,o.text),r=ks.ofText(n.substring(0,s)).addToPosition(o.range.getStartPosition()),a=o.text.substring(s),l=L.fromPositions(r,o.range.getEndPosition());return new dl(l,a)}function q$(o,e){return o.text.startsWith(e.text)&&Zwe(o.range,e.range)}function XB(o,e,t,i,n=0){let s=bu(o,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=Dt(r).length;if(s.range.startColumn-1<=a){const f=Dt(s.text).length,m=r.substring(s.range.startColumn-1,a),[_,b]=[s.range.getStartPosition(),s.range.getEndPosition()],C=_.column+m.length<=b.column?_.delta(0,m.length):b,w=L.fromPositions(C,b),v=s.text.startsWith(m)?s.text.substring(m.length):s.text.substring(f);s=new dl(w,v)}const c=e.getValueInRange(s.range),d=Ywe(c,s.text);if(!d)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=d.filter(m=>m.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==c.length)return}const g=s.text.length-n;for(const f of d){const m=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&m<i.column||f.originalLength>0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,b=Math.max(f.modifiedStart,Math.min(_,g)),C=s.text.substring(f.modifiedStart,b),w=s.text.substring(b,Math.max(f.modifiedStart,_));C.length>0&&u.push(new Y0(m,C,!1)),w.length>0&&u.push(new Y0(m,w,!0))}return new vC(h,u)}function Zwe(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}let Rw;function Ywe(o,e){if(Rw?.originalValue===o&&Rw?.newValue===e)return Rw?.changes;{let t=JB(o,e,!0);if(t){const i=QB(t);if(i>0){const n=JB(o,e,!1);n&&QB(n)<i&&(t=n)}}return Rw={originalValue:o,newValue:e,changes:t},t}}function QB(o){let e=0;for(const t of o)e+=t.originalLength;return e}function JB(o,e,t){if(o.length>5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;h<u;h++){const g=c.charCodeAt(h);g>d&&(d=g)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let g=0,f=c.length;g<f;g++)if(t&&c[g]==="("){const m=h*100+d;u[g]=s(2*m),d++}else if(t&&c[g]===")"){d=Math.max(d-1,0);const m=h*100+d;u[g]=s(2*m+1),d===0&&h++}else u[g]=c.charCodeAt(g);return u}const a=r(o),l=r(e);return new Ja({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var Xwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},e7=function(o,e){return function(t,i){e(t,i,o)}};let LR=class extends F{constructor(e,t,i,n,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=s,this._updateOperation=this._register(new Yi),this.inlineCompletions=Pb("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=Pb("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOpera
|
||
|
|
Invalid subtraction between ${i.toString()} and ${s.toString()}`)),[];const c=f1e(t.text,l);return n.map(d=>{const h=Bwe(qB(d,s),r),u=o.getValueInRange(L.fromPositions(d,h)),g=Ad(a,u),f=L.fromPositions(d,d.delta(0,g));return new dl(f,c)})}function f1e(o,e){let t="";const i=sG(o);for(let n=e.lineNumber-1;n<i.length;n++)t+=i[n].substring(n===e.lineNumber-1?e.column-1:0);return t}function h7(o){const e=R1.createSortPermutation(o,rs(s=>s.range,L.compareRangesUsingStarts)),i=new NA(e.apply(o)).getNewRanges();return e.inverse().apply(i).map(s=>s.getEndPosition())}var p1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},u7=function(o,e){return function(t,i){e(t,i,o)}},d_;class RO{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;s<i.length;s++){const{score:r,completion:a}=i[s];if(r[0]!==n)break;if(a.preselect)return s}return 0}}class g7 extends RO{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class m1e extends RO{constructor(){super("recentlyUsed"),this._cache=new wl(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let r=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===s;c++){const d=`${e.getLanguageId()}/${i[c].textLabel}`,h=this._cache.peek(d);if(h&&h.touch>l&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:hb.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class _1e extends RO{constructor(){super("recentlyUsedByPrefix"),this._trie=If.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===r.type&&c===r.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:hb.fromString(i.type),this._trie.set(t,i)}}}let kR=class{static{d_=this}static{this._strategyCtors=new Map([["recentlyUsedByPrefix",_1e],["recentlyUsed",m1e],["first",g7]])}static{this._storagePrefix="suggest/memories"}constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new K,this._persistSoon=new yt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Wb.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){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const n=d_._strategyCtors.get(i)||g7;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.share
|
||
|
|
`,s+=`prefix: ${e.word??"(no prefix)"}
|
||
|
|
`,s+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
|
||
|
|
`,s+=`distance: ${e.distance} (localityBonus-setting)
|
||
|
|
`,s+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
|
||
|
|
`,s+=`commit_chars: ${e.completion.commitCharacters?.join("")}
|
||
|
|
`,n=new Rn().appendCodeblock("empty",s),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!AO(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const s=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=s,this._type.title=s,Gs(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(s))}else gn(this._type),this._type.title="",Jn(this._type),this.domNode.classList.add("no-type");if(gn(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),gn(this._docs);const s=this._markdownRenderer.render(n);this._docs.appendChild(s.element),this._renderDisposeable.add(s),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=s=>{s.preventDefault(),s.stopPropagation()},this._close.onclick=s=>{s.preventDefault(),s.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new pt(e,t);pt.equals(i,this._size)||(this._size=i,dZ(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}};NR=D1e([I1e(1,Ce)],NR);class E1e{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new K,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new aO,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=Wd(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new pt(220,2*s.lineHeight),a=e.top,l=(function(){const S=n.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),k=-s.borderWidth+e.left+e.width,x=new pt(S,n.height-e.top-s.borderHeight-s.verticalPadding),E=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:k,fit:S-t.width,maxSizeTop:x,maxSizeBottom:E,minSize:r.with(Math.min(S,r.width))}})(),c=(function(){const S=e.left-s.borderWidth-s.hor
|
||
|
|
.monaco-editor .ghost-text-decoration,
|
||
|
|
.monaco-editor .ghost-text-decoration-preview,
|
||
|
|
.monaco-editor .ghost-text {
|
||
|
|
font-family: ${g};
|
||
|
|
}`}))),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(150)&&(n=p("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),us(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new A(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}};dr=AR=j1e([Al(1,Ce),Al(2,ke),Al(3,$e),Al(4,Ft),Al(5,Wo),Al(6,ue),Al(7,sh),Al(8,bt),Al(9,ro)],dr);function K1e(o,e){const t=Ue("result",[]),i=[];return e.add(Te(n=>{const s=o.read(n);si(r=>{if(s.length!==i.length){i.length=s.length;for(let a=0;a<i.length;a++)i[a]||(i[a]=Ue("item",s[a]));t.set([...i],r)}i.forEach((a,l)=>a.set(s[l],r))})})),t}class PO extends de{static{this.ID=QU}constructor(){super({id:PO.ID,label:p("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:q.and(D.writable,Kn.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){dr.get(t)?.model.get()?.next()}}class OO extends de{static{this.ID=XU}constructor(){super({id:OO.ID,label:p("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:q.and(D.writable,Kn.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){dr.get(t)?.model.get()?.previous()}}class q1e extends de{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:p("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:D.writable})}async run(e,t){const i=dr.get(t);await Z8(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class G1e extends de{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:p("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:q.and(D.writable,Kn.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:q.and(D.writable,Kn.inlineSuggestionVisible)},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:p("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=dr.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class Z1e extends de{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:p("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:q.and(D.writable,Kn.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:p("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=dr.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class Y1e extends de{constructor(){super({id:YU,label:p("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Kn.inlineSuggestionVisible,menuOpts:[{menuId:M.InlineSuggestionToolbar,title:p("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:q.and(Kn.inlineSuggestionVisible,D.tabMovesFocus.toNegated(),Kn.inlineSuggestionHasIndentationLessThanTabSize,Ve.Visible.toNegated(),D.hoverFocused.toNegated())}})}async run(e,t){const i=dr.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}class FO extends de{static{this.ID="editor.action.inlineSuggest.hi
|
||
|
|
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
|
||
|
|
`):this._isCopyingDown?t.addEditOperation(new L(i.startLineNumber,1,i.startLineNumber,1),s+`
|
||
|
|
`):t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
|
||
|
|
`+s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=fe.createWithDirection(n,s,r,a,this._selectionDirection)}return i}}var ZSe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},YSe=function(o,e){return function(t,i){e(t,i,o)}};let jR=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const{tabSize:a,indentSize:l,insertSpaces:c}=e.getOptions(),d=this.buildIndentConverter(a,l,c);if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const h=r.startLineNumber,u=this._isMovingDown?h+1:h-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new L(1,1,1,1),null):(t.addEditOperation(new L(h,1,h,1),e.getLineContent(u)),t.addEditOperation(new L(u,1,u,e.getLineMaxColumn(u)),null)),r=new fe(u,1,u,1)}else{let h,u;if(this._isMovingDown){h=r.endLineNumber+1,u=e.getLineContent(h),t.addEditOperation(new L(h-1,e.getLineMaxColumn(h-1),h,e.getLineMaxColumn(h)),null);let g=u;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,d,a,h,r.startLineNumber-1);if(f!==null){const _=Dt(e.getLineContent(h)),b=f+Us(_,a);g=tb(b,a,c)+this.trimStart(u)}else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?e.getLineContent(h):e.getLineContent(C)},b=H_(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const C=Dt(e.getLineContent(h)),w=Us(b,a),v=Us(C,a);w!==v&&(g=tb(w,a,c)+this.trimStart(u))}}t.addEditOperation(new L(r.startLineNumber,1,r.startLineNumber,1),g+`
|
||
|
|
`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,g);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,m);else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.tokenization.getLineTokens(C-1):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?g:C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.getLineContent(C-1):e.getLineContent(C)},b=H_(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const C=Dt(e.getLineContent(r.startLineNumber)),w=Us(b,a),v=Us(C,a);if(w!==v){const S=w-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new L(r.startLineNumber,1,r.startLineNumber,1),g+`
|
||
|
|
`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new L(h,1,h+1,1),null),t.addEditOperation(new L(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),`
|
||
|
|
`+u),this.shouldAutoIndent(e,r)){const g={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:m=>m===h?e.getLineContent(r.startLineNumber):e.getLineContent(m)},f=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,f);else{const m=H_(this._autoIndent,g,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const _=Dt(e.getLineContent(r.startLineNumber)),b=Us(m,a),C=Us(_,a);if(b!==C){const w=b-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>cr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>cr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===Mi.None||s.indentAction===Mi.Indent?r=s.indentation+s.appendText:s.indentAction===Mi.IndentOutdent?r=s.indentation:s.indentAction===Mi.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=Dt(e.getLineContent(n));let c=Dt(r);const d=q6(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=Us(c,i),u=Us(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(ga(r)>=0){const a=e.getLineMaxColumn(s),l=Bf(this._autoIndent,e,new L(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(ga(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Bf(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),ga(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Bf(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=Dt(l),h=Us(c,n)+r,u=tb(h,n,s);u!==c&&(t.addEditOperation(new L(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};jR=ZSe([YSe(3,ai)],jR);class Cu{static{this._COLLATOR=null}static getCollator(){return Cu._COLLATOR||(Cu._COLLATOR=new Intl.Collator),Cu._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=XSe(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=tj(e,t,i);if(!n)return!1;for(let s=0,r=n.before.length;s<r;s++)if(n.before[s]!==n.after[s])return!0;return!1}}function tj(o,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(Cu.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function XSe(o,e,t){const i=tj(o,e,t);return i?ni.replace(new L(i.startLineNumber,1,i.endLineNumber,o.getLineMax
|
||
|
|
`)):null}class ij extends de{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>L.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r<i.length;r++){const a=i[r];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const r of i)s.push(new ej(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class QSe extends ij{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:p("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class JSe extends ij{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:p("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class e0e extends de{constructor(){super({id:"editor.action.duplicateSelection",label:p("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:D.writable,menuOpts:{menuId:M.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=[],s=t.getSelections(),r=t.getModel();for(const a of s)if(a.isEmpty())n.push(new ej(a,!0));else{const l=new fe(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new Zde(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class nj extends de{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(ai),n=[],s=t.getSelections()||[],r=t.getOption(12);for(const a of s)n.push(new jR(a,this.down,r,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class t0e extends nj{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:p("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class i0e extends nj{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:p("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class sj extends de{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();n.length===1&&n[0].isEmpty()&&(n=[new fe(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const r of n)if(!Cu.canRun(t.getModel(),r,this.descending))return;const s=[];for(let r=0,a=n.length;r<a;r++)s[r]=new Cu(n[r],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class n0e extends sj{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:p("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:D.writable})}}class s0e extends sj{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:p("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:D.writable})}}class o0e extends de{constructor(){super({id:"editor.action.removeDuplicateLines",label:p("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:D.writable})}run(e,t){if(!t.h
|
||
|
|
`))),s.push(f),r+=c.endLineNumber-c.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,n,a?s:void 0),t.pushUndoStop()}}class KO extends de{static{this.ID="editor.action.trimTrailingWhitespace"}constructor(){super({id:KO.ID,label:p("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:Ai(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new A(d.positionLineNumber,d.positionColumn)));const s=t.getSelection();if(s===null)return;const r=e.get($e),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),c=new qSe(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}}class r0e extends de{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l<c;l++){const d=i[l];let h=d.startLineNumber,u=d.endLineNumber,g=1,f=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,f=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(ni.replace(new fe(h,g,u,f),"")),a.push(new fe(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(r-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:r,positionColumn:s.positionColumn}});t.sort((s,r)=>s.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class a0e extends de{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,rd.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class l0e extends de{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:2140,weight:100}})}run(e,t){Hf.Outdent.runEditorCommand(e,t,null)}}class c0e extends de{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,NL.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class d0e extends de{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:D.writable,kbOpts:{kbExpr:D.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,NL.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class oj extends de{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;l<c;l++){const d=n[l],h=n[l+1];L.intersectRanges(d,h)===null?s.push(d):n[l+1]=L.plusRange(d,h)}s.push(n[n.length-1]);const r=this._getEndCursorState(i,s),a=s.map(l=>ni.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class h0e extends oj{constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",preconditio
|
||
|
|
`);return new xC(e,t,n,c,s,r,d)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Hw(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 Hw(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(132):null,!1);return i?new fe(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 Hw(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 Hw(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(132):null,!1);return i?new fe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824)}}class Pp extends F{static{this.ID="editor.contrib.multiCursorController"}static get(e){return e.getContribution(Pp.ID)}constructor(e){super(),this._sessionDispose=this._register(new K),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=xC.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 fe(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){cons
|
||
|
|
`));return{text:l.text.join(`
|
||
|
|
`),shift:l.shift}}),this._originalModel=zn(()=>this._modelService.createModel("",null,p_._createUniqueUri())).keepObserved(this._store),this._modifiedModel=zn(()=>this._modelService.createModel("",null,p_._createUniqueUri())).keepObserved(this._store),this._diff=pe(this,r=>this._diffPromise.read(r)?.promiseResult.read(r)?.data),this._diffPromise=pe(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._editor.getModel();if(!l)return;const c=mD(l.getValueInRange(a.range).split(`
|
||
|
|
`)).text.join(`
|
||
|
|
`),d=mD(a.text.split(`
|
||
|
|
`)).text.join(`
|
||
|
|
`);this._originalModel.get().setValue(c),this._modifiedModel.get().setValue(d);const h=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return aL.fromFn(async()=>{const u=await h.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!u.identical)return u.changes})}),this._register(Es((r,a)=>{if(!this._model.read(r)||this._position.get()===null)return;const c=a.add(this._instantiationService.createInstance(eM,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(c),a.add(be(()=>e.removeOverlayWidget(c)))}))}};JR=p_=dj([I1(2,Ce),I1(3,av),I1(4,Ut)],JR);let eM=class extends F{static{QR=this}static{this.id=0}constructor(e,t,i,n,s,r){super(),this._editor=e,this._position=t,this._text=i,this._shift=n,this._diff=s,this._instantiationService=r,this.id=`InlineEditSideBySideContentWidget${QR.id++}`,this.allowEditorOverflow=!1,this._nodes=ie("div.inlineEditSideBySide",void 0),this._scrollChanged=Sn("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(Br,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=Zs(this._previewEditor),this._editorObs=Zs(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(da,"",this._editor.getModel()?.getLanguageId()??ls,da.DEFAULT_CREATION_OPTIONS,null)),this._setText=pe(a=>{const l=this._text.read(a);l&&this._previewTextModel.setValue(l)}).recomputeInitiallyAndOnChange(this._store),this._decorations=pe(this,a=>{this._setText.read(a);const l=this._position.read(a);if(!l)return{org:[],mod:[]};const c=this._diff.read(a);if(!c)return{org:[],mod:[]};const d=[],h=[];if(c.length===1&&c[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const u=this._shift.get(),g=f=>new L(f.startLineNumber+l.top-1,f.startColumn+u,f.endLineNumber+l.top-1,f.endColumn+u);for(const f of c)if(f.original.isEmpty||d.push({range:g(f.original.toInclusiveRange()),options:sC}),f.modified.isEmpty||h.push({range:f.modified.toInclusiveRange(),options:x0}),f.modified.isEmpty||f.original.isEmpty)f.original.isEmpty||d.push({range:g(f.original.toInclusiveRange()),options:AP}),f.modified.isEmpty||h.push({range:f.modified.toInclusiveRange(),options:RP});else for(const m of f.innerChanges||[])f.original.contains(m.originalRange.startLineNumber)&&d.push({range:g(m.originalRange),options:m.originalRange.isEmpty()?PP:vp}),f.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()?MP:k0});return{org:d,mod:h}}),this._originalDecorations=pe(this,a=>this._decorations.read(a).org),this._modifiedDecorations=pe(this,a=>this._decorations.read(a).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(Te(a=>{const l=this._previewEditorObs.contentWidth.read(a),c=this._text.read(a).split(`
|
||
|
|
`).length-1,d=this._editor.getOption(67)*c;l<=0||this._previewEditor.layout({height:d,width:l})})),this._register(Te(a=>{this._position.read(a),this._editor.layoutOverlayWidget(this)})),this._register(Te(a=>{this._scrollChanged.read(a),this._position.read(a)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new A(e.top,1));if(!i)return null;const n=i.top-1,s=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+s+10,top:n}}}};eM=QR=dj([I1(5,Ce)],eM);var aye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lh=function(o,e){return function(t,i){e(t,i,o)}},m_;let os=class extends F{static{m_=this}static{this.ID="editor.contrib.inlineEditController"}static{this.inlineEditVisibleKey="inlineEditVisible"}static{this.inlineEditVisibleContext=new re(this.inlineEditVisibleKey,!1)}static{this.cursorAtInlineEditKey="cursorAtInlineEdit"}static{this.cursorAtInlineEditContext=new re(this.cursorAtInlineEditKey,!1)}static get(e){return e.getContribution(m_.ID)}constructor(e,t,i,n,s,r,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=s,this._configurationService=r,this._diffProviderFactoryService=a,this._modelService=l,this._isVisibleContext=m_.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=m_.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=Ue(this,void 0),this._currentWidget=zn(this._currentEdit,f=>{const m=this._currentEdit.read(f);if(!m)return;const _=m.range.endLineNumber,b=m.range.endColumn,C=m.text.endsWith(`
|
||
|
|
`)&&!(m.range.startLineNumber===m.range.endLineNumber&&m.range.startColumn===m.range.endColumn)?m.text.slice(0,-1):m.text,w=new vC(_,[new Y0(b,C,!1)]),v=m.range.startLineNumber===m.range.endLineNumber&&w.parts.length===1&&w.parts[0].lines.length===1,S=m.text==="";return!v&&!S?void 0:this.instantiationService.createInstance(GR,this.editor,{ghostText:er(w),minReservedLineCount:er(0),targetTextModel:er(this.editor.getModel()??void 0),range:er(m.range)})}),this._isAccepting=Ue(this,!1),this._enabled=wt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=wt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily);const c=Sn("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Te(f=>{this._enabled.read(f)&&(c.read(f),!this._isAccepting.read(f)&&this.getInlineEdit(e,!0))}));const d=wt(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Te(f=>{if(!this._enabled.read(f))return;const m=d.read(f);m&&this.checkCursorPosition(m)})),this._register(Te(f=>{const m=this._currentEdit.read(f);if(this._isCursorAtInlineEditContext.set(!1),!m){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const _=e.getPosition();_&&this.checkCursorPosition(_)}));const h=Sn("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Te(async f=>{this._enabled.read(f)&&(h.read(f),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const u=Sn("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Te(f=>{this._enabled.read(f)&&(u.read(f),this.getInlineEdit(e,!0))}));const g=this._register(eH());this._register(Te(f=>{const m=this._fontFamily.read(f);g.setStyle(m===""||m==="default"?"":`
|
||
|
|
.monaco-editor .inline-edit-decoration,
|
||
|
|
.monaco-editor .inline-edit-decoration-preview,
|
||
|
|
.monaco-editor .inline-edit {
|
||
|
|
font-family: ${m};
|
||
|
|
}`)})),this._register(new ZR(this.editor,this._currentWidget,this.instantiationService)),this._register(new JR(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(L.containsPosition(t.range,e))}validateInlineEdit(e,t){if(t.text.includes(`
|
||
|
|
`)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const n=t.range.endLineNumber,s=t.range.endColumn,r=e.getModel()?.getLineLength(n)??0;if(s!==r+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const n=i.getVersionId(),s=this.languageFeaturesService.inlineEditProvider.all(i);if(s.length===0)return;const r=s[0];this._currentRequestCts=new oi;const a=this._currentRequestCts.token,l=t?j1.Automatic:j1.Invoke;if(t&&await lye(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const d=await r.provideInlineEdit(i,{triggerKind:l},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(i,void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get();if(!e)return;let t=e.text;e.text.startsWith(`
|
||
|
|
`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ni.replace(L.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,Ci),this.freeEdit(e),si(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get();if(!e)return;const t=A.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get();t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,Ci),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}};os=m_=aye([Lh(1,Ce),Lh(2,ke),Lh(3,ue),Lh(4,Ft),Lh(5,$e),Lh(6,av),Lh(7,Ut)],os);function lye(o,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},o);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}let cye=class extends de{constructor(){super({id:J0e,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:q.and(D.writable,os.inlineEditVisibleContext),kbOpts:[{weight:101,primary:2,kbExpr:q.and(D.writable,os.inlineEditVisibleContext,os.cursorAtInlineEditContext)}],menuOpts:[{menuId:M.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await os.get(t)?.accept()}};class dye extends de{constructor(){const e=q.and(D.writable,q.not(os.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e}})}async run(e,t){os.get(t)?.trigger()}}class hye extends de{constructor(){const e=q.and(D.writable,os.inlineEditVisibleContext,q.not(os.cursorAtInlineEditKey));super({id:tye,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e},menuOpts:[{menuId:M.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){os.get(t)?.jumpToCurrent()}}class uye extends de{constructor(){const e=q.and(D.writable,os.cursorAtInlineEditContext);super({id:iye,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:110,primary:2646,kbExpr:e},menuOpts:[{menuId:M.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){os.get(t)?.jumpBack()}}class gye extends de{constructor(){const e=q.and(D.writable,os.inlineEditVisibleContext);super({id:eye,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:M.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await os.get(t)?.clear()}}X(cye);X(gye);X(hye);X(uye);X(dye);rt(os.ID,os,3);const fye="editor.action.inlineEdits.accept",pye="editor.action.inlineEdits.showPrevious",mye="editor.action.inlineEdits.showNext",Op=new re("inlineEditsVisible",!1,p("inlineEditsVisible","Whether an inline edit is visible")),_ye=new re("inlineEditsIsPinned",!1,p("isPinned","Whether an inline edit is visible"));class tM extends F{static{this.ID="editor.contrib.placeholderText"}constructor(e){super(),this._editor=e,this._editorObs=Zs(this._editor),this._placeholderText=this._editorObs.getOption(88),this._state=yo({owner:this,equalsFn:NS},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=bye(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=ih((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const n=Ge("div.editorPlaceholder");i.add(Te(s=>{const r=this._state.read(s),a=r?.placeholder!==void 0;n.root.style.display=a?"block":"none",n.root.innerText=r?.placeholder??""})),i.add(Te(s=>{const r=this._editorObs.lay
|
||
|
|
`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(da,"",ls,da.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(Br,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:tz},{contributions:lu.getSomeEditorContributions([Tr.ID,tM.ID,Ip.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(Br,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=Zs(this._previewEditor),this._decorations=pe(this,r=>{this._setText.read(r);const a=this._edit.read(r)?.changes;if(!a)return[];const l=[],c=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const d of a)if(d.original.isEmpty||l.push({range:d.original.toInclusiveRange(),options:sC}),d.modified.isEmpty||c.push({range:d.modified.toInclusiveRange(),options:x0}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||l.push({range:d.original.toInclusiveRange(),options:AP}),d.modified.isEmpty||c.push({range:d.modified.toInclusiveRange(),options:RP});else for(const h of d.innerChanges||[])d.original.contains(h.originalRange.startLineNumber)&&l.push({range:h.originalRange,options:h.originalRange.isEmpty()?PP:vp}),d.modified.contains(h.modifiedRange.startLineNumber)&&c.push({range:h.modifiedRange,options:h.modifiedRange.isEmpty()?MP:k0});return c}),this._layout1=pe(this,r=>{const a=this._editor.getModel(),l=this._edit.read(r);if(!l)return null;const c=l.range;let d=0;for(let g=c.startLineNumber;g<c.endLineNumberExclusive;g++){const f=a.getLineMaxColumn(g),m=this._editor.getOffsetForColumn(g,f);d=Math.max(d,m)}return{left:this._editor.getLayoutInfo().contentLeft+d}}),this._layout=pe(this,r=>{const a=this._edit.read(r);if(!a)return null;const l=a.range,c=this._editorObs.scrollLeft.read(r),d=this._layout1.read(r).left+20-c,h=this._editor.getTopForLineNumber(l.startLineNumber)-this._editorObs.scrollTop.read(r),u=this._editor.getTopForLineNumber(l.endLineNumberExclusive)-this._editorObs.scrollTop.read(r),g=new bf(d,h),f=new bf(d,u),m=u-h,_=50,b=this._editor.getOption(67)*a.newLines.length,C=m-b,w=new bf(d+_,h+C/2),v=new bf(d+_,u-C/2);return{topCode:g,bottomCode:f,codeHeight:m,topEdit:w,bottomEdit:v,editHeight:b}});const s=pe(this,r=>this._edit.read(r)!==void 0||this._userPrompt.read(r)!==void 0);this._register(yc(this._elements.root,{display:pe(this,r=>s.read(r)?"block":"none")})),this._register(hf(this._editor.getDomNode(),this._elements.root)),this._register(Zs(e).createOverlayWidget({domNode:this._elements.root,position:er(null),allowEditorOverflow:!1,minContentWidthInPx:pe(r=>{const a=this._layout1.read(r)?.left;if(a===void 0)return 0;const l=this._previewEditorObs.contentWidth.read(r);return a+l})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(Te(r=>{const a=this._layout.read(r);if(!a)return;const{topCode:l,bottomCode:c,topEdit:d,bottomEdit:h,editHeight:u}=a,g=10,f=0,m=40,_=new yye().moveTo(l).lineTo(l.deltaX(g)).curveTo(l.deltaX(g+m),d.deltaX(-40-f),d.deltaX(-0)).lineTo(d).lineTo(h).lineTo(h.deltaX(-0)).curveTo(h.deltaX(-40-f),c.deltaX(g+m),c.deltaX(g)).lineTo(c).build();this._elements.path.setAttribute("d",_),this._elements.editorContainer.style.top=
|
||
|
|
`)),this._modifiedModel.get().setValue(h.join(`
|
||
|
|
`));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return aL.fromFn(async()=>{const _=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!_.identical)return new wye(Fe.fromRangeInclusive(d),u(h),_.changes)})}),this._fetchStore=this._register(new K),this._inlineEditsFetchResult=Pb(this,void 0),this._inlineEdits=yo({owner:this,equalsFn:NS},l=>this._inlineEditsFetchResult.read(l)?.completions.map(c=>new kye(c))??[]),this._fetchInlineEditsPromise=Y8({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:ua.Automatic}),handleChange:(l,c)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(c.inlineCompletionTriggerKind=ua.Explicit),!0)},async(l,c)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function d(m,_){return _(m)}const h=this._pinnedRange.range.read(l)??d(this._selection.read(l),m=>m.isEmpty()?void 0:m);if(!h){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const u={triggerKind:c.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},g=ED(this._fetchStore);await Cc(200,g);const f=await K$(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,g);g.isCancellationRequested||this._inlineEditsFetchResult.set(f,void 0)}),this._filteredInlineEditItems=yo({owner:this,equalsFn:ES()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=pe(this,l=>{const c=this._selectedInlineCompletionId.read(l),d=this._filteredInlineEditItems.read(l),h=this._selectedInlineCompletionId===void 0?-1:d.findIndex(u=>u.semanticId===c);return h===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):h}),this.selectedInlineEdit=pe(this,l=>{const c=this._filteredInlineEditItems.read(l),d=this.selectedInlineCompletionIndex.read(l);return c[d]}),this._register(Jp(this._fetchInlineEditsPromise))}async triggerExplicitly(e){Ru(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){Ru(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new gt;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}};nM=__=xye([_D(4,ue),_D(5,av),_D(6,Ut)],nM);class kye{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class Dye extends F{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Ue(this,[]),this.range=pe(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(be(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var Iye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Km=function(o,e){return function(t,i){e(t,i,o)}},sM;let kc=class extends F{static{sM=this}static{this.ID="ed
|
||
|
|
`):void 0}:{range:L.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
||
|
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
|
||
|
|
`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p("no result","No result.")),n);return r}}async function Kye(o,e,t,i){const n=new tF(e,t,o),s=await n.resolveRenameLocation(He.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,He.None)}let Xd=class{static{dM=this}static{this.ID="editor.contrib.renameController"}static get(e){return e.getContribution(dM.ID)}constructor(e,t,i,n,s,r,a,l,c){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new K,this._cts=new oi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(cM,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new oi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new tF(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new qd(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const f=i.resolveRenameLocation(n.token);this._progressService.showWhile(f,250),s=await f,e("resolved rename location")}catch(f){f instanceof Pr?e("resolve rename location cancelled",JSON.stringify(f,null," ")):(e("resolve rename location failed",f instanceof Error?f:JSON.stringify(f,null," ")),(typeof f=="string"||_a(f))&&eo.get(this.editor)?.showMessage(f||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),eo.get(this.editor)?.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new qd(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async f=>[f,await f.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(f,m)=>{let _=c.slice();return f===gb.Automatic&&(_=_.filter(([b,C])=>C)),_.map(([b])=>b.provideNewSymbolNames(a,s.range,f,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(s.range,s.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const g=WC(i.provideRenameEdits(u.newName,r.token),r.token).then(async f=>{if(!f){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(f.rejectReason){e(`returning early - rejected with reason: ${f.rejectReason}`),this._notificationService.info(f.rejectReason);return}this.editor.setSelection(L.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",s?.text,u.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",s?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&us(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applyi
|