From d707a64acbbed4e7f6cdbc03d0f10a0daf69825d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Jan 2024 09:35:31 +0000 Subject: [PATCH] (playground) genome-spy/genome-spy@87fe1d80557bb9f1c721f9ce142b437e956204f9 --- .../{index-Q0RIeOFr.js => index-C09rCq98.js} | 1013 +++++++++-------- ...nMode-HHMLu35g.js => jsonMode-7xyoogtf.js} | 2 +- playground/index.html | 2 +- 3 files changed, 538 insertions(+), 479 deletions(-) rename playground/assets/{index-Q0RIeOFr.js => index-C09rCq98.js} (72%) rename playground/assets/{jsonMode-HHMLu35g.js => jsonMode-7xyoogtf.js} (99%) diff --git a/playground/assets/index-Q0RIeOFr.js b/playground/assets/index-C09rCq98.js similarity index 72% rename from playground/assets/index-Q0RIeOFr.js rename to playground/assets/index-C09rCq98.js index 9ffccff..7e62b25 100644 --- a/playground/assets/index-Q0RIeOFr.js +++ b/playground/assets/index-C09rCq98.js @@ -1,40 +1,40 @@ -var XK=Object.defineProperty;var QK=(n,e,t)=>e in n?XK(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Dn=(n,e,t)=>(QK(n,typeof e!="symbol"?e+"":e,t),t),WD=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var ve=(n,e,t)=>(WD(n,e,"read from private field"),t?t.call(n):e.get(n)),et=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ei=(n,e,t,i)=>(WD(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);var y3=(n,e,t,i)=>({set _(s){Ei(n,e,s,t)},get _(){return ve(n,e,i)}}),tt=(n,e,t)=>(WD(n,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();/** +var gY=Object.defineProperty;var pY=(n,e,t)=>e in n?gY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Dn=(n,e,t)=>(pY(n,typeof e!="symbol"?e+"":e,t),t),GD=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var me=(n,e,t)=>(GD(n,e,"read from private field"),t?t.call(n):e.get(n)),Fe=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},_i=(n,e,t,i)=>(GD(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);var N3=(n,e,t,i)=>({set _(s){_i(n,e,s,t)},get _(){return me(n,e,i)}}),Be=(n,e,t)=>(GD(n,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const wy=globalThis,gM=wy.ShadowRoot&&(wy.ShadyCSS===void 0||wy.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fB=Symbol(),C3=new WeakMap;let JK=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==fB)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(gM&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=C3.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&C3.set(t,e))}return e}toString(){return this.cssText}};const eY=n=>new JK(typeof n=="string"?n:n+"",void 0,fB),tY=(n,e)=>{if(gM)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=wy.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},S3=gM?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return eY(t)})(n):n;/** + */const ky=globalThis,xM=ky.ShadowRoot&&(ky.ShadyCSS===void 0||ky.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,DB=Symbol(),M3=new WeakMap;let mY=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==DB)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(xM&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=M3.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&M3.set(t,e))}return e}toString(){return this.cssText}};const _Y=n=>new mY(typeof n=="string"?n:n+"",void 0,DB),bY=(n,e)=>{if(xM)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=ky.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},R3=xM?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return _Y(t)})(n):n;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:iY,defineProperty:nY,getOwnPropertyDescriptor:sY,getOwnPropertyNames:oY,getOwnPropertySymbols:rY,getPrototypeOf:aY}=Object,ad=globalThis,x3=ad.trustedTypes,lY=x3?x3.emptyScript:"",VD=ad.reactiveElementPolyfillSupport,Y0=(n,e)=>n,nE={toAttribute(n,e){switch(e){case Boolean:n=n?lY:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},gB=(n,e)=>!iY(n,e),L3={attribute:!0,type:String,converter:nE,reflect:!1,hasChanged:gB};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ad.litPropertyMetadata??(ad.litPropertyMetadata=new WeakMap);class hg extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=L3){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&nY(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=sY(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??L3}static _$Ei(){if(this.hasOwnProperty(Y0("elementProperties")))return;const e=aY(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Y0("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Y0("properties"))){const t=this.properties,i=[...oY(t),...rY(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(S3(s))}else e!==void 0&&t.push(S3(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$E_)==null||t.delete(e)}_$ES(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return tY(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:nE).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:nE;this._$Em=s,this[s]=a.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i,s=!1,o){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??gB)(s?o:this[e],t))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$E_)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$ET()}catch(s){throw e=!1,this._$ET(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$E_)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EO(t,this[t]))),this._$ET()}updated(e){}firstUpdated(e){}}hg.elementStyles=[],hg.shadowRootOptions={mode:"open"},hg[Y0("elementProperties")]=new Map,hg[Y0("finalized")]=new Map,VD==null||VD({ReactiveElement:hg}),(ad.reactiveElementVersions??(ad.reactiveElementVersions=[])).push("2.0.2");/** + */const{is:vY,defineProperty:wY,getOwnPropertyDescriptor:yY,getOwnPropertyNames:CY,getOwnPropertySymbols:SY,getPrototypeOf:xY}=Object,dd=globalThis,P3=dd.trustedTypes,LY=P3?P3.emptyScript:"",KD=dd.reactiveElementPolyfillSupport,X0=(n,e)=>n,cE={toAttribute(n,e){switch(e){case Boolean:n=n?LY:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},kB=(n,e)=>!vY(n,e),O3={attribute:!0,type:String,converter:cE,reflect:!1,hasChanged:kB};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),dd.litPropertyMetadata??(dd.litPropertyMetadata=new WeakMap);class hg extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=O3){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&wY(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=yY(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??O3}static _$Ei(){if(this.hasOwnProperty(X0("elementProperties")))return;const e=xY(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(X0("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X0("properties"))){const t=this.properties,i=[...CY(t),...SY(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(R3(s))}else e!==void 0&&t.push(R3(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$E_)==null||t.delete(e)}_$ES(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return bY(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:cE).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:cE;this._$Em=s,this[s]=a.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i,s=!1,o){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??kB)(s?o:this[e],t))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$E_)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$ET()}catch(s){throw e=!1,this._$ET(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$E_)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EO(t,this[t]))),this._$ET()}updated(e){}firstUpdated(e){}}hg.elementStyles=[],hg.shadowRootOptions={mode:"open"},hg[X0("elementProperties")]=new Map,hg[X0("finalized")]=new Map,KD==null||KD({ReactiveElement:hg}),(dd.reactiveElementVersions??(dd.reactiveElementVersions=[])).push("2.0.2");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Z0=globalThis,cC=Z0.trustedTypes,D3=cC?cC.createPolicy("lit-html",{createHTML:n=>n}):void 0,pB="$lit$",Fc=`lit$${(Math.random()+"").slice(9)}$`,mB="?"+Fc,cY=`<${mB}>`,Vh=document,A_=()=>Vh.createComment(""),T_=n=>n===null||typeof n!="object"&&typeof n!="function",_B=Array.isArray,dY=n=>_B(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",HD=`[ -\f\r]`,Um=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k3=/-->/g,E3=/>/g,Su=RegExp(`>|${HD}(?:([^\\s"'>=/]+)(${HD}*=${HD}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),I3=/'/g,A3=/"/g,bB=/^(?:script|style|textarea|title)$/i,uY=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Ti=uY(1),Hh=Symbol.for("lit-noChange"),ji=Symbol.for("lit-nothing"),T3=new WeakMap,Qu=Vh.createTreeWalker(Vh,129);function vB(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return D3!==void 0?D3.createHTML(e):e}const hY=(n,e)=>{const t=n.length-1,i=[];let s,o=e===2?"":"",r=Um;for(let a=0;a"?(r=s??Um,u=-1):d[1]===void 0?u=-2:(u=r.lastIndex-d[2].length,c=d[1],r=d[3]===void 0?Su:d[3]==='"'?A3:I3):r===A3||r===I3?r=Su:r===k3||r===E3?r=Um:(r=Su,s=void 0);const f=r===Su&&n[a+1].startsWith("/>")?" ":"";o+=r===Um?l+cY:u>=0?(i.push(c),l.slice(0,u)+pB+l.slice(u)+Fc+f):l+Fc+(u===-2?a:f)}return[vB(n,o+(n[t]||"")+(e===2?"":"")),i]};class N_{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[c,d]=hY(e,t);if(this.el=N_.createElement(c,i),Qu.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=Qu.nextNode())!==null&&l.length0){s.textContent=cC?cC.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ji}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=Np(this,e,t,0),r=!T_(e)||e!==this._$AH&&e!==Hh,r&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new Pv(e.insertBefore(A_(),o),o,void 0,t??{})}return s._$AI(n),s};/** + */const Q0=globalThis,mC=Q0.trustedTypes,F3=mC?mC.createPolicy("lit-html",{createHTML:n=>n}):void 0,EB="$lit$",Wc=`lit$${(Math.random()+"").slice(9)}$`,IB="?"+Wc,DY=`<${IB}>`,Hh=document,N_=()=>Hh.createComment(""),M_=n=>n===null||typeof n!="object"&&typeof n!="function",AB=Array.isArray,kY=n=>AB(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",YD=`[ +\f\r]`,qm=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B3=/-->/g,W3=/>/g,Eu=RegExp(`>|${YD}(?:([^\\s"'>=/]+)(${YD}*=${YD}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),V3=/'/g,H3=/"/g,TB=/^(?:script|style|textarea|title)$/i,EY=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),zt=EY(1),zh=Symbol.for("lit-noChange"),ji=Symbol.for("lit-nothing"),z3=new WeakMap,nh=Hh.createTreeWalker(Hh,129);function NB(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return F3!==void 0?F3.createHTML(e):e}const IY=(n,e)=>{const t=n.length-1,i=[];let s,o=e===2?"":"",r=qm;for(let a=0;a"?(r=s??qm,u=-1):d[1]===void 0?u=-2:(u=r.lastIndex-d[2].length,c=d[1],r=d[3]===void 0?Eu:d[3]==='"'?H3:V3):r===H3||r===V3?r=Eu:r===B3||r===W3?r=qm:(r=Eu,s=void 0);const f=r===Eu&&n[a+1].startsWith("/>")?" ":"";o+=r===qm?l+DY:u>=0?(i.push(c),l.slice(0,u)+EB+l.slice(u)+Wc+f):l+Wc+(u===-2?a:f)}return[NB(n,o+(n[t]||"")+(e===2?"":"")),i]};class R_{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[c,d]=IY(e,t);if(this.el=R_.createElement(c,i),nh.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=nh.nextNode())!==null&&l.length0){s.textContent=mC?mC.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ji}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=Mp(this,e,t,0),r=!M_(e)||e!==this._$AH&&e!==zh,r&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new zv(e.insertBefore(N_(),o),o,void 0,t??{})}return s._$AI(n),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let jg=class extends hg{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=M_(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Hh}};var uB;jg._$litElement$=!0,jg.finalized=!0,(uB=globalThis.litElementHydrateSupport)==null||uB.call(globalThis,{LitElement:jg});const $D=globalThis.litElementPolyfillSupport;$D==null||$D({LitElement:jg});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.2");/** + */let jg=class extends hg{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Rp(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return zh}};var xB;jg._$litElement$=!0,jg.finalized=!0,(xB=globalThis.litElementHydrateSupport)==null||xB.call(globalThis,{LitElement:jg});const XD=globalThis.litElementPolyfillSupport;XD==null||XD({LitElement:jg});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.2");/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const bY=n=>n.strings===void 0;/** + */const PY=n=>n.strings===void 0;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const wB={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},yB=n=>(...e)=>({_$litDirective$:n,values:e});let CB=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + */const MB={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},RB=n=>(...e)=>({_$litDirective$:n,values:e});let PB=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const X0=(n,e)=>{var i;const t=n._$AN;if(t===void 0)return!1;for(const s of t)(i=s._$AO)==null||i.call(s,e,!1),X0(s,e);return!0},dC=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},SB=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),yY(e)}};function vY(n){this._$AN!==void 0?(dC(this),this._$AM=n,SB(this)):this._$AM=n}function wY(n,e=!1,t=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{n.type==wB.CHILD&&(n._$AP??(n._$AP=wY),n._$AQ??(n._$AQ=vY))};class CY extends CB{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),SB(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,s;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),t&&(X0(this,e),dC(this))}setValue(e){if(bY(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** + */const J0=(n,e)=>{var i;const t=n._$AN;if(t===void 0)return!1;for(const s of t)(i=s._$AO)==null||i.call(s,e,!1),J0(s,e);return!0},_C=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},OB=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),BY(e)}};function OY(n){this._$AN!==void 0?(_C(this),this._$AM=n,OB(this)):this._$AM=n}function FY(n,e=!1,t=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{n.type==MB.CHILD&&(n._$AP??(n._$AP=FY),n._$AQ??(n._$AQ=OY))};class WY extends PB{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),OB(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,s;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),t&&(J0(this,e),_C(this))}setValue(e){if(PY(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const xB=()=>new SY;let SY=class{};const UD=new WeakMap,N3=yB(class extends CY{render(n){return ji}update(n,[e]){var i;const t=e!==this.G;return t&&this.G!==void 0&&this.ot(void 0),(t||this.rt!==this.lt)&&(this.G=e,this.ct=(i=n.options)==null?void 0:i.host,this.ot(this.lt=n.element)),ji}ot(n){if(typeof this.G=="function"){const e=this.ct??globalThis;let t=UD.get(e);t===void 0&&(t=new WeakMap,UD.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ct,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ct,n)}else this.G.value=n}get rt(){var n,e;return typeof this.G=="function"?(n=UD.get(this.ct??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});function M3(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function Me(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,i=new Array(e);t-1;s--){var o=t[s],r=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=o)}return Pi.head.insertBefore(e,i),n}}var KY="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function B_(){for(var n=12,e="";n-- >0;)e+=KY[Math.random()*62|0];return e}function Cm(n){for(var e=[],t=(n||[]).length>>>0;t--;)e[t]=n[t];return e}function wM(n){return n.classList?Cm(n.classList):(n.getAttribute("class")||"").split(" ").filter(function(e){return e})}function OB(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function YY(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(OB(n[t]),'" ')},"").trim()}function xx(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t].trim(),";")},"")}function yM(n){return n.size!==Aa.size||n.x!==Aa.x||n.y!==Aa.y||n.rotate!==Aa.rotate||n.flipX||n.flipY}function ZY(n){var e=n.transform,t=n.containerWidth,i=n.iconWidth,s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),r="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(o," ").concat(r," ").concat(a)},c={transform:"translate(".concat(i/2*-1," -256)")};return{outer:s,inner:l,path:c}}function XY(n){var e=n.transform,t=n.width,i=t===void 0?oE:t,s=n.height,o=s===void 0?oE:s,r=n.startCentered,a=r===void 0?!1:r,l="";return a&&IB?l+="translate(".concat(e.x/bc-i/2,"em, ").concat(e.y/bc-o/2,"em) "):a?l+="translate(calc(-50% + ".concat(e.x/bc,"em), calc(-50% + ").concat(e.y/bc,"em)) "):l+="translate(".concat(e.x/bc,"em, ").concat(e.y/bc,"em) "),l+="scale(".concat(e.size/bc*(e.flipX?-1:1),", ").concat(e.size/bc*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var QY=`:root, :host { + */const FB=()=>new VY;let VY=class{};const QD=new WeakMap,$3=RB(class extends WY{render(n){return ji}update(n,[e]){var i;const t=e!==this.G;return t&&this.G!==void 0&&this.ot(void 0),(t||this.rt!==this.lt)&&(this.G=e,this.ct=(i=n.options)==null?void 0:i.host,this.ot(this.lt=n.element)),ji}ot(n){if(typeof this.G=="function"){const e=this.ct??globalThis;let t=QD.get(e);t===void 0&&(t=new WeakMap,QD.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ct,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ct,n)}else this.G.value=n}get rt(){var n,e;return typeof this.G=="function"?(n=QD.get(this.ct??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});function U3(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function Me(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,i=new Array(e);t-1;s--){var o=t[s],r=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=o)}return Pi.head.insertBefore(e,i),n}}var uZ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function W_(){for(var n=12,e="";n-- >0;)e+=uZ[Math.random()*62|0];return e}function xm(n){for(var e=[],t=(n||[]).length>>>0;t--;)e[t]=n[t];return e}function AM(n){return n.classList?xm(n.classList):(n.getAttribute("class")||"").split(" ").filter(function(e){return e})}function YB(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function hZ(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(YB(n[t]),'" ')},"").trim()}function Tx(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t].trim(),";")},"")}function TM(n){return n.size!==Aa.size||n.x!==Aa.x||n.y!==Aa.y||n.rotate!==Aa.rotate||n.flipX||n.flipY}function fZ(n){var e=n.transform,t=n.containerWidth,i=n.iconWidth,s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),r="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(o," ").concat(r," ").concat(a)},c={transform:"translate(".concat(i/2*-1," -256)")};return{outer:s,inner:l,path:c}}function gZ(n){var e=n.transform,t=n.width,i=t===void 0?uE:t,s=n.height,o=s===void 0?uE:s,r=n.startCentered,a=r===void 0?!1:r,l="";return a&&zB?l+="translate(".concat(e.x/yc-i/2,"em, ").concat(e.y/yc-o/2,"em) "):a?l+="translate(calc(-50% + ".concat(e.x/yc,"em), calc(-50% + ").concat(e.y/yc,"em)) "):l+="translate(".concat(e.x/yc,"em, ").concat(e.y/yc,"em) "),l+="scale(".concat(e.size/yc*(e.flipX?-1:1),", ").concat(e.size/yc*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var pZ=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light"; @@ -790,18 +790,18 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { .fad.fa-inverse, .fa-duotone.fa-inverse { color: var(--fa-inverse, #fff); -}`;function FB(){var n=AB,e=TB,t=We.cssPrefix,i=We.replacementClass,s=QY;if(t!==n||i!==e){var o=new RegExp("\\.".concat(n,"\\-"),"g"),r=new RegExp("\\--".concat(n,"\\-"),"g"),a=new RegExp("\\.".concat(e),"g");s=s.replace(o,".".concat(t,"-")).replace(r,"--".concat(t,"-")).replace(a,".".concat(i))}return s}var V3=!1;function jD(){We.autoAddCss&&!V3&&(GY(FB()),V3=!0)}var JY={mixout:function(){return{dom:{css:FB,insertCss:jD}}},hooks:function(){return{beforeDOMElementCreation:function(){jD()},beforeI2svg:function(){jD()}}}},tc=Sd||{};tc[ec]||(tc[ec]={});tc[ec].styles||(tc[ec].styles={});tc[ec].hooks||(tc[ec].hooks={});tc[ec].shims||(tc[ec].shims=[]);var jr=tc[ec],BB=[],eZ=function n(){Pi.removeEventListener("DOMContentLoaded",n),hC=1,BB.map(function(e){return e()})},hC=!1;rc&&(hC=(Pi.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Pi.readyState),hC||Pi.addEventListener("DOMContentLoaded",eZ));function tZ(n){rc&&(hC?setTimeout(n,0):BB.push(n))}function Bv(n){var e=n.tag,t=n.attributes,i=t===void 0?{}:t,s=n.children,o=s===void 0?[]:s;return typeof n=="string"?OB(n):"<".concat(e," ").concat(YY(i),">").concat(o.map(Bv).join(""),"")}function H3(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}var iZ=function(e,t){return function(i,s,o,r){return e.call(t,i,s,o,r)}},qD=function(e,t,i,s){var o=Object.keys(e),r=o.length,a=s!==void 0?iZ(t,s):t,l,c,d;for(i===void 0?(l=1,d=e[o[0]]):(l=0,d=i);l=55296&&s<=56319&&t=55296&&i<=56319&&t>e+1&&(s=n.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function z3(n){return Object.keys(n).reduce(function(e,t){var i=n[t],s=!!i.icon;return s?e[i.iconName]=i.icon:e[t]=i,e},{})}function lE(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.skipHooks,s=i===void 0?!1:i,o=z3(e);typeof jr.hooks.addPack=="function"&&!s?jr.hooks.addPack(n,z3(e)):jr.styles[n]=Me(Me({},jr.styles[n]||{}),o),n==="fas"&&lE("fa",e)}var K1,Y1,Z1,_g=jr.styles,oZ=jr.shims,rZ=(K1={},On(K1,Ni,Object.values(O_[Ni])),On(K1,en,Object.values(O_[en])),K1),CM=null,WB={},VB={},HB={},zB={},$B={},aZ=(Y1={},On(Y1,Ni,Object.keys(R_[Ni])),On(Y1,en,Object.keys(R_[en])),Y1);function lZ(n){return~zY.indexOf(n)}function cZ(n,e){var t=e.split("-"),i=t[0],s=t.slice(1).join("-");return i===n&&s!==""&&!lZ(s)?s:null}var UB=function(){var e=function(o){return qD(_g,function(r,a,l){return r[l]=qD(a,o,{}),r},{})};WB=e(function(s,o,r){if(o[3]&&(s[o[3]]=r),o[2]){var a=o[2].filter(function(l){return typeof l=="number"});a.forEach(function(l){s[l.toString(16)]=r})}return s}),VB=e(function(s,o,r){if(s[r]=r,o[2]){var a=o[2].filter(function(l){return typeof l=="string"});a.forEach(function(l){s[l]=r})}return s}),$B=e(function(s,o,r){var a=o[2];return s[r]=r,a.forEach(function(l){s[l]=r}),s});var t="far"in _g||We.autoFetchSvg,i=qD(oZ,function(s,o){var r=o[0],a=o[1],l=o[2];return a==="far"&&!t&&(a="fas"),typeof r=="string"&&(s.names[r]={prefix:a,iconName:l}),typeof r=="number"&&(s.unicodes[r.toString(16)]={prefix:a,iconName:l}),s},{names:{},unicodes:{}});HB=i.names,zB=i.unicodes,CM=Lx(We.styleDefault,{family:We.familyDefault})};qY(function(n){CM=Lx(n.styleDefault,{family:We.familyDefault})});UB();function SM(n,e){return(WB[n]||{})[e]}function dZ(n,e){return(VB[n]||{})[e]}function eh(n,e){return($B[n]||{})[e]}function jB(n){return HB[n]||{prefix:null,iconName:null}}function uZ(n){var e=zB[n],t=SM("fas",n);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function xd(){return CM}var xM=function(){return{prefix:null,iconName:null,rest:[]}};function Lx(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.family,i=t===void 0?Ni:t,s=R_[i][n],o=P_[i][n]||P_[i][s],r=n in jr.styles?n:null;return o||r||null}var $3=(Z1={},On(Z1,Ni,Object.keys(O_[Ni])),On(Z1,en,Object.keys(O_[en])),Z1);function Dx(n){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.skipLookups,s=i===void 0?!1:i,o=(e={},On(e,Ni,"".concat(We.cssPrefix,"-").concat(Ni)),On(e,en,"".concat(We.cssPrefix,"-").concat(en)),e),r=null,a=Ni;(n.includes(o[Ni])||n.some(function(c){return $3[Ni].includes(c)}))&&(a=Ni),(n.includes(o[en])||n.some(function(c){return $3[en].includes(c)}))&&(a=en);var l=n.reduce(function(c,d){var u=cZ(We.cssPrefix,d);if(_g[d]?(d=rZ[a].includes(d)?OY[a][d]:d,r=d,c.prefix=d):aZ[a].indexOf(d)>-1?(r=d,c.prefix=Lx(d,{family:a})):u?c.iconName=u:d!==We.replacementClass&&d!==o[Ni]&&d!==o[en]&&c.rest.push(d),!s&&c.prefix&&c.iconName){var h=r==="fa"?jB(c.iconName):{},f=eh(c.prefix,c.iconName);h.prefix&&(r=null),c.iconName=h.iconName||f||c.iconName,c.prefix=h.prefix||c.prefix,c.prefix==="far"&&!_g.far&&_g.fas&&!We.autoFetchSvg&&(c.prefix="fas")}return c},xM());return(n.includes("fa-brands")||n.includes("fab"))&&(l.prefix="fab"),(n.includes("fa-duotone")||n.includes("fad"))&&(l.prefix="fad"),!l.prefix&&a===en&&(_g.fass||We.autoFetchSvg)&&(l.prefix="fass",l.iconName=eh(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||r==="fa")&&(l.prefix=xd()||"fas"),l}var hZ=function(){function n(){xY(this,n),this.definitions={}}return LY(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o0&&d.forEach(function(u){typeof u=="string"&&(t[a][u]=c)}),t[a][l]=c}),t}}]),n}(),U3=[],bg={},qg={},fZ=Object.keys(qg);function gZ(n,e){var t=e.mixoutsTo;return U3=n,bg={},Object.keys(qg).forEach(function(i){fZ.indexOf(i)===-1&&delete qg[i]}),U3.forEach(function(i){var s=i.mixout?i.mixout():{};if(Object.keys(s).forEach(function(r){typeof s[r]=="function"&&(t[r]=s[r]),uC(s[r])==="object"&&Object.keys(s[r]).forEach(function(a){t[r]||(t[r]={}),t[r][a]=s[r][a]})}),i.hooks){var o=i.hooks();Object.keys(o).forEach(function(r){bg[r]||(bg[r]=[]),bg[r].push(o[r])})}i.provides&&i.provides(qg)}),t}function cE(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s1?e-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:{};return rc?($h("beforeI2svg",e),ic("pseudoElements2svg",e),ic("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;We.autoReplaceSvg===!1&&(We.autoReplaceSvg=!0),We.observeMutations=!0,tZ(function(){bZ({autoReplaceSvgRoot:t}),$h("watch",e)})}},_Z={icon:function(e){if(e===null)return null;if(uC(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:eh(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],i=Lx(e[0]);return{prefix:i,iconName:eh(i,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(We.cssPrefix,"-"))>-1||e.match(FY))){var s=Dx(e.split(" "),{skipLookups:!0});return{prefix:s.prefix||xd(),iconName:eh(s.prefix,s.iconName)||s.iconName}}if(typeof e=="string"){var o=xd();return{prefix:o,iconName:eh(o,e)||e}}}},qo={noAuto:pZ,config:We,dom:mZ,parse:_Z,library:qB,findIconDefinition:dE,toHtml:Bv},bZ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot,i=t===void 0?Pi:t;(Object.keys(jr.styles).length>0||We.autoFetchSvg)&&rc&&We.autoReplaceSvg&&qo.dom.i2svg({node:i})};function kx(n,e){return Object.defineProperty(n,"abstract",{get:e}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map(function(i){return Bv(i)})}}),Object.defineProperty(n,"node",{get:function(){if(rc){var i=Pi.createElement("div");return i.innerHTML=n.html,i.children}}}),n}function vZ(n){var e=n.children,t=n.main,i=n.mask,s=n.attributes,o=n.styles,r=n.transform;if(yM(r)&&t.found&&!i.found){var a=t.width,l=t.height,c={x:a/l/2,y:.5};s.style=xx(Me(Me({},o),{},{"transform-origin":"".concat(c.x+r.x/16,"em ").concat(c.y+r.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function wZ(n){var e=n.prefix,t=n.iconName,i=n.children,s=n.attributes,o=n.symbol,r=o===!0?"".concat(e,"-").concat(We.cssPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Me(Me({},s),{},{id:r}),children:i}]}]}function LM(n){var e=n.icons,t=e.main,i=e.mask,s=n.prefix,o=n.iconName,r=n.transform,a=n.symbol,l=n.title,c=n.maskId,d=n.titleId,u=n.extra,h=n.watchable,f=h===void 0?!1:h,g=i.found?i:t,p=g.width,_=g.height,v=s==="fak",b=[We.replacementClass,o?"".concat(We.cssPrefix,"-").concat(o):""].filter(function(k){return u.classes.indexOf(k)===-1}).filter(function(k){return k!==""||!!k}).concat(u.classes).join(" "),w={children:[],attributes:Me(Me({},u.attributes),{},{"data-prefix":s,"data-icon":o,class:b,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(_)})},y=v&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/_*16*.0625,"em")}:{};f&&(w.attributes[zh]=""),l&&(w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(d||B_())},children:[l]}),delete w.attributes.title);var S=Me(Me({},w),{},{prefix:s,iconName:o,main:t,mask:i,maskId:c,transform:r,symbol:a,styles:Me(Me({},y),u.styles)}),L=i.found&&t.found?ic("generateAbstractMask",S)||{children:[],attributes:{}}:ic("generateAbstractIcon",S)||{children:[],attributes:{}},x=L.children,D=L.attributes;return S.children=x,S.attributes=D,a?wZ(S):vZ(S)}function j3(n){var e=n.content,t=n.width,i=n.height,s=n.transform,o=n.title,r=n.extra,a=n.watchable,l=a===void 0?!1:a,c=Me(Me(Me({},r.attributes),o?{title:o}:{}),{},{class:r.classes.join(" ")});l&&(c[zh]="");var d=Me({},r.styles);yM(s)&&(d.transform=XY({transform:s,startCentered:!0,width:t,height:i}),d["-webkit-transform"]=d.transform);var u=xx(d);u.length>0&&(c.style=u);var h=[];return h.push({tag:"span",attributes:c,children:[e]}),o&&h.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),h}function yZ(n){var e=n.content,t=n.title,i=n.extra,s=Me(Me(Me({},i.attributes),t?{title:t}:{}),{},{class:i.classes.join(" ")}),o=xx(i.styles);o.length>0&&(s.style=o);var r=[];return r.push({tag:"span",attributes:s,children:[e]}),t&&r.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),r}var GD=jr.styles;function uE(n){var e=n[0],t=n[1],i=n.slice(4),s=pM(i,1),o=s[0],r=null;return Array.isArray(o)?r={tag:"g",attributes:{class:"".concat(We.cssPrefix,"-").concat(Ju.GROUP)},children:[{tag:"path",attributes:{class:"".concat(We.cssPrefix,"-").concat(Ju.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(We.cssPrefix,"-").concat(Ju.PRIMARY),fill:"currentColor",d:o[1]}}]}:r={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:t,icon:r}}var CZ={found:!1,width:512,height:512};function SZ(n,e){!NB&&!We.showMissingIcons&&n&&console.error('Icon with name "'.concat(n,'" and prefix "').concat(e,'" is missing.'))}function hE(n,e){var t=e;return e==="fa"&&We.styleDefault!==null&&(e=xd()),new Promise(function(i,s){if(ic("missingIconAbstract"),t==="fa"){var o=jB(n)||{};n=o.iconName||n,e=o.prefix||e}if(n&&e&&GD[e]&&GD[e][n]){var r=GD[e][n];return i(uE(r))}SZ(n,e),i(Me(Me({},CZ),{},{icon:We.showMissingIcons&&n?ic("missingIconAbstract")||{}:{}}))})}var q3=function(){},fE=We.measurePerformance&&z1&&z1.mark&&z1.measure?z1:{mark:q3,measure:q3},x0='FA "6.4.2"',xZ=function(e){return fE.mark("".concat(x0," ").concat(e," begins")),function(){return GB(e)}},GB=function(e){fE.mark("".concat(x0," ").concat(e," ends")),fE.measure("".concat(x0," ").concat(e),"".concat(x0," ").concat(e," begins"),"".concat(x0," ").concat(e," ends"))},DM={begin:xZ,end:GB},yy=function(){};function G3(n){var e=n.getAttribute?n.getAttribute(zh):null;return typeof e=="string"}function LZ(n){var e=n.getAttribute?n.getAttribute(_M):null,t=n.getAttribute?n.getAttribute(bM):null;return e&&t}function DZ(n){return n&&n.classList&&n.classList.contains&&n.classList.contains(We.replacementClass)}function kZ(){if(We.autoReplaceSvg===!0)return Cy.replace;var n=Cy[We.autoReplaceSvg];return n||Cy.replace}function EZ(n){return Pi.createElementNS("http://www.w3.org/2000/svg",n)}function IZ(n){return Pi.createElement(n)}function KB(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.ceFn,i=t===void 0?n.tag==="svg"?EZ:IZ:t;if(typeof n=="string")return Pi.createTextNode(n);var s=i(n.tag);Object.keys(n.attributes||[]).forEach(function(r){s.setAttribute(r,n.attributes[r])});var o=n.children||[];return o.forEach(function(r){s.appendChild(KB(r,{ceFn:i}))}),s}function AZ(n){var e=" ".concat(n.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var Cy={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(s){t.parentNode.insertBefore(KB(s),t)}),t.getAttribute(zh)===null&&We.keepOriginalSource){var i=Pi.createComment(AZ(t));t.parentNode.replaceChild(i,t)}else t.remove()},nest:function(e){var t=e[0],i=e[1];if(~wM(t).indexOf(We.replacementClass))return Cy.replace(e);var s=new RegExp("".concat(We.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){var o=i[0].attributes.class.split(" ").reduce(function(a,l){return l===We.replacementClass||l.match(s)?a.toSvg.push(l):a.toNode.push(l),a},{toNode:[],toSvg:[]});i[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",o.toNode.join(" "))}var r=i.map(function(a){return Bv(a)}).join(` -`);t.setAttribute(zh,""),t.innerHTML=r}};function K3(n){n()}function YB(n,e){var t=typeof e=="function"?e:yy;if(n.length===0)t();else{var i=K3;We.mutateApproach===RY&&(i=Sd.requestAnimationFrame||K3),i(function(){var s=kZ(),o=DM.begin("mutate");n.map(s),o(),t()})}}var kM=!1;function ZB(){kM=!0}function gE(){kM=!1}var fC=null;function Y3(n){if(B3&&We.observeMutations){var e=n.treeCallback,t=e===void 0?yy:e,i=n.nodeCallback,s=i===void 0?yy:i,o=n.pseudoElementsCallback,r=o===void 0?yy:o,a=n.observeMutationsRoot,l=a===void 0?Pi:a;fC=new B3(function(c){if(!kM){var d=xd();Cm(c).forEach(function(u){if(u.type==="childList"&&u.addedNodes.length>0&&!G3(u.addedNodes[0])&&(We.searchPseudoElements&&r(u.target),t(u.target)),u.type==="attributes"&&u.target.parentNode&&We.searchPseudoElements&&r(u.target.parentNode),u.type==="attributes"&&G3(u.target)&&~HY.indexOf(u.attributeName))if(u.attributeName==="class"&&LZ(u.target)){var h=Dx(wM(u.target)),f=h.prefix,g=h.iconName;u.target.setAttribute(_M,f||d),g&&u.target.setAttribute(bM,g)}else DZ(u.target)&&s(u.target)})}}),rc&&fC.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function TZ(){fC&&fC.disconnect()}function NZ(n){var e=n.getAttribute("style"),t=[];return e&&(t=e.split(";").reduce(function(i,s){var o=s.split(":"),r=o[0],a=o.slice(1);return r&&a.length>0&&(i[r]=a.join(":").trim()),i},{})),t}function MZ(n){var e=n.getAttribute("data-prefix"),t=n.getAttribute("data-icon"),i=n.innerText!==void 0?n.innerText.trim():"",s=Dx(wM(n));return s.prefix||(s.prefix=xd()),e&&t&&(s.prefix=e,s.iconName=t),s.iconName&&s.prefix||(s.prefix&&i.length>0&&(s.iconName=dZ(s.prefix,n.innerText)||SM(s.prefix,aE(n.innerText))),!s.iconName&&We.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(s.iconName=n.firstChild.data)),s}function RZ(n){var e=Cm(n.attributes).reduce(function(s,o){return s.name!=="class"&&s.name!=="style"&&(s[o.name]=o.value),s},{}),t=n.getAttribute("title"),i=n.getAttribute("data-fa-title-id");return We.autoA11y&&(t?e["aria-labelledby"]="".concat(We.replacementClass,"-title-").concat(i||B_()):(e["aria-hidden"]="true",e.focusable="false")),e}function PZ(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Aa,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Z3(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},t=MZ(n),i=t.iconName,s=t.prefix,o=t.rest,r=RZ(n),a=cE("parseNodeAttributes",{},n),l=e.styleParser?NZ(n):[];return Me({iconName:i,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:s,transform:Aa,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:l,attributes:r}},a)}var OZ=jr.styles;function XB(n){var e=We.autoReplaceSvg==="nest"?Z3(n,{styleParser:!1}):Z3(n);return~e.extra.classes.indexOf(MB)?ic("generateLayersText",n,e):ic("generateSvgReplacementMutation",n,e)}var Ld=new Set;vM.map(function(n){Ld.add("fa-".concat(n))});Object.keys(R_[Ni]).map(Ld.add.bind(Ld));Object.keys(R_[en]).map(Ld.add.bind(Ld));Ld=Ov(Ld);function X3(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!rc)return Promise.resolve();var t=Pi.documentElement.classList,i=function(u){return t.add("".concat(W3,"-").concat(u))},s=function(u){return t.remove("".concat(W3,"-").concat(u))},o=We.autoFetchSvg?Ld:vM.map(function(d){return"fa-".concat(d)}).concat(Object.keys(OZ));o.includes("fa")||o.push("fa");var r=[".".concat(MB,":not([").concat(zh,"])")].concat(o.map(function(d){return".".concat(d,":not([").concat(zh,"])")})).join(", ");if(r.length===0)return Promise.resolve();var a=[];try{a=Cm(n.querySelectorAll(r))}catch{}if(a.length>0)i("pending"),s("complete");else return Promise.resolve();var l=DM.begin("onTree"),c=a.reduce(function(d,u){try{var h=XB(u);h&&d.push(h)}catch(f){NB||f.name==="MissingIcon"&&console.error(f)}return d},[]);return new Promise(function(d,u){Promise.all(c).then(function(h){YB(h,function(){i("active"),i("complete"),s("pending"),typeof e=="function"&&e(),l(),d()})}).catch(function(h){l(),u(h)})})}function FZ(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;XB(n).then(function(t){t&&YB([t],e)})}function BZ(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:dE(e||{}),s=t.mask;return s&&(s=(s||{}).icon?s:dE(s||{})),n(i,Me(Me({},t),{},{mask:s}))}}var WZ=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.transform,s=i===void 0?Aa:i,o=t.symbol,r=o===void 0?!1:o,a=t.mask,l=a===void 0?null:a,c=t.maskId,d=c===void 0?null:c,u=t.title,h=u===void 0?null:u,f=t.titleId,g=f===void 0?null:f,p=t.classes,_=p===void 0?[]:p,v=t.attributes,b=v===void 0?{}:v,w=t.styles,y=w===void 0?{}:w;if(e){var S=e.prefix,L=e.iconName,x=e.icon;return kx(Me({type:"icon"},e),function(){return $h("beforeDOMElementCreation",{iconDefinition:e,params:t}),We.autoA11y&&(h?b["aria-labelledby"]="".concat(We.replacementClass,"-title-").concat(g||B_()):(b["aria-hidden"]="true",b.focusable="false")),LM({icons:{main:uE(x),mask:l?uE(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:S,iconName:L,transform:Me(Me({},Aa),s),symbol:r,title:h,maskId:d,titleId:g,extra:{attributes:b,styles:y,classes:_}})})}},VZ={mixout:function(){return{icon:BZ(WZ)}},hooks:function(){return{mutationObserverCallbacks:function(t){return t.treeCallback=X3,t.nodeCallback=FZ,t}}},provides:function(e){e.i2svg=function(t){var i=t.node,s=i===void 0?Pi:i,o=t.callback,r=o===void 0?function(){}:o;return X3(s,r)},e.generateSvgReplacementMutation=function(t,i){var s=i.iconName,o=i.title,r=i.titleId,a=i.prefix,l=i.transform,c=i.symbol,d=i.mask,u=i.maskId,h=i.extra;return new Promise(function(f,g){Promise.all([hE(s,a),d.iconName?hE(d.iconName,d.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(p){var _=pM(p,2),v=_[0],b=_[1];f([t,LM({icons:{main:v,mask:b},prefix:a,iconName:s,transform:l,symbol:c,maskId:u,title:o,titleId:r,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.transform,a=t.styles,l=xx(a);l.length>0&&(s.style=l);var c;return yM(r)&&(c=ic("generateAbstractTransformGrouping",{main:o,transform:r,containerWidth:o.width,iconWidth:o.width})),i.push(c||o.icon),{children:i,attributes:s}}}},HZ={mixout:function(){return{layer:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.classes,o=s===void 0?[]:s;return kx({type:"layer"},function(){$h("beforeDOMElementCreation",{assembler:t,params:i});var r=[];return t(function(a){Array.isArray(a)?a.map(function(l){r=r.concat(l.abstract)}):r=r.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(We.cssPrefix,"-layers")].concat(Ov(o)).join(" ")},children:r}]})}}}},zZ={mixout:function(){return{counter:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.title,o=s===void 0?null:s,r=i.classes,a=r===void 0?[]:r,l=i.attributes,c=l===void 0?{}:l,d=i.styles,u=d===void 0?{}:d;return kx({type:"counter",content:t},function(){return $h("beforeDOMElementCreation",{content:t,params:i}),yZ({content:t.toString(),title:o,extra:{attributes:c,styles:u,classes:["".concat(We.cssPrefix,"-layers-counter")].concat(Ov(a))}})})}}}},$Z={mixout:function(){return{text:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.transform,o=s===void 0?Aa:s,r=i.title,a=r===void 0?null:r,l=i.classes,c=l===void 0?[]:l,d=i.attributes,u=d===void 0?{}:d,h=i.styles,f=h===void 0?{}:h;return kx({type:"text",content:t},function(){return $h("beforeDOMElementCreation",{content:t,params:i}),j3({content:t,transform:Me(Me({},Aa),o),title:a,extra:{attributes:u,styles:f,classes:["".concat(We.cssPrefix,"-layers-text")].concat(Ov(c))}})})}}},provides:function(e){e.generateLayersText=function(t,i){var s=i.title,o=i.transform,r=i.extra,a=null,l=null;if(IB){var c=parseInt(getComputedStyle(t).fontSize,10),d=t.getBoundingClientRect();a=d.width/c,l=d.height/c}return We.autoA11y&&!s&&(r.attributes["aria-hidden"]="true"),Promise.resolve([t,j3({content:t.innerHTML,width:a,height:l,transform:o,title:s,extra:r,watchable:!0})])}}},UZ=new RegExp('"',"ug"),Q3=[1105920,1112319];function jZ(n){var e=n.replace(UZ,""),t=sZ(e,0),i=t>=Q3[0]&&t<=Q3[1],s=e.length===2?e[0]===e[1]:!1;return{value:aE(s?e[0]:e),isSecondary:i||s}}function J3(n,e){var t="".concat(MY).concat(e.replace(":","-"));return new Promise(function(i,s){if(n.getAttribute(t)!==null)return i();var o=Cm(n.children),r=o.filter(function(x){return x.getAttribute(rE)===e})[0],a=Sd.getComputedStyle(n,e),l=a.getPropertyValue("font-family").match(BY),c=a.getPropertyValue("font-weight"),d=a.getPropertyValue("content");if(r&&!l)return n.removeChild(r),i();if(l&&d!=="none"&&d!==""){var u=a.getPropertyValue("content"),h=~["Sharp"].indexOf(l[2])?en:Ni,f=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(l[2])?P_[h][l[2].toLowerCase()]:WY[h][c],g=jZ(u),p=g.value,_=g.isSecondary,v=l[0].startsWith("FontAwesome"),b=SM(f,p),w=b;if(v){var y=uZ(p);y.iconName&&y.prefix&&(b=y.iconName,f=y.prefix)}if(b&&!_&&(!r||r.getAttribute(_M)!==f||r.getAttribute(bM)!==w)){n.setAttribute(t,w),r&&n.removeChild(r);var S=PZ(),L=S.extra;L.attributes[rE]=e,hE(b,f).then(function(x){var D=LM(Me(Me({},S),{},{icons:{main:x,mask:xM()},prefix:f,iconName:w,extra:L,watchable:!0})),k=Pi.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?n.insertBefore(k,n.firstChild):n.appendChild(k),k.outerHTML=D.map(function(O){return Bv(O)}).join(` -`),n.removeAttribute(t),i()}).catch(s)}else i()}else i()})}function qZ(n){return Promise.all([J3(n,"::before"),J3(n,"::after")])}function GZ(n){return n.parentNode!==document.head&&!~PY.indexOf(n.tagName.toUpperCase())&&!n.getAttribute(rE)&&(!n.parentNode||n.parentNode.tagName!=="svg")}function e5(n){if(rc)return new Promise(function(e,t){var i=Cm(n.querySelectorAll("*")).filter(GZ).map(qZ),s=DM.begin("searchPseudoElements");ZB(),Promise.all(i).then(function(){s(),gE(),e()}).catch(function(){s(),gE(),t()})})}var KZ={hooks:function(){return{mutationObserverCallbacks:function(t){return t.pseudoElementsCallback=e5,t}}},provides:function(e){e.pseudoElements2svg=function(t){var i=t.node,s=i===void 0?Pi:i;We.searchPseudoElements&&e5(s)}}},t5=!1,YZ={mixout:function(){return{dom:{unwatch:function(){ZB(),t5=!0}}}},hooks:function(){return{bootstrap:function(){Y3(cE("mutationObserverCallbacks",{}))},noAuto:function(){TZ()},watch:function(t){var i=t.observeMutationsRoot;t5?gE():Y3(cE("mutationObserverCallbacks",{observeMutationsRoot:i}))}}}},i5=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(i,s){var o=s.toLowerCase().split("-"),r=o[0],a=o.slice(1).join("-");if(r&&a==="h")return i.flipX=!0,i;if(r&&a==="v")return i.flipY=!0,i;if(a=parseFloat(a),isNaN(a))return i;switch(r){case"grow":i.size=i.size+a;break;case"shrink":i.size=i.size-a;break;case"left":i.x=i.x-a;break;case"right":i.x=i.x+a;break;case"up":i.y=i.y-a;break;case"down":i.y=i.y+a;break;case"rotate":i.rotate=i.rotate+a;break}return i},t)},ZZ={mixout:function(){return{parse:{transform:function(t){return i5(t)}}}},hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-transform");return s&&(t.transform=i5(s)),t}}},provides:function(e){e.generateAbstractTransformGrouping=function(t){var i=t.main,s=t.transform,o=t.containerWidth,r=t.iconWidth,a={transform:"translate(".concat(o/2," 256)")},l="translate(".concat(s.x*32,", ").concat(s.y*32,") "),c="scale(".concat(s.size/16*(s.flipX?-1:1),", ").concat(s.size/16*(s.flipY?-1:1),") "),d="rotate(".concat(s.rotate," 0 0)"),u={transform:"".concat(l," ").concat(c," ").concat(d)},h={transform:"translate(".concat(r/2*-1," -256)")},f={outer:a,inner:u,path:h};return{tag:"g",attributes:Me({},f.outer),children:[{tag:"g",attributes:Me({},f.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:Me(Me({},i.icon.attributes),f.path)}]}]}}}},KD={x:0,y:0,width:"100%",height:"100%"};function n5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function XZ(n){return n.tag==="g"?n.children:[n]}var QZ={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-mask"),o=s?Dx(s.split(" ").map(function(r){return r.trim()})):xM();return o.prefix||(o.prefix=xd()),t.mask=o,t.maskId=i.getAttribute("data-fa-mask-id"),t}}},provides:function(e){e.generateAbstractMask=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.mask,a=t.maskId,l=t.transform,c=o.width,d=o.icon,u=r.width,h=r.icon,f=ZY({transform:l,containerWidth:u,iconWidth:c}),g={tag:"rect",attributes:Me(Me({},KD),{},{fill:"white"})},p=d.children?{children:d.children.map(n5)}:{},_={tag:"g",attributes:Me({},f.inner),children:[n5(Me({tag:d.tag,attributes:Me(Me({},d.attributes),f.path)},p))]},v={tag:"g",attributes:Me({},f.outer),children:[_]},b="mask-".concat(a||B_()),w="clip-".concat(a||B_()),y={tag:"mask",attributes:Me(Me({},KD),{},{id:b,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,v]},S={tag:"defs",children:[{tag:"clipPath",attributes:{id:w},children:XZ(h)},y]};return i.push(S,{tag:"rect",attributes:Me({fill:"currentColor","clip-path":"url(#".concat(w,")"),mask:"url(#".concat(b,")")},KD)}),{children:i,attributes:s}}}},JZ={provides:function(e){var t=!1;Sd.matchMedia&&(t=Sd.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var i=[],s={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};i.push({tag:"path",attributes:Me(Me({},s),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var r=Me(Me({},o),{},{attributeName:"opacity"}),a={tag:"circle",attributes:Me(Me({},s),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||a.children.push({tag:"animate",attributes:Me(Me({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;1;1;0;1;"})}),i.push(a),i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;0;0;0;1;"})}]}),t||i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Me(Me({},r),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:i}}}},eX={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-symbol"),o=s===null?!1:s===""?!0:s;return t.symbol=o,t}}}},tX=[JY,VZ,HZ,zZ,$Z,KZ,YZ,ZZ,QZ,JZ,eX];gZ(tX,{mixoutsTo:qo});qo.noAuto;qo.config;qo.library;qo.dom;qo.parse;qo.findIconDefinition;qo.toHtml;var s5=qo.icon;qo.layer;qo.text;qo.counter;var iX={prefix:"fas",iconName:"table-columns",icon:[512,512,["columns"],"f0db","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 64V416H224V160H64zm384 0H288V416H448V160z"]},nX=iX,sX={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},oX=sX;function Yd(n,e,t){return n.fields=e||[],n.fname=t,n}function rX(n){return n==null?null:n.fname}function QB(n){return n==null?null:n.fields}function aX(n){return n.length===1?lX(n[0]):cX(n)}const lX=n=>function(e){return e[n]},cX=n=>{const e=n.length;return function(t){for(let i=0;ir?c():r=a+1:l==="["?(a>r&&c(),s=r=a+1):l==="]"&&(s||qi("Access path missing open bracket: "+n),s>0&&c(),s=0,r=a+1)}return s&&qi("Access path missing closing bracket: "+n),i&&qi("Access path missing closing quote: "+n),a>r&&(a++,c()),e}function Ex(n,e,t){const i=dX(n);return n=i.length===1?i[0]:n,Yd((t&&t.get||aX)(i),[n],e||n)}Ex("id");const Ix=Yd(n=>n,[],"identity");Yd(()=>0,[],"zero");Yd(()=>1,[],"one");Yd(()=>!0,[],"true");Yd(()=>!1,[],"false");var Eo=Array.isArray;function Lo(n){return n===Object(n)}function Yr(n){return n[n.length-1]}function W_(n){return n==null||n===""?null:+n}const JB=n=>e=>n*Math.exp(e),eW=n=>e=>Math.log(n*e),uX=n=>e=>Math.sign(e)*Math.log1p(Math.abs(e/n)),hX=n=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*n,gC=n=>e=>e<0?-Math.pow(-e,n):Math.pow(e,n);function EM(n,e,t,i){const s=t(n[0]),o=t(Yr(n)),r=(o-s)*e;return[i(s-r),i(o-r)]}function fX(n,e){return EM(n,e,W_,Ix)}function gX(n,e){var t=Math.sign(n[0]);return EM(n,e,eW(t),JB(t))}function pX(n,e,t){return EM(n,e,gC(t),gC(1/t))}function Ax(n,e,t,i,s){const o=i(n[0]),r=i(Yr(n)),a=e!=null?i(e):(o+r)/2;return[s(a+(o-a)*t),s(a+(r-a)*t)]}function tW(n,e,t){return Ax(n,e,t,W_,Ix)}function iW(n,e,t){const i=Math.sign(n[0]);return Ax(n,e,t,eW(i),JB(i))}function pE(n,e,t,i){return Ax(n,e,t,gC(i),gC(1/i))}function mX(n,e,t,i){return Ax(n,e,t,uX(i),hX(i))}function mE(n){return n!=null?Eo(n)?n:[n]:[]}function _X(n,e,t){let i=n[0],s=n[1],o;return s=t-e?[e,t]:[i=Math.min(Math.max(i,e),t-o),i+o]}function Co(n){return typeof n=="function"}const bX="descending";function nW(n,e,t){t=t||{},e=mE(e)||[];const i=[],s=[],o={},r=t.comparator||vX;return mE(n).forEach((a,l)=>{a!=null&&(i.push(e[l]===bX?-1:1),s.push(a=Co(a)?a:Ex(a,null,t)),(QB(a)||[]).forEach(c=>o[c]=1))}),s.length===0?null:Yd(r(s,i),Object.keys(o))}const sW=(n,e)=>(ne||e==null)&&n!=null?1:(e=e instanceof Date?+e:e,(n=n instanceof Date?+n:n)!==n&&e===e?-1:e!==e&&n===n?1:0),vX=(n,e)=>n.length===1?wX(n[0],e[0]):yX(n,e,n.length),wX=(n,e)=>function(t,i){return sW(n(t),n(i))*e},yX=(n,e,t)=>(e.push(0),function(i,s){let o,r=0,a=-1;for(;r===0&&++an}function IM(n){for(let e,t,i=1,s=arguments.length;iXs(n)||xX(n)?n:Date.parse(n);function IX(n,e){return e=e||EX,n==null||n===""?null:e(n)}function AX(n){return n==null||n===""?null:n+""}function mC(n){const e={},t=n.length;for(let i=0;i9999?"+"+lo(n,6):lo(n,4)}function MX(n){var e=n.getUTCHours(),t=n.getUTCMinutes(),i=n.getUTCSeconds(),s=n.getUTCMilliseconds();return isNaN(n)?"Invalid Date":NX(n.getUTCFullYear())+"-"+lo(n.getUTCMonth()+1,2)+"-"+lo(n.getUTCDate(),2)+(s?"T"+lo(e,2)+":"+lo(t,2)+":"+lo(i,2)+"."+lo(s,3)+"Z":i?"T"+lo(e,2)+":"+lo(t,2)+":"+lo(i,2)+"Z":t||e?"T"+lo(e,2)+":"+lo(t,2)+"Z":"")}function aW(n){var e=new RegExp('["'+n+` -\r]`),t=n.charCodeAt(0);function i(u,h){var f,g,p=s(u,function(_,v){if(f)return f(_,v-1);g=_,f=h?TX(_,h):rW(_)});return p.columns=g||[],p}function s(u,h){var f=[],g=u.length,p=0,_=0,v,b=g<=0,w=!1;u.charCodeAt(g-1)===jm&&--g,u.charCodeAt(g-1)===XD&&--g;function y(){if(b)return YD;if(w)return w=!1,o5;var L,x=p,D;if(u.charCodeAt(x)===ZD){for(;p++=g?b=!0:(D=u.charCodeAt(p++))===jm?w=!0:D===XD&&(w=!0,u.charCodeAt(p)===jm&&++p),u.slice(x+1,L-1).replace(/""/g,'"')}for(;p").concat(o.map(jv).join(""),"")}function Q3(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}var vZ=function(e,t){return function(i,s,o,r){return e.call(t,i,s,o,r)}},ek=function(e,t,i,s){var o=Object.keys(e),r=o.length,a=s!==void 0?vZ(t,s):t,l,c,d;for(i===void 0?(l=1,d=e[o[0]]):(l=0,d=i);l=55296&&s<=56319&&t=55296&&i<=56319&&t>e+1&&(s=n.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function J3(n){return Object.keys(n).reduce(function(e,t){var i=n[t],s=!!i.icon;return s?e[i.iconName]=i.icon:e[t]=i,e},{})}function gE(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.skipHooks,s=i===void 0?!1:i,o=J3(e);typeof Gr.hooks.addPack=="function"&&!s?Gr.hooks.addPack(n,J3(e)):Gr.styles[n]=Me(Me({},Gr.styles[n]||{}),o),n==="fas"&&gE("fa",e)}var tw,iw,nw,_g=Gr.styles,CZ=Gr.shims,SZ=(tw={},On(tw,Ni,Object.values(F_[Ni])),On(tw,en,Object.values(F_[en])),tw),NM=null,QB={},JB={},eW={},tW={},iW={},xZ=(iw={},On(iw,Ni,Object.keys(P_[Ni])),On(iw,en,Object.keys(P_[en])),iw);function LZ(n){return~oZ.indexOf(n)}function DZ(n,e){var t=e.split("-"),i=t[0],s=t.slice(1).join("-");return i===n&&s!==""&&!LZ(s)?s:null}var nW=function(){var e=function(o){return ek(_g,function(r,a,l){return r[l]=ek(a,o,{}),r},{})};QB=e(function(s,o,r){if(o[3]&&(s[o[3]]=r),o[2]){var a=o[2].filter(function(l){return typeof l=="number"});a.forEach(function(l){s[l.toString(16)]=r})}return s}),JB=e(function(s,o,r){if(s[r]=r,o[2]){var a=o[2].filter(function(l){return typeof l=="string"});a.forEach(function(l){s[l]=r})}return s}),iW=e(function(s,o,r){var a=o[2];return s[r]=r,a.forEach(function(l){s[l]=r}),s});var t="far"in _g||He.autoFetchSvg,i=ek(CZ,function(s,o){var r=o[0],a=o[1],l=o[2];return a==="far"&&!t&&(a="fas"),typeof r=="string"&&(s.names[r]={prefix:a,iconName:l}),typeof r=="number"&&(s.unicodes[r.toString(16)]={prefix:a,iconName:l}),s},{names:{},unicodes:{}});eW=i.names,tW=i.unicodes,NM=Nx(He.styleDefault,{family:He.familyDefault})};cZ(function(n){NM=Nx(n.styleDefault,{family:He.familyDefault})});nW();function MM(n,e){return(QB[n]||{})[e]}function kZ(n,e){return(JB[n]||{})[e]}function oh(n,e){return(iW[n]||{})[e]}function sW(n){return eW[n]||{prefix:null,iconName:null}}function EZ(n){var e=tW[n],t=MM("fas",n);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function kd(){return NM}var RM=function(){return{prefix:null,iconName:null,rest:[]}};function Nx(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.family,i=t===void 0?Ni:t,s=P_[i][n],o=O_[i][n]||O_[i][s],r=n in Gr.styles?n:null;return o||r||null}var e5=(nw={},On(nw,Ni,Object.keys(F_[Ni])),On(nw,en,Object.keys(F_[en])),nw);function Mx(n){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.skipLookups,s=i===void 0?!1:i,o=(e={},On(e,Ni,"".concat(He.cssPrefix,"-").concat(Ni)),On(e,en,"".concat(He.cssPrefix,"-").concat(en)),e),r=null,a=Ni;(n.includes(o[Ni])||n.some(function(c){return e5[Ni].includes(c)}))&&(a=Ni),(n.includes(o[en])||n.some(function(c){return e5[en].includes(c)}))&&(a=en);var l=n.reduce(function(c,d){var u=DZ(He.cssPrefix,d);if(_g[d]?(d=SZ[a].includes(d)?JY[a][d]:d,r=d,c.prefix=d):xZ[a].indexOf(d)>-1?(r=d,c.prefix=Nx(d,{family:a})):u?c.iconName=u:d!==He.replacementClass&&d!==o[Ni]&&d!==o[en]&&c.rest.push(d),!s&&c.prefix&&c.iconName){var h=r==="fa"?sW(c.iconName):{},f=oh(c.prefix,c.iconName);h.prefix&&(r=null),c.iconName=h.iconName||f||c.iconName,c.prefix=h.prefix||c.prefix,c.prefix==="far"&&!_g.far&&_g.fas&&!He.autoFetchSvg&&(c.prefix="fas")}return c},RM());return(n.includes("fa-brands")||n.includes("fab"))&&(l.prefix="fab"),(n.includes("fa-duotone")||n.includes("fad"))&&(l.prefix="fad"),!l.prefix&&a===en&&(_g.fass||He.autoFetchSvg)&&(l.prefix="fass",l.iconName=oh(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||r==="fa")&&(l.prefix=kd()||"fas"),l}var IZ=function(){function n(){HY(this,n),this.definitions={}}return zY(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o0&&d.forEach(function(u){typeof u=="string"&&(t[a][u]=c)}),t[a][l]=c}),t}}]),n}(),t5=[],bg={},qg={},AZ=Object.keys(qg);function TZ(n,e){var t=e.mixoutsTo;return t5=n,bg={},Object.keys(qg).forEach(function(i){AZ.indexOf(i)===-1&&delete qg[i]}),t5.forEach(function(i){var s=i.mixout?i.mixout():{};if(Object.keys(s).forEach(function(r){typeof s[r]=="function"&&(t[r]=s[r]),bC(s[r])==="object"&&Object.keys(s[r]).forEach(function(a){t[r]||(t[r]={}),t[r][a]=s[r][a]})}),i.hooks){var o=i.hooks();Object.keys(o).forEach(function(r){bg[r]||(bg[r]=[]),bg[r].push(o[r])})}i.provides&&i.provides(qg)}),t}function pE(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s1?e-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:{};return cc?(Uh("beforeI2svg",e),oc("pseudoElements2svg",e),oc("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;He.autoReplaceSvg===!1&&(He.autoReplaceSvg=!0),He.observeMutations=!0,bZ(function(){PZ({autoReplaceSvgRoot:t}),Uh("watch",e)})}},RZ={icon:function(e){if(e===null)return null;if(bC(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:oh(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],i=Nx(e[0]);return{prefix:i,iconName:oh(i,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(He.cssPrefix,"-"))>-1||e.match(eZ))){var s=Mx(e.split(" "),{skipLookups:!0});return{prefix:s.prefix||kd(),iconName:oh(s.prefix,s.iconName)||s.iconName}}if(typeof e=="string"){var o=kd();return{prefix:o,iconName:oh(o,e)||e}}}},qo={noAuto:NZ,config:He,dom:MZ,parse:RZ,library:oW,findIconDefinition:mE,toHtml:jv},PZ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot,i=t===void 0?Pi:t;(Object.keys(Gr.styles).length>0||He.autoFetchSvg)&&cc&&He.autoReplaceSvg&&qo.dom.i2svg({node:i})};function Rx(n,e){return Object.defineProperty(n,"abstract",{get:e}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map(function(i){return jv(i)})}}),Object.defineProperty(n,"node",{get:function(){if(cc){var i=Pi.createElement("div");return i.innerHTML=n.html,i.children}}}),n}function OZ(n){var e=n.children,t=n.main,i=n.mask,s=n.attributes,o=n.styles,r=n.transform;if(TM(r)&&t.found&&!i.found){var a=t.width,l=t.height,c={x:a/l/2,y:.5};s.style=Tx(Me(Me({},o),{},{"transform-origin":"".concat(c.x+r.x/16,"em ").concat(c.y+r.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function FZ(n){var e=n.prefix,t=n.iconName,i=n.children,s=n.attributes,o=n.symbol,r=o===!0?"".concat(e,"-").concat(He.cssPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Me(Me({},s),{},{id:r}),children:i}]}]}function PM(n){var e=n.icons,t=e.main,i=e.mask,s=n.prefix,o=n.iconName,r=n.transform,a=n.symbol,l=n.title,c=n.maskId,d=n.titleId,u=n.extra,h=n.watchable,f=h===void 0?!1:h,g=i.found?i:t,p=g.width,_=g.height,v=s==="fak",b=[He.replacementClass,o?"".concat(He.cssPrefix,"-").concat(o):""].filter(function(k){return u.classes.indexOf(k)===-1}).filter(function(k){return k!==""||!!k}).concat(u.classes).join(" "),w={children:[],attributes:Me(Me({},u.attributes),{},{"data-prefix":s,"data-icon":o,class:b,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(_)})},y=v&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/_*16*.0625,"em")}:{};f&&(w.attributes[$h]=""),l&&(w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(d||W_())},children:[l]}),delete w.attributes.title);var S=Me(Me({},w),{},{prefix:s,iconName:o,main:t,mask:i,maskId:c,transform:r,symbol:a,styles:Me(Me({},y),u.styles)}),L=i.found&&t.found?oc("generateAbstractMask",S)||{children:[],attributes:{}}:oc("generateAbstractIcon",S)||{children:[],attributes:{}},x=L.children,D=L.attributes;return S.children=x,S.attributes=D,a?FZ(S):OZ(S)}function i5(n){var e=n.content,t=n.width,i=n.height,s=n.transform,o=n.title,r=n.extra,a=n.watchable,l=a===void 0?!1:a,c=Me(Me(Me({},r.attributes),o?{title:o}:{}),{},{class:r.classes.join(" ")});l&&(c[$h]="");var d=Me({},r.styles);TM(s)&&(d.transform=gZ({transform:s,startCentered:!0,width:t,height:i}),d["-webkit-transform"]=d.transform);var u=Tx(d);u.length>0&&(c.style=u);var h=[];return h.push({tag:"span",attributes:c,children:[e]}),o&&h.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),h}function BZ(n){var e=n.content,t=n.title,i=n.extra,s=Me(Me(Me({},i.attributes),t?{title:t}:{}),{},{class:i.classes.join(" ")}),o=Tx(i.styles);o.length>0&&(s.style=o);var r=[];return r.push({tag:"span",attributes:s,children:[e]}),t&&r.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),r}var tk=Gr.styles;function _E(n){var e=n[0],t=n[1],i=n.slice(4),s=LM(i,1),o=s[0],r=null;return Array.isArray(o)?r={tag:"g",attributes:{class:"".concat(He.cssPrefix,"-").concat(sh.GROUP)},children:[{tag:"path",attributes:{class:"".concat(He.cssPrefix,"-").concat(sh.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(He.cssPrefix,"-").concat(sh.PRIMARY),fill:"currentColor",d:o[1]}}]}:r={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:t,icon:r}}var WZ={found:!1,width:512,height:512};function VZ(n,e){!jB&&!He.showMissingIcons&&n&&console.error('Icon with name "'.concat(n,'" and prefix "').concat(e,'" is missing.'))}function bE(n,e){var t=e;return e==="fa"&&He.styleDefault!==null&&(e=kd()),new Promise(function(i,s){if(oc("missingIconAbstract"),t==="fa"){var o=sW(n)||{};n=o.iconName||n,e=o.prefix||e}if(n&&e&&tk[e]&&tk[e][n]){var r=tk[e][n];return i(_E(r))}VZ(n,e),i(Me(Me({},WZ),{},{icon:He.showMissingIcons&&n?oc("missingIconAbstract")||{}:{}}))})}var n5=function(){},vE=He.measurePerformance&&Y1&&Y1.mark&&Y1.measure?Y1:{mark:n5,measure:n5},D0='FA "6.4.2"',HZ=function(e){return vE.mark("".concat(D0," ").concat(e," begins")),function(){return rW(e)}},rW=function(e){vE.mark("".concat(D0," ").concat(e," ends")),vE.measure("".concat(D0," ").concat(e),"".concat(D0," ").concat(e," begins"),"".concat(D0," ").concat(e," ends"))},OM={begin:HZ,end:rW},Ey=function(){};function s5(n){var e=n.getAttribute?n.getAttribute($h):null;return typeof e=="string"}function zZ(n){var e=n.getAttribute?n.getAttribute(kM):null,t=n.getAttribute?n.getAttribute(EM):null;return e&&t}function $Z(n){return n&&n.classList&&n.classList.contains&&n.classList.contains(He.replacementClass)}function UZ(){if(He.autoReplaceSvg===!0)return Iy.replace;var n=Iy[He.autoReplaceSvg];return n||Iy.replace}function jZ(n){return Pi.createElementNS("http://www.w3.org/2000/svg",n)}function qZ(n){return Pi.createElement(n)}function aW(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.ceFn,i=t===void 0?n.tag==="svg"?jZ:qZ:t;if(typeof n=="string")return Pi.createTextNode(n);var s=i(n.tag);Object.keys(n.attributes||[]).forEach(function(r){s.setAttribute(r,n.attributes[r])});var o=n.children||[];return o.forEach(function(r){s.appendChild(aW(r,{ceFn:i}))}),s}function GZ(n){var e=" ".concat(n.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var Iy={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(s){t.parentNode.insertBefore(aW(s),t)}),t.getAttribute($h)===null&&He.keepOriginalSource){var i=Pi.createComment(GZ(t));t.parentNode.replaceChild(i,t)}else t.remove()},nest:function(e){var t=e[0],i=e[1];if(~AM(t).indexOf(He.replacementClass))return Iy.replace(e);var s=new RegExp("".concat(He.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){var o=i[0].attributes.class.split(" ").reduce(function(a,l){return l===He.replacementClass||l.match(s)?a.toSvg.push(l):a.toNode.push(l),a},{toNode:[],toSvg:[]});i[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",o.toNode.join(" "))}var r=i.map(function(a){return jv(a)}).join(` +`);t.setAttribute($h,""),t.innerHTML=r}};function o5(n){n()}function lW(n,e){var t=typeof e=="function"?e:Ey;if(n.length===0)t();else{var i=o5;He.mutateApproach===XY&&(i=Dd.requestAnimationFrame||o5),i(function(){var s=UZ(),o=OM.begin("mutate");n.map(s),o(),t()})}}var FM=!1;function cW(){FM=!0}function wE(){FM=!1}var wC=null;function r5(n){if(Y3&&He.observeMutations){var e=n.treeCallback,t=e===void 0?Ey:e,i=n.nodeCallback,s=i===void 0?Ey:i,o=n.pseudoElementsCallback,r=o===void 0?Ey:o,a=n.observeMutationsRoot,l=a===void 0?Pi:a;wC=new Y3(function(c){if(!FM){var d=kd();xm(c).forEach(function(u){if(u.type==="childList"&&u.addedNodes.length>0&&!s5(u.addedNodes[0])&&(He.searchPseudoElements&&r(u.target),t(u.target)),u.type==="attributes"&&u.target.parentNode&&He.searchPseudoElements&&r(u.target.parentNode),u.type==="attributes"&&s5(u.target)&&~sZ.indexOf(u.attributeName))if(u.attributeName==="class"&&zZ(u.target)){var h=Mx(AM(u.target)),f=h.prefix,g=h.iconName;u.target.setAttribute(kM,f||d),g&&u.target.setAttribute(EM,g)}else $Z(u.target)&&s(u.target)})}}),cc&&wC.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function KZ(){wC&&wC.disconnect()}function YZ(n){var e=n.getAttribute("style"),t=[];return e&&(t=e.split(";").reduce(function(i,s){var o=s.split(":"),r=o[0],a=o.slice(1);return r&&a.length>0&&(i[r]=a.join(":").trim()),i},{})),t}function ZZ(n){var e=n.getAttribute("data-prefix"),t=n.getAttribute("data-icon"),i=n.innerText!==void 0?n.innerText.trim():"",s=Mx(AM(n));return s.prefix||(s.prefix=kd()),e&&t&&(s.prefix=e,s.iconName=t),s.iconName&&s.prefix||(s.prefix&&i.length>0&&(s.iconName=kZ(s.prefix,n.innerText)||MM(s.prefix,fE(n.innerText))),!s.iconName&&He.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(s.iconName=n.firstChild.data)),s}function XZ(n){var e=xm(n.attributes).reduce(function(s,o){return s.name!=="class"&&s.name!=="style"&&(s[o.name]=o.value),s},{}),t=n.getAttribute("title"),i=n.getAttribute("data-fa-title-id");return He.autoA11y&&(t?e["aria-labelledby"]="".concat(He.replacementClass,"-title-").concat(i||W_()):(e["aria-hidden"]="true",e.focusable="false")),e}function QZ(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Aa,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function a5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},t=ZZ(n),i=t.iconName,s=t.prefix,o=t.rest,r=XZ(n),a=pE("parseNodeAttributes",{},n),l=e.styleParser?YZ(n):[];return Me({iconName:i,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:s,transform:Aa,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:l,attributes:r}},a)}var JZ=Gr.styles;function dW(n){var e=He.autoReplaceSvg==="nest"?a5(n,{styleParser:!1}):a5(n);return~e.extra.classes.indexOf(qB)?oc("generateLayersText",n,e):oc("generateSvgReplacementMutation",n,e)}var Ed=new Set;IM.map(function(n){Ed.add("fa-".concat(n))});Object.keys(P_[Ni]).map(Ed.add.bind(Ed));Object.keys(P_[en]).map(Ed.add.bind(Ed));Ed=$v(Ed);function l5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!cc)return Promise.resolve();var t=Pi.documentElement.classList,i=function(u){return t.add("".concat(Z3,"-").concat(u))},s=function(u){return t.remove("".concat(Z3,"-").concat(u))},o=He.autoFetchSvg?Ed:IM.map(function(d){return"fa-".concat(d)}).concat(Object.keys(JZ));o.includes("fa")||o.push("fa");var r=[".".concat(qB,":not([").concat($h,"])")].concat(o.map(function(d){return".".concat(d,":not([").concat($h,"])")})).join(", ");if(r.length===0)return Promise.resolve();var a=[];try{a=xm(n.querySelectorAll(r))}catch{}if(a.length>0)i("pending"),s("complete");else return Promise.resolve();var l=OM.begin("onTree"),c=a.reduce(function(d,u){try{var h=dW(u);h&&d.push(h)}catch(f){jB||f.name==="MissingIcon"&&console.error(f)}return d},[]);return new Promise(function(d,u){Promise.all(c).then(function(h){lW(h,function(){i("active"),i("complete"),s("pending"),typeof e=="function"&&e(),l(),d()})}).catch(function(h){l(),u(h)})})}function eX(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;dW(n).then(function(t){t&&lW([t],e)})}function tX(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:mE(e||{}),s=t.mask;return s&&(s=(s||{}).icon?s:mE(s||{})),n(i,Me(Me({},t),{},{mask:s}))}}var iX=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.transform,s=i===void 0?Aa:i,o=t.symbol,r=o===void 0?!1:o,a=t.mask,l=a===void 0?null:a,c=t.maskId,d=c===void 0?null:c,u=t.title,h=u===void 0?null:u,f=t.titleId,g=f===void 0?null:f,p=t.classes,_=p===void 0?[]:p,v=t.attributes,b=v===void 0?{}:v,w=t.styles,y=w===void 0?{}:w;if(e){var S=e.prefix,L=e.iconName,x=e.icon;return Rx(Me({type:"icon"},e),function(){return Uh("beforeDOMElementCreation",{iconDefinition:e,params:t}),He.autoA11y&&(h?b["aria-labelledby"]="".concat(He.replacementClass,"-title-").concat(g||W_()):(b["aria-hidden"]="true",b.focusable="false")),PM({icons:{main:_E(x),mask:l?_E(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:S,iconName:L,transform:Me(Me({},Aa),s),symbol:r,title:h,maskId:d,titleId:g,extra:{attributes:b,styles:y,classes:_}})})}},nX={mixout:function(){return{icon:tX(iX)}},hooks:function(){return{mutationObserverCallbacks:function(t){return t.treeCallback=l5,t.nodeCallback=eX,t}}},provides:function(e){e.i2svg=function(t){var i=t.node,s=i===void 0?Pi:i,o=t.callback,r=o===void 0?function(){}:o;return l5(s,r)},e.generateSvgReplacementMutation=function(t,i){var s=i.iconName,o=i.title,r=i.titleId,a=i.prefix,l=i.transform,c=i.symbol,d=i.mask,u=i.maskId,h=i.extra;return new Promise(function(f,g){Promise.all([bE(s,a),d.iconName?bE(d.iconName,d.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(p){var _=LM(p,2),v=_[0],b=_[1];f([t,PM({icons:{main:v,mask:b},prefix:a,iconName:s,transform:l,symbol:c,maskId:u,title:o,titleId:r,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.transform,a=t.styles,l=Tx(a);l.length>0&&(s.style=l);var c;return TM(r)&&(c=oc("generateAbstractTransformGrouping",{main:o,transform:r,containerWidth:o.width,iconWidth:o.width})),i.push(c||o.icon),{children:i,attributes:s}}}},sX={mixout:function(){return{layer:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.classes,o=s===void 0?[]:s;return Rx({type:"layer"},function(){Uh("beforeDOMElementCreation",{assembler:t,params:i});var r=[];return t(function(a){Array.isArray(a)?a.map(function(l){r=r.concat(l.abstract)}):r=r.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(He.cssPrefix,"-layers")].concat($v(o)).join(" ")},children:r}]})}}}},oX={mixout:function(){return{counter:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.title,o=s===void 0?null:s,r=i.classes,a=r===void 0?[]:r,l=i.attributes,c=l===void 0?{}:l,d=i.styles,u=d===void 0?{}:d;return Rx({type:"counter",content:t},function(){return Uh("beforeDOMElementCreation",{content:t,params:i}),BZ({content:t.toString(),title:o,extra:{attributes:c,styles:u,classes:["".concat(He.cssPrefix,"-layers-counter")].concat($v(a))}})})}}}},rX={mixout:function(){return{text:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.transform,o=s===void 0?Aa:s,r=i.title,a=r===void 0?null:r,l=i.classes,c=l===void 0?[]:l,d=i.attributes,u=d===void 0?{}:d,h=i.styles,f=h===void 0?{}:h;return Rx({type:"text",content:t},function(){return Uh("beforeDOMElementCreation",{content:t,params:i}),i5({content:t,transform:Me(Me({},Aa),o),title:a,extra:{attributes:u,styles:f,classes:["".concat(He.cssPrefix,"-layers-text")].concat($v(c))}})})}}},provides:function(e){e.generateLayersText=function(t,i){var s=i.title,o=i.transform,r=i.extra,a=null,l=null;if(zB){var c=parseInt(getComputedStyle(t).fontSize,10),d=t.getBoundingClientRect();a=d.width/c,l=d.height/c}return He.autoA11y&&!s&&(r.attributes["aria-hidden"]="true"),Promise.resolve([t,i5({content:t.innerHTML,width:a,height:l,transform:o,title:s,extra:r,watchable:!0})])}}},aX=new RegExp('"',"ug"),c5=[1105920,1112319];function lX(n){var e=n.replace(aX,""),t=yZ(e,0),i=t>=c5[0]&&t<=c5[1],s=e.length===2?e[0]===e[1]:!1;return{value:fE(s?e[0]:e),isSecondary:i||s}}function d5(n,e){var t="".concat(ZY).concat(e.replace(":","-"));return new Promise(function(i,s){if(n.getAttribute(t)!==null)return i();var o=xm(n.children),r=o.filter(function(x){return x.getAttribute(hE)===e})[0],a=Dd.getComputedStyle(n,e),l=a.getPropertyValue("font-family").match(tZ),c=a.getPropertyValue("font-weight"),d=a.getPropertyValue("content");if(r&&!l)return n.removeChild(r),i();if(l&&d!=="none"&&d!==""){var u=a.getPropertyValue("content"),h=~["Sharp"].indexOf(l[2])?en:Ni,f=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(l[2])?O_[h][l[2].toLowerCase()]:iZ[h][c],g=lX(u),p=g.value,_=g.isSecondary,v=l[0].startsWith("FontAwesome"),b=MM(f,p),w=b;if(v){var y=EZ(p);y.iconName&&y.prefix&&(b=y.iconName,f=y.prefix)}if(b&&!_&&(!r||r.getAttribute(kM)!==f||r.getAttribute(EM)!==w)){n.setAttribute(t,w),r&&n.removeChild(r);var S=QZ(),L=S.extra;L.attributes[hE]=e,bE(b,f).then(function(x){var D=PM(Me(Me({},S),{},{icons:{main:x,mask:RM()},prefix:f,iconName:w,extra:L,watchable:!0})),k=Pi.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?n.insertBefore(k,n.firstChild):n.appendChild(k),k.outerHTML=D.map(function(P){return jv(P)}).join(` +`),n.removeAttribute(t),i()}).catch(s)}else i()}else i()})}function cX(n){return Promise.all([d5(n,"::before"),d5(n,"::after")])}function dX(n){return n.parentNode!==document.head&&!~QY.indexOf(n.tagName.toUpperCase())&&!n.getAttribute(hE)&&(!n.parentNode||n.parentNode.tagName!=="svg")}function u5(n){if(cc)return new Promise(function(e,t){var i=xm(n.querySelectorAll("*")).filter(dX).map(cX),s=OM.begin("searchPseudoElements");cW(),Promise.all(i).then(function(){s(),wE(),e()}).catch(function(){s(),wE(),t()})})}var uX={hooks:function(){return{mutationObserverCallbacks:function(t){return t.pseudoElementsCallback=u5,t}}},provides:function(e){e.pseudoElements2svg=function(t){var i=t.node,s=i===void 0?Pi:i;He.searchPseudoElements&&u5(s)}}},h5=!1,hX={mixout:function(){return{dom:{unwatch:function(){cW(),h5=!0}}}},hooks:function(){return{bootstrap:function(){r5(pE("mutationObserverCallbacks",{}))},noAuto:function(){KZ()},watch:function(t){var i=t.observeMutationsRoot;h5?wE():r5(pE("mutationObserverCallbacks",{observeMutationsRoot:i}))}}}},f5=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(i,s){var o=s.toLowerCase().split("-"),r=o[0],a=o.slice(1).join("-");if(r&&a==="h")return i.flipX=!0,i;if(r&&a==="v")return i.flipY=!0,i;if(a=parseFloat(a),isNaN(a))return i;switch(r){case"grow":i.size=i.size+a;break;case"shrink":i.size=i.size-a;break;case"left":i.x=i.x-a;break;case"right":i.x=i.x+a;break;case"up":i.y=i.y-a;break;case"down":i.y=i.y+a;break;case"rotate":i.rotate=i.rotate+a;break}return i},t)},fX={mixout:function(){return{parse:{transform:function(t){return f5(t)}}}},hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-transform");return s&&(t.transform=f5(s)),t}}},provides:function(e){e.generateAbstractTransformGrouping=function(t){var i=t.main,s=t.transform,o=t.containerWidth,r=t.iconWidth,a={transform:"translate(".concat(o/2," 256)")},l="translate(".concat(s.x*32,", ").concat(s.y*32,") "),c="scale(".concat(s.size/16*(s.flipX?-1:1),", ").concat(s.size/16*(s.flipY?-1:1),") "),d="rotate(".concat(s.rotate," 0 0)"),u={transform:"".concat(l," ").concat(c," ").concat(d)},h={transform:"translate(".concat(r/2*-1," -256)")},f={outer:a,inner:u,path:h};return{tag:"g",attributes:Me({},f.outer),children:[{tag:"g",attributes:Me({},f.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:Me(Me({},i.icon.attributes),f.path)}]}]}}}},ik={x:0,y:0,width:"100%",height:"100%"};function g5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function gX(n){return n.tag==="g"?n.children:[n]}var pX={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-mask"),o=s?Mx(s.split(" ").map(function(r){return r.trim()})):RM();return o.prefix||(o.prefix=kd()),t.mask=o,t.maskId=i.getAttribute("data-fa-mask-id"),t}}},provides:function(e){e.generateAbstractMask=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.mask,a=t.maskId,l=t.transform,c=o.width,d=o.icon,u=r.width,h=r.icon,f=fZ({transform:l,containerWidth:u,iconWidth:c}),g={tag:"rect",attributes:Me(Me({},ik),{},{fill:"white"})},p=d.children?{children:d.children.map(g5)}:{},_={tag:"g",attributes:Me({},f.inner),children:[g5(Me({tag:d.tag,attributes:Me(Me({},d.attributes),f.path)},p))]},v={tag:"g",attributes:Me({},f.outer),children:[_]},b="mask-".concat(a||W_()),w="clip-".concat(a||W_()),y={tag:"mask",attributes:Me(Me({},ik),{},{id:b,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,v]},S={tag:"defs",children:[{tag:"clipPath",attributes:{id:w},children:gX(h)},y]};return i.push(S,{tag:"rect",attributes:Me({fill:"currentColor","clip-path":"url(#".concat(w,")"),mask:"url(#".concat(b,")")},ik)}),{children:i,attributes:s}}}},mX={provides:function(e){var t=!1;Dd.matchMedia&&(t=Dd.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var i=[],s={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};i.push({tag:"path",attributes:Me(Me({},s),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var r=Me(Me({},o),{},{attributeName:"opacity"}),a={tag:"circle",attributes:Me(Me({},s),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||a.children.push({tag:"animate",attributes:Me(Me({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;1;1;0;1;"})}),i.push(a),i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;0;0;0;1;"})}]}),t||i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Me(Me({},r),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:i}}}},_X={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-symbol"),o=s===null?!1:s===""?!0:s;return t.symbol=o,t}}}},bX=[mZ,nX,sX,oX,rX,uX,hX,fX,pX,mX,_X];TZ(bX,{mixoutsTo:qo});qo.noAuto;qo.config;qo.library;qo.dom;qo.parse;qo.findIconDefinition;qo.toHtml;var p5=qo.icon;qo.layer;qo.text;qo.counter;var vX={prefix:"fas",iconName:"table-columns",icon:[512,512,["columns"],"f0db","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 64V416H224V160H64zm384 0H288V416H448V160z"]},wX=vX,yX={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},CX=yX;function eu(n,e,t){return n.fields=e||[],n.fname=t,n}function SX(n){return n==null?null:n.fname}function uW(n){return n==null?null:n.fields}function xX(n){return n.length===1?LX(n[0]):DX(n)}const LX=n=>function(e){return e[n]},DX=n=>{const e=n.length;return function(t){for(let i=0;ir?c():r=a+1:l==="["?(a>r&&c(),s=r=a+1):l==="]"&&(s||qi("Access path missing open bracket: "+n),s>0&&c(),s=0,r=a+1)}return s&&qi("Access path missing closing bracket: "+n),i&&qi("Access path missing closing quote: "+n),a>r&&(a++,c()),e}function Px(n,e,t){const i=kX(n);return n=i.length===1?i[0]:n,eu((t&&t.get||xX)(i),[n],e||n)}Px("id");const Ox=eu(n=>n,[],"identity");eu(()=>0,[],"zero");eu(()=>1,[],"one");eu(()=>!0,[],"true");eu(()=>!1,[],"false");var Zs=Array.isArray;function xo(n){return n===Object(n)}function Xr(n){return n[n.length-1]}function V_(n){return n==null||n===""?null:+n}const hW=n=>e=>n*Math.exp(e),fW=n=>e=>Math.log(n*e),EX=n=>e=>Math.sign(e)*Math.log1p(Math.abs(e/n)),IX=n=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*n,yC=n=>e=>e<0?-Math.pow(-e,n):Math.pow(e,n);function BM(n,e,t,i){const s=t(n[0]),o=t(Xr(n)),r=(o-s)*e;return[i(s-r),i(o-r)]}function AX(n,e){return BM(n,e,V_,Ox)}function TX(n,e){var t=Math.sign(n[0]);return BM(n,e,fW(t),hW(t))}function NX(n,e,t){return BM(n,e,yC(t),yC(1/t))}function Fx(n,e,t,i,s){const o=i(n[0]),r=i(Xr(n)),a=e!=null?i(e):(o+r)/2;return[s(a+(o-a)*t),s(a+(r-a)*t)]}function gW(n,e,t){return Fx(n,e,t,V_,Ox)}function pW(n,e,t){const i=Math.sign(n[0]);return Fx(n,e,t,fW(i),hW(i))}function yE(n,e,t,i){return Fx(n,e,t,yC(i),yC(1/i))}function MX(n,e,t,i){return Fx(n,e,t,EX(i),IX(i))}function CE(n){return n!=null?Zs(n)?n:[n]:[]}function RX(n,e,t){let i=n[0],s=n[1],o;return s=t-e?[e,t]:[i=Math.min(Math.max(i,e),t-o),i+o]}function yo(n){return typeof n=="function"}const PX="descending";function mW(n,e,t){t=t||{},e=CE(e)||[];const i=[],s=[],o={},r=t.comparator||OX;return CE(n).forEach((a,l)=>{a!=null&&(i.push(e[l]===PX?-1:1),s.push(a=yo(a)?a:Px(a,null,t)),(uW(a)||[]).forEach(c=>o[c]=1))}),s.length===0?null:eu(r(s,i),Object.keys(o))}const _W=(n,e)=>(ne||e==null)&&n!=null?1:(e=e instanceof Date?+e:e,(n=n instanceof Date?+n:n)!==n&&e===e?-1:e!==e&&n===n?1:0),OX=(n,e)=>n.length===1?FX(n[0],e[0]):BX(n,e,n.length),FX=(n,e)=>function(t,i){return _W(n(t),n(i))*e},BX=(n,e,t)=>(e.push(0),function(i,s){let o,r=0,a=-1;for(;r===0&&++an}function WM(n){for(let e,t,i=1,s=arguments.length;iXs(n)||HX(n)?n:Date.parse(n);function qX(n,e){return e=e||jX,n==null||n===""?null:e(n)}function GX(n){return n==null||n===""?null:n+""}function SC(n){const e={},t=n.length;for(let i=0;i9999?"+"+lo(n,6):lo(n,4)}function ZX(n){var e=n.getUTCHours(),t=n.getUTCMinutes(),i=n.getUTCSeconds(),s=n.getUTCMilliseconds();return isNaN(n)?"Invalid Date":YX(n.getUTCFullYear())+"-"+lo(n.getUTCMonth()+1,2)+"-"+lo(n.getUTCDate(),2)+(s?"T"+lo(e,2)+":"+lo(t,2)+":"+lo(i,2)+"."+lo(s,3)+"Z":i?"T"+lo(e,2)+":"+lo(t,2)+":"+lo(i,2)+"Z":t||e?"T"+lo(e,2)+":"+lo(t,2)+"Z":"")}function wW(n){var e=new RegExp('["'+n+` +\r]`),t=n.charCodeAt(0);function i(u,h){var f,g,p=s(u,function(_,v){if(f)return f(_,v-1);g=_,f=h?KX(_,h):vW(_)});return p.columns=g||[],p}function s(u,h){var f=[],g=u.length,p=0,_=0,v,b=g<=0,w=!1;u.charCodeAt(g-1)===Gm&&--g,u.charCodeAt(g-1)===ok&&--g;function y(){if(b)return nk;if(w)return w=!1,m5;var L,x=p,D;if(u.charCodeAt(x)===sk){for(;p++=g?b=!0:(D=u.charCodeAt(p++))===Gm?w=!0:D===ok&&(w=!0,u.charCodeAt(p)===Gm&&++p),u.slice(x+1,L-1).replace(/""/g,'"')}for(;p1)i=$X(n,e,t);else for(s=0,i=new Array(o=n.arcs.length);se?1:n>=e?0:NaN}function UX(n,e){return n==null||e==null?NaN:en?1:e>=n?0:NaN}function Nx(n){let e,t,i;n.length!==2?(e=e_,t=(a,l)=>e_(n(a),l),i=(a,l)=>n(a)-l):(e=n===e_||n===UX?n:jX,t=n,i=n);function s(a,l,c=0,d=a.length){if(c>>1;t(a[u],l)<0?c=u+1:d=u}while(c>>1;t(a[u],l)<=0?c=u+1:d=u}while(cc&&i(a[u-1],l)>-i(a[u],l)?u-1:u}return{left:s,center:r,right:o}}function jX(){return 0}function cW(n){return n===null?NaN:+n}const dW=Nx(e_),Dd=dW.right;dW.left;Nx(cW).center;function qX(n,e){let t,i;if(e===void 0)for(const s of n)s!=null&&(t===void 0?s>=s&&(t=i=s):(t>s&&(t=s),i=o&&(t=i=o):(t>o&&(t=o),i=i.length)return t(o);const a=new kd,l=i[r++];let c=-1;for(const d of o){const u=l(d,++c,o),h=a.get(u);h?h.push(d):a.set(u,[d])}for(const[d,u]of a)a.set(d,s(u,r));return e(a)}(n,0)}var bE=Math.sqrt(50),vE=Math.sqrt(10),wE=Math.sqrt(2);function _C(n,e,t){var i,s=-1,o,r,a;if(e=+e,n=+n,t=+t,n===e&&t>0)return[n];if((i=e0){let l=Math.round(n/a),c=Math.round(e/a);for(l*ae&&--c,r=new Array(o=c-l+1);++se&&--c,r=new Array(o=c-l+1);++s=0?(o>=bE?10:o>=vE?5:o>=wE?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=bE?10:o>=vE?5:o>=wE?2:1)}function Uh(n,e,t){var i=Math.abs(e-n)/Math.max(0,t),s=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/s;return o>=bE?s*=10:o>=vE?s*=5:o>=wE&&(s*=2),e=1)return+t(n[i-1],i-1,n);var i,s=(i-1)*e,o=Math.floor(s),r=+t(n[o],o,n),a=+t(n[o+1],o+1,n);return r+(a-r)*(s-o)}}function V_(n,e,t){n=+n,e=+e,t=(s=arguments.length)<2?(e=n,n=0,1):s<3?1:+t;for(var i=-1,s=Math.max(0,Math.ceil((e-n)/t))|0,o=new Array(s);++i=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function bC(n,e){if((t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var t,i=n.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+n.slice(t+1)]}function Rp(n){return n=bC(Math.abs(n)),n?n[1]:NaN}function QX(n,e){return function(t,i){for(var s=t.length,o=[],r=0,a=n[0],l=0;s>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(s-=a,s+a)),!((l+=a+1)>i));)a=n[r=(r+1)%n.length];return o.reverse().join(e)}}function JX(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var eQ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ed(n){if(!(e=eQ.exec(n)))throw new Error("invalid format: "+n);var e;return new AM({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ed.prototype=AM.prototype;function AM(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}AM.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function tQ(n){e:for(var e=n.length,t=1,i=-1,s;t0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(s+1):n}var gW;function iQ(n,e){var t=bC(n,e);if(!t)return n+"";var i=t[0],s=t[1],o=s-(gW=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,r=i.length;return o===r?i:o>r?i+new Array(o-r+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+bC(n,Math.max(0,e+o-1))[0]}function c5(n,e){var t=bC(n,e);if(!t)return n+"";var i=t[0],s=t[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const d5={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:XX,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>c5(n*100,e),r:c5,s:iQ,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function u5(n){return n}var h5=Array.prototype.map,f5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nQ(n){var e=n.grouping===void 0||n.thousands===void 0?u5:QX(h5.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",s=n.decimal===void 0?".":n.decimal+"",o=n.numerals===void 0?u5:JX(h5.call(n.numerals,String)),r=n.percent===void 0?"%":n.percent+"",a=n.minus===void 0?"−":n.minus+"",l=n.nan===void 0?"NaN":n.nan+"";function c(u){u=Ed(u);var h=u.fill,f=u.align,g=u.sign,p=u.symbol,_=u.zero,v=u.width,b=u.comma,w=u.precision,y=u.trim,S=u.type;S==="n"?(b=!0,S="g"):d5[S]||(w===void 0&&(w=12),y=!0,S="g"),(_||h==="0"&&f==="=")&&(_=!0,h="0",f="=");var L=p==="$"?t:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",x=p==="$"?i:/[%p]/.test(S)?r:"",D=d5[S],k=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function O(R){var P=L,M=x,$,Y,ne;if(S==="c")M=D(R)+M,R="";else{R=+R;var ce=R<0||1/R<0;if(R=isNaN(R)?l:D(Math.abs(R),w),y&&(R=tQ(R)),ce&&+R==0&&g!=="+"&&(ce=!1),P=(ce?g==="("?g:a:g==="-"||g==="("?"":g)+P,M=(S==="s"?f5[8+gW/3]:"")+M+(ce&&g==="("?")":""),k){for($=-1,Y=R.length;++$ne||ne>57){M=(ne===46?s+R.slice($+1):R.slice($))+M,R=R.slice(0,$);break}}}b&&!_&&(R=e(R,1/0));var ge=P.length+R.length+M.length,se=ge>1)+P+R+M+se.slice(ge);break;default:R=se+P+R+M;break}return o(R)}return O.toString=function(){return u+""},O}function d(u,h){var f=c((u=Ed(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(Rp(h)/3)))*3,p=Math.pow(10,-g),_=f5[8+g/3];return function(v){return f(p*v)+_}}return{format:c,formatPrefix:d}}var Q1,cs,TM;sQ({thousands:",",grouping:[3],currency:["$",""]});function sQ(n){return Q1=nQ(n),cs=Q1.format,TM=Q1.formatPrefix,Q1}function pW(n){return Math.max(0,-Rp(Math.abs(n)))}function mW(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rp(e)/3)))*3-Rp(Math.abs(n)))}function _W(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,Rp(e)-Rp(n))+1}var QD=new Date,JD=new Date;function Xn(n,e,t,i){function s(o){return n(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=function(o){return n(o=new Date(+o)),o},s.ceil=function(o){return n(o=new Date(o-1)),e(o,1),n(o),o},s.round=function(o){var r=s(o),a=s.ceil(o);return o-r0))return l;do l.push(c=new Date(+o)),e(o,a),n(o);while(c=r)for(;n(r),!o(r);)r.setTime(r-1)},function(r,a){if(r>=r)if(a<0)for(;++a<=0;)for(;e(r,-1),!o(r););else for(;--a>=0;)for(;e(r,1),!o(r););})},t&&(s.count=function(o,r){return QD.setTime(+o),JD.setTime(+r),n(QD),n(JD),Math.floor(t(QD,JD))},s.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(i?function(r){return i(r)%o===0}:function(r){return s.count(0,r)%o===0}):s}),s}var vC=Xn(function(){},function(n,e){n.setTime(+n+e)},function(n,e){return e-n});vC.every=function(n){return n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?Xn(function(e){e.setTime(Math.floor(e/n)*n)},function(e,t){e.setTime(+e+t*n)},function(e,t){return(t-e)/n}):vC};const NM=vC;vC.range;const Fl=1e3,nr=Fl*60,Bl=nr*60,jh=Bl*24,MM=jh*7,g5=jh*30,ek=jh*365;var bW=Xn(function(n){n.setTime(n-n.getMilliseconds())},function(n,e){n.setTime(+n+e*Fl)},function(n,e){return(e-n)/Fl},function(n){return n.getUTCSeconds()});const Uc=bW;bW.range;var vW=Xn(function(n){n.setTime(n-n.getMilliseconds()-n.getSeconds()*Fl)},function(n,e){n.setTime(+n+e*nr)},function(n,e){return(e-n)/nr},function(n){return n.getMinutes()});const RM=vW;vW.range;var wW=Xn(function(n){n.setTime(n-n.getMilliseconds()-n.getSeconds()*Fl-n.getMinutes()*nr)},function(n,e){n.setTime(+n+e*Bl)},function(n,e){return(e-n)/Bl},function(n){return n.getHours()});const PM=wW;wW.range;var yW=Xn(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*nr)/jh,n=>n.getDate()-1);const wh=yW;yW.range;function mf(n){return Xn(function(e){e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*nr)/MM})}var Vv=mf(0),wC=mf(1),oQ=mf(2),rQ=mf(3),Pp=mf(4),aQ=mf(5),lQ=mf(6);Vv.range;wC.range;oQ.range;rQ.range;Pp.range;aQ.range;lQ.range;var H_=Xn(function(n){n.setDate(1),n.setHours(0,0,0,0)},function(n,e){n.setMonth(n.getMonth()+e)},function(n,e){return e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12},function(n){return n.getMonth()});H_.range;var OM=Xn(function(n){n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e)},function(n,e){return e.getFullYear()-n.getFullYear()},function(n){return n.getFullYear()});OM.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:Xn(function(e){e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t*n)})};const Id=OM;OM.range;var CW=Xn(function(n){n.setUTCSeconds(0,0)},function(n,e){n.setTime(+n+e*nr)},function(n,e){return(e-n)/nr},function(n){return n.getUTCMinutes()});const FM=CW;CW.range;var SW=Xn(function(n){n.setUTCMinutes(0,0,0)},function(n,e){n.setTime(+n+e*Bl)},function(n,e){return(e-n)/Bl},function(n){return n.getUTCHours()});const BM=SW;SW.range;var xW=Xn(function(n){n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCDate(n.getUTCDate()+e)},function(n,e){return(e-n)/jh},function(n){return n.getUTCDate()-1});const yh=xW;xW.range;function _f(n){return Xn(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/MM})}var Hv=_f(0),yC=_f(1),cQ=_f(2),dQ=_f(3),Op=_f(4),uQ=_f(5),hQ=_f(6);Hv.range;yC.range;cQ.range;dQ.range;Op.range;uQ.range;hQ.range;var z_=Xn(function(n){n.setUTCDate(1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCMonth(n.getUTCMonth()+e)},function(n,e){return e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12},function(n){return n.getUTCMonth()});z_.range;var WM=Xn(function(n){n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e)},function(n,e){return e.getUTCFullYear()-n.getUTCFullYear()},function(n){return n.getUTCFullYear()});WM.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:Xn(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t*n)})};const Ad=WM;WM.range;function LW(n,e,t,i,s,o){const r=[[Uc,1,Fl],[Uc,5,5*Fl],[Uc,15,15*Fl],[Uc,30,30*Fl],[o,1,nr],[o,5,5*nr],[o,15,15*nr],[o,30,30*nr],[s,1,Bl],[s,3,3*Bl],[s,6,6*Bl],[s,12,12*Bl],[i,1,jh],[i,2,2*jh],[t,1,MM],[e,1,g5],[e,3,3*g5],[n,1,ek]];function a(c,d,u){const h=d_).right(r,h);if(f===r.length)return n.every(Uh(c/ek,d/ek,u));if(f===0)return NM.every(Math.max(Uh(c,d,u),1));const[g,p]=r[h/r[f-1][2](n[e]=1+t,n),{});const bQ={[$_]:Id,[U_]:H_.every(3),[j_]:H_,[q_]:Vv,[G_]:wh,[Rx]:wh,[VM]:wh,[K_]:PM,[Y_]:RM,[Z_]:Uc,[Px]:NM},vQ={[$_]:Ad,[U_]:z_.every(3),[j_]:z_,[q_]:Hv,[G_]:yh,[Rx]:yh,[VM]:yh,[K_]:BM,[Y_]:FM,[Z_]:Uc,[Px]:NM};function wQ(n){return bQ[n]}function yQ(n){return vQ[n]}function tk(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function ik(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function qm(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function DW(n){var e=n.dateTime,t=n.date,i=n.time,s=n.periods,o=n.days,r=n.shortDays,a=n.months,l=n.shortMonths,c=Gm(s),d=Km(s),u=Gm(o),h=Km(o),f=Gm(r),g=Km(r),p=Gm(a),_=Km(a),v=Gm(l),b=Km(l),w={a:ce,A:ge,b:se,B:Se,c:null,d:w5,e:w5,f:UQ,g:eJ,G:iJ,H:HQ,I:zQ,j:$Q,L:kW,m:jQ,M:qQ,p:Ie,q:pe,Q:S5,s:x5,S:GQ,u:KQ,U:YQ,V:ZQ,w:XQ,W:QQ,x:null,X:null,y:JQ,Y:tJ,Z:nJ,"%":C5},y={a:ee,A:Gt,b:xt,B:It,c:null,d:y5,e:y5,f:aJ,g:_J,G:vJ,H:sJ,I:oJ,j:rJ,L:IW,m:lJ,M:cJ,p:je,q:ei,Q:S5,s:x5,S:dJ,u:uJ,U:hJ,V:fJ,w:gJ,W:pJ,x:null,X:null,y:mJ,Y:bJ,Z:wJ,"%":C5},S={a:O,A:R,b:P,B:M,c:$,d:b5,e:b5,f:FQ,g:_5,G:m5,H:v5,I:v5,j:MQ,L:OQ,m:NQ,M:RQ,p:k,q:TQ,Q:WQ,s:VQ,S:PQ,u:DQ,U:kQ,V:EQ,w:LQ,W:IQ,x:Y,X:ne,y:_5,Y:m5,Z:AQ,"%":BQ};w.x=L(t,w),w.X=L(i,w),w.c=L(e,w),y.x=L(t,y),y.X=L(i,y),y.c=L(e,y);function L(De,Be){return function(he){var ue=[],xi=-1,Lt=0,Et=De.length,pi,Zo,_u;for(he instanceof Date||(he=new Date(+he));++xi53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Lt=ik(qm(ue.y,0,1)),Et=Lt.getUTCDay(),Lt=Et>4||Et===0?yC.ceil(Lt):yC(Lt),Lt=yh.offset(Lt,(ue.V-1)*7),ue.y=Lt.getUTCFullYear(),ue.m=Lt.getUTCMonth(),ue.d=Lt.getUTCDate()+(ue.w+6)%7):(Lt=tk(qm(ue.y,0,1)),Et=Lt.getDay(),Lt=Et>4||Et===0?wC.ceil(Lt):wC(Lt),Lt=wh.offset(Lt,(ue.V-1)*7),ue.y=Lt.getFullYear(),ue.m=Lt.getMonth(),ue.d=Lt.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),Et="Z"in ue?ik(qm(ue.y,0,1)).getUTCDay():tk(qm(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(Et+5)%7:ue.w+ue.U*7-(Et+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,ik(ue)):tk(ue)}}function D(De,Be,he,ue){for(var xi=0,Lt=Be.length,Et=he.length,pi,Zo;xi=Et)return-1;if(pi=Be.charCodeAt(xi++),pi===37){if(pi=Be.charAt(xi++),Zo=S[pi in p5?Be.charAt(xi++):pi],!Zo||(ue=Zo(De,he,ue))<0)return-1}else if(pi!=he.charCodeAt(ue++))return-1}return ue}function k(De,Be,he){var ue=c.exec(Be.slice(he));return ue?(De.p=d.get(ue[0].toLowerCase()),he+ue[0].length):-1}function O(De,Be,he){var ue=f.exec(Be.slice(he));return ue?(De.w=g.get(ue[0].toLowerCase()),he+ue[0].length):-1}function R(De,Be,he){var ue=u.exec(Be.slice(he));return ue?(De.w=h.get(ue[0].toLowerCase()),he+ue[0].length):-1}function P(De,Be,he){var ue=v.exec(Be.slice(he));return ue?(De.m=b.get(ue[0].toLowerCase()),he+ue[0].length):-1}function M(De,Be,he){var ue=p.exec(Be.slice(he));return ue?(De.m=_.get(ue[0].toLowerCase()),he+ue[0].length):-1}function $(De,Be,he){return D(De,e,Be,he)}function Y(De,Be,he){return D(De,t,Be,he)}function ne(De,Be,he){return D(De,i,Be,he)}function ce(De){return r[De.getDay()]}function ge(De){return o[De.getDay()]}function se(De){return l[De.getMonth()]}function Se(De){return a[De.getMonth()]}function Ie(De){return s[+(De.getHours()>=12)]}function pe(De){return 1+~~(De.getMonth()/3)}function ee(De){return r[De.getUTCDay()]}function Gt(De){return o[De.getUTCDay()]}function xt(De){return l[De.getUTCMonth()]}function It(De){return a[De.getUTCMonth()]}function je(De){return s[+(De.getUTCHours()>=12)]}function ei(De){return 1+~~(De.getUTCMonth()/3)}return{format:function(De){var Be=L(De+="",w);return Be.toString=function(){return De},Be},parse:function(De){var Be=x(De+="",!1);return Be.toString=function(){return De},Be},utcFormat:function(De){var Be=L(De+="",y);return Be.toString=function(){return De},Be},utcParse:function(De){var Be=x(De+="",!0);return Be.toString=function(){return De},Be}}}var p5={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,CQ=/^%/,SQ=/[\\^$*+?|[\]().{}]/g;function jt(n,e,t){var i=n<0?"-":"",s=(i?-n:n)+"",o=s.length;return i+(o[e.toLowerCase(),t]))}function LQ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.w=+i[0],t+i[0].length):-1}function DQ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.u=+i[0],t+i[0].length):-1}function kQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.U=+i[0],t+i[0].length):-1}function EQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.V=+i[0],t+i[0].length):-1}function IQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.W=+i[0],t+i[0].length):-1}function m5(n,e,t){var i=Qn.exec(e.slice(t,t+4));return i?(n.y=+i[0],t+i[0].length):-1}function _5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function AQ(n,e,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function TQ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.q=i[0]*3-3,t+i[0].length):-1}function NQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.m=i[0]-1,t+i[0].length):-1}function b5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.d=+i[0],t+i[0].length):-1}function MQ(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.m=0,n.d=+i[0],t+i[0].length):-1}function v5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.H=+i[0],t+i[0].length):-1}function RQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.M=+i[0],t+i[0].length):-1}function PQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.S=+i[0],t+i[0].length):-1}function OQ(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.L=+i[0],t+i[0].length):-1}function FQ(n,e,t){var i=Qn.exec(e.slice(t,t+6));return i?(n.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function BQ(n,e,t){var i=CQ.exec(e.slice(t,t+1));return i?t+i[0].length:-1}function WQ(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.Q=+i[0],t+i[0].length):-1}function VQ(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.s=+i[0],t+i[0].length):-1}function w5(n,e){return jt(n.getDate(),e,2)}function HQ(n,e){return jt(n.getHours(),e,2)}function zQ(n,e){return jt(n.getHours()%12||12,e,2)}function $Q(n,e){return jt(1+wh.count(Id(n),n),e,3)}function kW(n,e){return jt(n.getMilliseconds(),e,3)}function UQ(n,e){return kW(n,e)+"000"}function jQ(n,e){return jt(n.getMonth()+1,e,2)}function qQ(n,e){return jt(n.getMinutes(),e,2)}function GQ(n,e){return jt(n.getSeconds(),e,2)}function KQ(n){var e=n.getDay();return e===0?7:e}function YQ(n,e){return jt(Vv.count(Id(n)-1,n),e,2)}function EW(n){var e=n.getDay();return e>=4||e===0?Pp(n):Pp.ceil(n)}function ZQ(n,e){return n=EW(n),jt(Pp.count(Id(n),n)+(Id(n).getDay()===4),e,2)}function XQ(n){return n.getDay()}function QQ(n,e){return jt(wC.count(Id(n)-1,n),e,2)}function JQ(n,e){return jt(n.getFullYear()%100,e,2)}function eJ(n,e){return n=EW(n),jt(n.getFullYear()%100,e,2)}function tJ(n,e){return jt(n.getFullYear()%1e4,e,4)}function iJ(n,e){var t=n.getDay();return n=t>=4||t===0?Pp(n):Pp.ceil(n),jt(n.getFullYear()%1e4,e,4)}function nJ(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+jt(e/60|0,"0",2)+jt(e%60,"0",2)}function y5(n,e){return jt(n.getUTCDate(),e,2)}function sJ(n,e){return jt(n.getUTCHours(),e,2)}function oJ(n,e){return jt(n.getUTCHours()%12||12,e,2)}function rJ(n,e){return jt(1+yh.count(Ad(n),n),e,3)}function IW(n,e){return jt(n.getUTCMilliseconds(),e,3)}function aJ(n,e){return IW(n,e)+"000"}function lJ(n,e){return jt(n.getUTCMonth()+1,e,2)}function cJ(n,e){return jt(n.getUTCMinutes(),e,2)}function dJ(n,e){return jt(n.getUTCSeconds(),e,2)}function uJ(n){var e=n.getUTCDay();return e===0?7:e}function hJ(n,e){return jt(Hv.count(Ad(n)-1,n),e,2)}function AW(n){var e=n.getUTCDay();return e>=4||e===0?Op(n):Op.ceil(n)}function fJ(n,e){return n=AW(n),jt(Op.count(Ad(n),n)+(Ad(n).getUTCDay()===4),e,2)}function gJ(n){return n.getUTCDay()}function pJ(n,e){return jt(yC.count(Ad(n)-1,n),e,2)}function mJ(n,e){return jt(n.getUTCFullYear()%100,e,2)}function _J(n,e){return n=AW(n),jt(n.getUTCFullYear()%100,e,2)}function bJ(n,e){return jt(n.getUTCFullYear()%1e4,e,4)}function vJ(n,e){var t=n.getUTCDay();return n=t>=4||t===0?Op(n):Op.ceil(n),jt(n.getUTCFullYear()%1e4,e,4)}function wJ(){return"+0000"}function C5(){return"%"}function S5(n){return+n}function x5(n){return Math.floor(+n/1e3)}var jf,HM,TW,zM,NW;yJ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function yJ(n){return jf=DW(n),HM=jf.format,TW=jf.parse,zM=jf.utcFormat,NW=jf.utcParse,jf}function L0(n){const e={};return t=>e[t]||(e[t]=n(t))}function CJ(n,e){return t=>{const i=n(t),s=i.indexOf(e);if(s<0)return i;let o=SJ(i,s);const r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function SJ(n,e){let t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}function xJ(n){const e=L0(n.format),t=n.formatPrefix;return{format:e,formatPrefix:t,formatFloat(i){const s=Ed(i||",");if(s.precision==null){switch(s.precision=12,s.type){case"%":s.precision-=2;break;case"e":s.precision-=1;break}return CJ(e(s),e(".1f")(1)[1])}else return e(s)},formatSpan(i,s,o,r){r=Ed(r??",f");const a=Uh(i,s,o),l=Math.max(Math.abs(i),Math.abs(s));let c;if(r.precision==null)switch(r.type){case"s":return isNaN(c=mW(a,l))||(r.precision=c),t(r,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=_W(a,l))||(r.precision=c-(r.type==="e"));break}case"f":case"%":{isNaN(c=pW(a))||(r.precision=c-(r.type==="%")*2);break}}return e(r)}}}LJ();function LJ(){return xJ({format:cs,formatPrefix:TM})}function L5(n,e,t){t=t||{},Lo(t)||qi("Invalid time multi-format specifier: ".concat(t));const i=e(Z_),s=e(Y_),o=e(K_),r=e(G_),a=e(q_),l=e(j_),c=e(U_),d=e($_),u=n(t[Px]||".%L"),h=n(t[Z_]||":%S"),f=n(t[Y_]||"%I:%M"),g=n(t[K_]||"%I %p"),p=n(t[G_]||t[Rx]||"%a %d"),_=n(t[q_]||"%b %d"),v=n(t[j_]||"%B"),b=n(t[U_]||"%B"),w=n(t[$_]||"%Y");return y=>(i(y)Di(i)?e(i):L5(e,wQ,i),utcFormat:i=>Di(i)?t(i):L5(t,yQ,i),timeParse:L0(n.parse),utcParse:L0(n.utcParse)}}let yE;DJ();function DJ(){return yE=MW({format:HM,parse:TW,utcFormat:zM,utcParse:NW})}function kJ(n){return MW(DW(n))}function EJ(n){return arguments.length?yE=kJ(n):yE}const IJ=/^(data:|([A-Za-z]+:)?\/\/)/,AJ=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,TJ=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,D5="file://";function NJ(n,e){return t=>({options:t||{},sanitize:RJ,load:MJ,fileAccess:!!e,file:PJ(e),http:FJ(n)})}async function MJ(n,e){const t=await this.sanitize(n,e),i=t.href;return t.localFile?this.file(i):this.http(i,e)}async function RJ(n,e){e=IM({},this.options,e);const t=this.fileAccess,i={href:null};let s,o,r;const a=AJ.test(n.replace(TJ,""));(n==null||typeof n!="string"||!a)&&qi("Sanitize failure, invalid URI: "+Tx(n));const l=IJ.test(n);return(r=e.baseURL)&&!l&&(!n.startsWith("/")&&!r.endsWith("/")&&(n="/"+n),n=r+n),o=(s=n.startsWith(D5))||e.mode==="file"||e.mode!=="http"&&!l&&t,s?n=n.slice(D5.length):n.startsWith("//")&&(e.defaultProtocol==="file"?(n=n.slice(2),o=!0):n=(e.defaultProtocol||"http")+":"+n),Object.defineProperty(i,"localFile",{value:!!o}),i.href=n,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function PJ(n){return n?e=>new Promise((t,i)=>{n.readFile(e,(s,o)=>{s?i(s):t(o)})}):OJ}async function OJ(){qi("No file system access.")}function FJ(n){return n?async function(e,t){const i=IM({},this.options.http,t),s=t&&t.response,o=await n(e,i);return o.ok?Co(o[s])?o[s]():o.text():qi(o.status+""+o.statusText)}:BJ}async function BJ(){qi("No HTTP fetch method available.")}const WJ=n=>n!=null&&n===n,VJ=n=>n==="true"||n==="false"||n===!0||n===!1,HJ=n=>!Number.isNaN(Date.parse(n)),RW=n=>!Number.isNaN(+n)&&!(n instanceof Date),zJ=n=>RW(n)&&Number.isInteger(+n),k5={boolean:kX,integer:W_,number:W_,date:IX,string:AX,unknown:Ix},J1=[VJ,zJ,RW,HJ],$J=["boolean","integer","number","date"];function UJ(n,e){if(!n||!n.length)return"unknown";const t=n.length,i=J1.length,s=J1.map((o,r)=>r+1);for(let o=0,r=0,a,l;oo===0?r:o,0)-1]}function jJ(n,e){return e.reduce((t,i)=>(t[i]=UJ(n,i),t),{})}function E5(n){const e=function(t,i){const s={delimiter:n};return $M(t,i?IM(i,s):s)};return e.responseType="text",e}function $M(n,e){return e.header&&(n=e.header.map(Tx).join(e.delimiter)+` -`+n),aW(e.delimiter).parse(n+"")}$M.responseType="text";function qJ(n){return typeof Buffer=="function"&&Co(Buffer.isBuffer)?Buffer.isBuffer(n):!1}function UM(n,e){const t=e&&e.property?Ex(e.property):Ix;return Lo(n)&&!qJ(n)?GJ(t(n),e):t(JSON.parse(n))}UM.responseType="json";function GJ(n,e){return!Eo(n)&&LX(n)&&(n=[...n]),e&&e.copy?JSON.parse(JSON.stringify(n)):n}const KJ={interior:(n,e)=>n!==e,exterior:(n,e)=>n===e};function PW(n,e){let t,i,s,o;return n=UM(n,e),e&&e.feature?(t=WX,s=e.feature):e&&e.mesh?(t=HX,s=e.mesh,o=KJ[e.filter]):qi("Missing TopoJSON feature or mesh parameter."),i=(i=n.objects[s])?t(n,i,o):qi("Invalid TopoJSON object: "+s),i&&i.features||[i]}PW.responseType="json";const nk={dsv:$M,csv:E5(","),tsv:E5(" "),json:UM,topojson:PW};function OW(n,e){return arguments.length>1?(nk[n]=e,this):th(nk,n)?nk[n]:null}function jM(n,e,t,i){e=e||{};const s=OW(e.type||"json");return s||qi("Unknown data format type: "+e.type),n=s(n,e),e.parse&&YJ(n,e.parse,t,i),th(n,"columns")&&delete n.columns,n}function YJ(n,e,t,i){if(!n.length)return;const s=EJ();t=t||s.timeParse,i=i||s.utcParse;let o=n.columns||Object.keys(n[0]),r,a,l,c,d,u;e==="auto"&&(e=jJ(n,o)),o=Object.keys(e);const h=o.map(f=>{const g=e[f];let p,_;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),_=p[1],(_[0]==="'"&&_[_.length-1]==="'"||_[0]==='"'&&_[_.length-1]==='"')&&(_=_.slice(1,-1)),(p[0]==="utc"?i:t)(_);if(!k5[g])throw Error("Illegal format pattern: "+f+":"+g);return k5[g]});for(l=0,d=n.length,u=o.length;l1)i=rQ(n,e,t);else for(s=0,i=new Array(o=n.arcs.length);se?1:n>=e?0:NaN}function aQ(n,e){return n==null||e==null?NaN:en?1:e>=n?0:NaN}function Wx(n){let e,t,i;n.length!==2?(e=i_,t=(a,l)=>i_(n(a),l),i=(a,l)=>n(a)-l):(e=n===i_||n===aQ?n:lQ,t=n,i=n);function s(a,l,c=0,d=a.length){if(c>>1;t(a[u],l)<0?c=u+1:d=u}while(c>>1;t(a[u],l)<=0?c=u+1:d=u}while(cc&&i(a[u-1],l)>-i(a[u],l)?u-1:u}return{left:s,center:r,right:o}}function lQ(){return 0}function CW(n){return n===null?NaN:+n}const SW=Wx(i_),Id=SW.right;SW.left;Wx(CW).center;function cQ(n,e){let t,i;if(e===void 0)for(const s of n)s!=null&&(t===void 0?s>=s&&(t=i=s):(t>s&&(t=s),i=o&&(t=i=o):(t>o&&(t=o),i=i.length)return t(o);const a=new Ad,l=i[r++];let c=-1;for(const d of o){const u=l(d,++c,o),h=a.get(u);h?h.push(d):a.set(u,[d])}for(const[d,u]of a)a.set(d,s(u,r));return e(a)}(n,0)}var xE=Math.sqrt(50),LE=Math.sqrt(10),DE=Math.sqrt(2);function xC(n,e,t){var i,s=-1,o,r,a;if(e=+e,n=+n,t=+t,n===e&&t>0)return[n];if((i=e0){let l=Math.round(n/a),c=Math.round(e/a);for(l*ae&&--c,r=new Array(o=c-l+1);++se&&--c,r=new Array(o=c-l+1);++s=0?(o>=xE?10:o>=LE?5:o>=DE?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=xE?10:o>=LE?5:o>=DE?2:1)}function Td(n,e,t){var i=Math.abs(e-n)/Math.max(0,t),s=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/s;return o>=xE?s*=10:o>=LE?s*=5:o>=DE&&(s*=2),e=1)return+t(n[i-1],i-1,n);var i,s=(i-1)*e,o=Math.floor(s),r=+t(n[o],o,n),a=+t(n[o+1],o+1,n);return r+(a-r)*(s-o)}}function H_(n,e,t){n=+n,e=+e,t=(s=arguments.length)<2?(e=n,n=0,1):s<3?1:+t;for(var i=-1,s=Math.max(0,Math.ceil((e-n)/t))|0,o=new Array(s);++i=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function LC(n,e){if((t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var t,i=n.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+n.slice(t+1)]}function Op(n){return n=LC(Math.abs(n)),n?n[1]:NaN}function pQ(n,e){return function(t,i){for(var s=t.length,o=[],r=0,a=n[0],l=0;s>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(s-=a,s+a)),!((l+=a+1)>i));)a=n[r=(r+1)%n.length];return o.reverse().join(e)}}function mQ(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var _Q=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nd(n){if(!(e=_Q.exec(n)))throw new Error("invalid format: "+n);var e;return new VM({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Nd.prototype=VM.prototype;function VM(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}VM.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function bQ(n){e:for(var e=n.length,t=1,i=-1,s;t0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(s+1):n}var kW;function vQ(n,e){var t=LC(n,e);if(!t)return n+"";var i=t[0],s=t[1],o=s-(kW=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,r=i.length;return o===r?i:o>r?i+new Array(o-r+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+LC(n,Math.max(0,e+o-1))[0]}function w5(n,e){var t=LC(n,e);if(!t)return n+"";var i=t[0],s=t[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const y5={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:gQ,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>w5(n*100,e),r:w5,s:vQ,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function C5(n){return n}var S5=Array.prototype.map,x5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wQ(n){var e=n.grouping===void 0||n.thousands===void 0?C5:pQ(S5.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",s=n.decimal===void 0?".":n.decimal+"",o=n.numerals===void 0?C5:mQ(S5.call(n.numerals,String)),r=n.percent===void 0?"%":n.percent+"",a=n.minus===void 0?"−":n.minus+"",l=n.nan===void 0?"NaN":n.nan+"";function c(u){u=Nd(u);var h=u.fill,f=u.align,g=u.sign,p=u.symbol,_=u.zero,v=u.width,b=u.comma,w=u.precision,y=u.trim,S=u.type;S==="n"?(b=!0,S="g"):y5[S]||(w===void 0&&(w=12),y=!0,S="g"),(_||h==="0"&&f==="=")&&(_=!0,h="0",f="=");var L=p==="$"?t:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",x=p==="$"?i:/[%p]/.test(S)?r:"",D=y5[S],k=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function P(O){var R=L,M=x,W,G,ne;if(S==="c")M=D(O)+M,O="";else{O=+O;var ce=O<0||1/O<0;if(O=isNaN(O)?l:D(Math.abs(O),w),y&&(O=bQ(O)),ce&&+O==0&&g!=="+"&&(ce=!1),R=(ce?g==="("?g:a:g==="-"||g==="("?"":g)+R,M=(S==="s"?x5[8+kW/3]:"")+M+(ce&&g==="("?")":""),k){for(W=-1,G=O.length;++Wne||ne>57){M=(ne===46?s+O.slice(W+1):O.slice(W))+M,O=O.slice(0,W);break}}}b&&!_&&(O=e(O,1/0));var ge=R.length+O.length+M.length,se=ge>1)+R+O+M+se.slice(ge);break;default:O=se+R+O+M;break}return o(O)}return P.toString=function(){return u+""},P}function d(u,h){var f=c((u=Nd(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(Op(h)/3)))*3,p=Math.pow(10,-g),_=x5[8+g/3];return function(v){return f(p*v)+_}}return{format:c,formatPrefix:d}}var ow,ls,HM;yQ({thousands:",",grouping:[3],currency:["$",""]});function yQ(n){return ow=wQ(n),ls=ow.format,HM=ow.formatPrefix,ow}function EW(n){return Math.max(0,-Op(Math.abs(n)))}function IW(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Op(e)/3)))*3-Op(Math.abs(n)))}function AW(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,Op(e)-Op(n))+1}var rk=new Date,ak=new Date;function Xn(n,e,t,i){function s(o){return n(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=function(o){return n(o=new Date(+o)),o},s.ceil=function(o){return n(o=new Date(o-1)),e(o,1),n(o),o},s.round=function(o){var r=s(o),a=s.ceil(o);return o-r0))return l;do l.push(c=new Date(+o)),e(o,a),n(o);while(c=r)for(;n(r),!o(r);)r.setTime(r-1)},function(r,a){if(r>=r)if(a<0)for(;++a<=0;)for(;e(r,-1),!o(r););else for(;--a>=0;)for(;e(r,1),!o(r););})},t&&(s.count=function(o,r){return rk.setTime(+o),ak.setTime(+r),n(rk),n(ak),Math.floor(t(rk,ak))},s.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(i?function(r){return i(r)%o===0}:function(r){return s.count(0,r)%o===0}):s}),s}var DC=Xn(function(){},function(n,e){n.setTime(+n+e)},function(n,e){return e-n});DC.every=function(n){return n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?Xn(function(e){e.setTime(Math.floor(e/n)*n)},function(e,t){e.setTime(+e+t*n)},function(e,t){return(t-e)/n}):DC};const zM=DC;DC.range;const Wl=1e3,nr=Wl*60,Vl=nr*60,jh=Vl*24,$M=jh*7,L5=jh*30,lk=jh*365;var TW=Xn(function(n){n.setTime(n-n.getMilliseconds())},function(n,e){n.setTime(+n+e*Wl)},function(n,e){return(e-n)/Wl},function(n){return n.getUTCSeconds()});const Gc=TW;TW.range;var NW=Xn(function(n){n.setTime(n-n.getMilliseconds()-n.getSeconds()*Wl)},function(n,e){n.setTime(+n+e*nr)},function(n,e){return(e-n)/nr},function(n){return n.getMinutes()});const UM=NW;NW.range;var MW=Xn(function(n){n.setTime(n-n.getMilliseconds()-n.getSeconds()*Wl-n.getMinutes()*nr)},function(n,e){n.setTime(+n+e*Vl)},function(n,e){return(e-n)/Vl},function(n){return n.getHours()});const jM=MW;MW.range;var RW=Xn(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*nr)/jh,n=>n.getDate()-1);const Sh=RW;RW.range;function mf(n){return Xn(function(e){e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*nr)/$M})}var Gv=mf(0),kC=mf(1),CQ=mf(2),SQ=mf(3),Fp=mf(4),xQ=mf(5),LQ=mf(6);Gv.range;kC.range;CQ.range;SQ.range;Fp.range;xQ.range;LQ.range;var z_=Xn(function(n){n.setDate(1),n.setHours(0,0,0,0)},function(n,e){n.setMonth(n.getMonth()+e)},function(n,e){return e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12},function(n){return n.getMonth()});z_.range;var qM=Xn(function(n){n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e)},function(n,e){return e.getFullYear()-n.getFullYear()},function(n){return n.getFullYear()});qM.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:Xn(function(e){e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t*n)})};const Md=qM;qM.range;var PW=Xn(function(n){n.setUTCSeconds(0,0)},function(n,e){n.setTime(+n+e*nr)},function(n,e){return(e-n)/nr},function(n){return n.getUTCMinutes()});const GM=PW;PW.range;var OW=Xn(function(n){n.setUTCMinutes(0,0,0)},function(n,e){n.setTime(+n+e*Vl)},function(n,e){return(e-n)/Vl},function(n){return n.getUTCHours()});const KM=OW;OW.range;var FW=Xn(function(n){n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCDate(n.getUTCDate()+e)},function(n,e){return(e-n)/jh},function(n){return n.getUTCDate()-1});const xh=FW;FW.range;function _f(n){return Xn(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/$M})}var Kv=_f(0),EC=_f(1),DQ=_f(2),kQ=_f(3),Bp=_f(4),EQ=_f(5),IQ=_f(6);Kv.range;EC.range;DQ.range;kQ.range;Bp.range;EQ.range;IQ.range;var $_=Xn(function(n){n.setUTCDate(1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCMonth(n.getUTCMonth()+e)},function(n,e){return e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12},function(n){return n.getUTCMonth()});$_.range;var YM=Xn(function(n){n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e)},function(n,e){return e.getUTCFullYear()-n.getUTCFullYear()},function(n){return n.getUTCFullYear()});YM.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:Xn(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t*n)})};const Rd=YM;YM.range;function BW(n,e,t,i,s,o){const r=[[Gc,1,Wl],[Gc,5,5*Wl],[Gc,15,15*Wl],[Gc,30,30*Wl],[o,1,nr],[o,5,5*nr],[o,15,15*nr],[o,30,30*nr],[s,1,Vl],[s,3,3*Vl],[s,6,6*Vl],[s,12,12*Vl],[i,1,jh],[i,2,2*jh],[t,1,$M],[e,1,L5],[e,3,3*L5],[n,1,lk]];function a(c,d,u){const h=d_).right(r,h);if(f===r.length)return n.every(Td(c/lk,d/lk,u));if(f===0)return zM.every(Math.max(Td(c,d,u),1));const[g,p]=r[h/r[f-1][2](n[e]=1+t,n),{});const PQ={[U_]:Md,[j_]:z_.every(3),[q_]:z_,[G_]:Gv,[K_]:Sh,[Hx]:Sh,[ZM]:Sh,[Y_]:jM,[Z_]:UM,[X_]:Gc,[zx]:zM},OQ={[U_]:Rd,[j_]:$_.every(3),[q_]:$_,[G_]:Kv,[K_]:xh,[Hx]:xh,[ZM]:xh,[Y_]:KM,[Z_]:GM,[X_]:Gc,[zx]:zM};function FQ(n){return PQ[n]}function BQ(n){return OQ[n]}function ck(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function dk(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function Km(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function WW(n){var e=n.dateTime,t=n.date,i=n.time,s=n.periods,o=n.days,r=n.shortDays,a=n.months,l=n.shortMonths,c=Ym(s),d=Zm(s),u=Ym(o),h=Zm(o),f=Ym(r),g=Zm(r),p=Ym(a),_=Zm(a),v=Ym(l),b=Zm(l),w={a:ce,A:ge,b:se,B:Se,c:null,d:T5,e:T5,f:aJ,g:_J,G:vJ,H:sJ,I:oJ,j:rJ,L:VW,m:lJ,M:cJ,p:Ie,q:pe,Q:R5,s:P5,S:dJ,u:uJ,U:hJ,V:fJ,w:gJ,W:pJ,x:null,X:null,y:mJ,Y:bJ,Z:wJ,"%":M5},y={a:ee,A:Kt,b:xt,B:It,c:null,d:N5,e:N5,f:xJ,g:RJ,G:OJ,H:yJ,I:CJ,j:SJ,L:zW,m:LJ,M:DJ,p:Ge,q:ti,Q:R5,s:P5,S:kJ,u:EJ,U:IJ,V:AJ,w:TJ,W:NJ,x:null,X:null,y:MJ,Y:PJ,Z:FJ,"%":M5},S={a:P,A:O,b:R,B:M,c:W,d:I5,e:I5,f:eJ,g:E5,G:k5,H:A5,I:A5,j:ZQ,L:JQ,m:YQ,M:XQ,p:k,q:KQ,Q:iJ,s:nJ,S:QQ,u:$Q,U:UQ,V:jQ,w:zQ,W:qQ,x:G,X:ne,y:E5,Y:k5,Z:GQ,"%":tJ};w.x=L(t,w),w.X=L(i,w),w.c=L(e,w),y.x=L(t,y),y.X=L(i,y),y.c=L(e,y);function L(De,Ve){return function(he){var ue=[],Di=-1,Lt=0,Et=De.length,mi,Zo,Cu;for(he instanceof Date||(he=new Date(+he));++Di53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Lt=dk(Km(ue.y,0,1)),Et=Lt.getUTCDay(),Lt=Et>4||Et===0?EC.ceil(Lt):EC(Lt),Lt=xh.offset(Lt,(ue.V-1)*7),ue.y=Lt.getUTCFullYear(),ue.m=Lt.getUTCMonth(),ue.d=Lt.getUTCDate()+(ue.w+6)%7):(Lt=ck(Km(ue.y,0,1)),Et=Lt.getDay(),Lt=Et>4||Et===0?kC.ceil(Lt):kC(Lt),Lt=Sh.offset(Lt,(ue.V-1)*7),ue.y=Lt.getFullYear(),ue.m=Lt.getMonth(),ue.d=Lt.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),Et="Z"in ue?dk(Km(ue.y,0,1)).getUTCDay():ck(Km(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(Et+5)%7:ue.w+ue.U*7-(Et+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,dk(ue)):ck(ue)}}function D(De,Ve,he,ue){for(var Di=0,Lt=Ve.length,Et=he.length,mi,Zo;Di=Et)return-1;if(mi=Ve.charCodeAt(Di++),mi===37){if(mi=Ve.charAt(Di++),Zo=S[mi in D5?Ve.charAt(Di++):mi],!Zo||(ue=Zo(De,he,ue))<0)return-1}else if(mi!=he.charCodeAt(ue++))return-1}return ue}function k(De,Ve,he){var ue=c.exec(Ve.slice(he));return ue?(De.p=d.get(ue[0].toLowerCase()),he+ue[0].length):-1}function P(De,Ve,he){var ue=f.exec(Ve.slice(he));return ue?(De.w=g.get(ue[0].toLowerCase()),he+ue[0].length):-1}function O(De,Ve,he){var ue=u.exec(Ve.slice(he));return ue?(De.w=h.get(ue[0].toLowerCase()),he+ue[0].length):-1}function R(De,Ve,he){var ue=v.exec(Ve.slice(he));return ue?(De.m=b.get(ue[0].toLowerCase()),he+ue[0].length):-1}function M(De,Ve,he){var ue=p.exec(Ve.slice(he));return ue?(De.m=_.get(ue[0].toLowerCase()),he+ue[0].length):-1}function W(De,Ve,he){return D(De,e,Ve,he)}function G(De,Ve,he){return D(De,t,Ve,he)}function ne(De,Ve,he){return D(De,i,Ve,he)}function ce(De){return r[De.getDay()]}function ge(De){return o[De.getDay()]}function se(De){return l[De.getMonth()]}function Se(De){return a[De.getMonth()]}function Ie(De){return s[+(De.getHours()>=12)]}function pe(De){return 1+~~(De.getMonth()/3)}function ee(De){return r[De.getUTCDay()]}function Kt(De){return o[De.getUTCDay()]}function xt(De){return l[De.getUTCMonth()]}function It(De){return a[De.getUTCMonth()]}function Ge(De){return s[+(De.getUTCHours()>=12)]}function ti(De){return 1+~~(De.getUTCMonth()/3)}return{format:function(De){var Ve=L(De+="",w);return Ve.toString=function(){return De},Ve},parse:function(De){var Ve=x(De+="",!1);return Ve.toString=function(){return De},Ve},utcFormat:function(De){var Ve=L(De+="",y);return Ve.toString=function(){return De},Ve},utcParse:function(De){var Ve=x(De+="",!0);return Ve.toString=function(){return De},Ve}}}var D5={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,WQ=/^%/,VQ=/[\\^$*+?|[\]().{}]/g;function qt(n,e,t){var i=n<0?"-":"",s=(i?-n:n)+"",o=s.length;return i+(o[e.toLowerCase(),t]))}function zQ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.w=+i[0],t+i[0].length):-1}function $Q(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.u=+i[0],t+i[0].length):-1}function UQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.U=+i[0],t+i[0].length):-1}function jQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.V=+i[0],t+i[0].length):-1}function qQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.W=+i[0],t+i[0].length):-1}function k5(n,e,t){var i=Qn.exec(e.slice(t,t+4));return i?(n.y=+i[0],t+i[0].length):-1}function E5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function GQ(n,e,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function KQ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.q=i[0]*3-3,t+i[0].length):-1}function YQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.m=i[0]-1,t+i[0].length):-1}function I5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.d=+i[0],t+i[0].length):-1}function ZQ(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.m=0,n.d=+i[0],t+i[0].length):-1}function A5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.H=+i[0],t+i[0].length):-1}function XQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.M=+i[0],t+i[0].length):-1}function QQ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.S=+i[0],t+i[0].length):-1}function JQ(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.L=+i[0],t+i[0].length):-1}function eJ(n,e,t){var i=Qn.exec(e.slice(t,t+6));return i?(n.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function tJ(n,e,t){var i=WQ.exec(e.slice(t,t+1));return i?t+i[0].length:-1}function iJ(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.Q=+i[0],t+i[0].length):-1}function nJ(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.s=+i[0],t+i[0].length):-1}function T5(n,e){return qt(n.getDate(),e,2)}function sJ(n,e){return qt(n.getHours(),e,2)}function oJ(n,e){return qt(n.getHours()%12||12,e,2)}function rJ(n,e){return qt(1+Sh.count(Md(n),n),e,3)}function VW(n,e){return qt(n.getMilliseconds(),e,3)}function aJ(n,e){return VW(n,e)+"000"}function lJ(n,e){return qt(n.getMonth()+1,e,2)}function cJ(n,e){return qt(n.getMinutes(),e,2)}function dJ(n,e){return qt(n.getSeconds(),e,2)}function uJ(n){var e=n.getDay();return e===0?7:e}function hJ(n,e){return qt(Gv.count(Md(n)-1,n),e,2)}function HW(n){var e=n.getDay();return e>=4||e===0?Fp(n):Fp.ceil(n)}function fJ(n,e){return n=HW(n),qt(Fp.count(Md(n),n)+(Md(n).getDay()===4),e,2)}function gJ(n){return n.getDay()}function pJ(n,e){return qt(kC.count(Md(n)-1,n),e,2)}function mJ(n,e){return qt(n.getFullYear()%100,e,2)}function _J(n,e){return n=HW(n),qt(n.getFullYear()%100,e,2)}function bJ(n,e){return qt(n.getFullYear()%1e4,e,4)}function vJ(n,e){var t=n.getDay();return n=t>=4||t===0?Fp(n):Fp.ceil(n),qt(n.getFullYear()%1e4,e,4)}function wJ(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function N5(n,e){return qt(n.getUTCDate(),e,2)}function yJ(n,e){return qt(n.getUTCHours(),e,2)}function CJ(n,e){return qt(n.getUTCHours()%12||12,e,2)}function SJ(n,e){return qt(1+xh.count(Rd(n),n),e,3)}function zW(n,e){return qt(n.getUTCMilliseconds(),e,3)}function xJ(n,e){return zW(n,e)+"000"}function LJ(n,e){return qt(n.getUTCMonth()+1,e,2)}function DJ(n,e){return qt(n.getUTCMinutes(),e,2)}function kJ(n,e){return qt(n.getUTCSeconds(),e,2)}function EJ(n){var e=n.getUTCDay();return e===0?7:e}function IJ(n,e){return qt(Kv.count(Rd(n)-1,n),e,2)}function $W(n){var e=n.getUTCDay();return e>=4||e===0?Bp(n):Bp.ceil(n)}function AJ(n,e){return n=$W(n),qt(Bp.count(Rd(n),n)+(Rd(n).getUTCDay()===4),e,2)}function TJ(n){return n.getUTCDay()}function NJ(n,e){return qt(EC.count(Rd(n)-1,n),e,2)}function MJ(n,e){return qt(n.getUTCFullYear()%100,e,2)}function RJ(n,e){return n=$W(n),qt(n.getUTCFullYear()%100,e,2)}function PJ(n,e){return qt(n.getUTCFullYear()%1e4,e,4)}function OJ(n,e){var t=n.getUTCDay();return n=t>=4||t===0?Bp(n):Bp.ceil(n),qt(n.getUTCFullYear()%1e4,e,4)}function FJ(){return"+0000"}function M5(){return"%"}function R5(n){return+n}function P5(n){return Math.floor(+n/1e3)}var jf,XM,UW,QM,jW;BJ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function BJ(n){return jf=WW(n),XM=jf.format,UW=jf.parse,QM=jf.utcFormat,jW=jf.utcParse,jf}function k0(n){const e={};return t=>e[t]||(e[t]=n(t))}function WJ(n,e){return t=>{const i=n(t),s=i.indexOf(e);if(s<0)return i;let o=VJ(i,s);const r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function VJ(n,e){let t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}function HJ(n){const e=k0(n.format),t=n.formatPrefix;return{format:e,formatPrefix:t,formatFloat(i){const s=Nd(i||",");if(s.precision==null){switch(s.precision=12,s.type){case"%":s.precision-=2;break;case"e":s.precision-=1;break}return WJ(e(s),e(".1f")(1)[1])}else return e(s)},formatSpan(i,s,o,r){r=Nd(r??",f");const a=Td(i,s,o),l=Math.max(Math.abs(i),Math.abs(s));let c;if(r.precision==null)switch(r.type){case"s":return isNaN(c=IW(a,l))||(r.precision=c),t(r,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=AW(a,l))||(r.precision=c-(r.type==="e"));break}case"f":case"%":{isNaN(c=EW(a))||(r.precision=c-(r.type==="%")*2);break}}return e(r)}}}zJ();function zJ(){return HJ({format:ls,formatPrefix:HM})}function O5(n,e,t){t=t||{},xo(t)||qi("Invalid time multi-format specifier: ".concat(t));const i=e(X_),s=e(Z_),o=e(Y_),r=e(K_),a=e(G_),l=e(q_),c=e(j_),d=e(U_),u=n(t[zx]||".%L"),h=n(t[X_]||":%S"),f=n(t[Z_]||"%I:%M"),g=n(t[Y_]||"%I %p"),p=n(t[K_]||t[Hx]||"%a %d"),_=n(t[G_]||"%b %d"),v=n(t[q_]||"%B"),b=n(t[j_]||"%B"),w=n(t[U_]||"%Y");return y=>(i(y)Ei(i)?e(i):O5(e,FQ,i),utcFormat:i=>Ei(i)?t(i):O5(t,BQ,i),timeParse:k0(n.parse),utcParse:k0(n.utcParse)}}let kE;$J();function $J(){return kE=qW({format:XM,parse:UW,utcFormat:QM,utcParse:jW})}function UJ(n){return qW(WW(n))}function jJ(n){return arguments.length?kE=UJ(n):kE}const qJ=/^(data:|([A-Za-z]+:)?\/\/)/,GJ=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,KJ=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,F5="file://";function YJ(n,e){return t=>({options:t||{},sanitize:XJ,load:ZJ,fileAccess:!!e,file:QJ(e),http:eee(n)})}async function ZJ(n,e){const t=await this.sanitize(n,e),i=t.href;return t.localFile?this.file(i):this.http(i,e)}async function XJ(n,e){e=WM({},this.options,e);const t=this.fileAccess,i={href:null};let s,o,r;const a=GJ.test(n.replace(KJ,""));(n==null||typeof n!="string"||!a)&&qi("Sanitize failure, invalid URI: "+Bx(n));const l=qJ.test(n);return(r=e.baseURL)&&!l&&(!n.startsWith("/")&&!r.endsWith("/")&&(n="/"+n),n=r+n),o=(s=n.startsWith(F5))||e.mode==="file"||e.mode!=="http"&&!l&&t,s?n=n.slice(F5.length):n.startsWith("//")&&(e.defaultProtocol==="file"?(n=n.slice(2),o=!0):n=(e.defaultProtocol||"http")+":"+n),Object.defineProperty(i,"localFile",{value:!!o}),i.href=n,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function QJ(n){return n?e=>new Promise((t,i)=>{n.readFile(e,(s,o)=>{s?i(s):t(o)})}):JJ}async function JJ(){qi("No file system access.")}function eee(n){return n?async function(e,t){const i=WM({},this.options.http,t),s=t&&t.response,o=await n(e,i);return o.ok?yo(o[s])?o[s]():o.text():qi(o.status+""+o.statusText)}:tee}async function tee(){qi("No HTTP fetch method available.")}const iee=n=>n!=null&&n===n,nee=n=>n==="true"||n==="false"||n===!0||n===!1,see=n=>!Number.isNaN(Date.parse(n)),GW=n=>!Number.isNaN(+n)&&!(n instanceof Date),oee=n=>GW(n)&&Number.isInteger(+n),B5={boolean:UX,integer:V_,number:V_,date:qX,string:GX,unknown:Ox},rw=[nee,oee,GW,see],ree=["boolean","integer","number","date"];function aee(n,e){if(!n||!n.length)return"unknown";const t=n.length,i=rw.length,s=rw.map((o,r)=>r+1);for(let o=0,r=0,a,l;oo===0?r:o,0)-1]}function lee(n,e){return e.reduce((t,i)=>(t[i]=aee(n,i),t),{})}function W5(n){const e=function(t,i){const s={delimiter:n};return JM(t,i?WM(i,s):s)};return e.responseType="text",e}function JM(n,e){return e.header&&(n=e.header.map(Bx).join(e.delimiter)+` +`+n),wW(e.delimiter).parse(n+"")}JM.responseType="text";function cee(n){return typeof Buffer=="function"&&yo(Buffer.isBuffer)?Buffer.isBuffer(n):!1}function eR(n,e){const t=e&&e.property?Px(e.property):Ox;return xo(n)&&!cee(n)?dee(t(n),e):t(JSON.parse(n))}eR.responseType="json";function dee(n,e){return!Zs(n)&&zX(n)&&(n=[...n]),e&&e.copy?JSON.parse(JSON.stringify(n)):n}const uee={interior:(n,e)=>n!==e,exterior:(n,e)=>n===e};function KW(n,e){let t,i,s,o;return n=eR(n,e),e&&e.feature?(t=iQ,s=e.feature):e&&e.mesh?(t=sQ,s=e.mesh,o=uee[e.filter]):qi("Missing TopoJSON feature or mesh parameter."),i=(i=n.objects[s])?t(n,i,o):qi("Invalid TopoJSON object: "+s),i&&i.features||[i]}KW.responseType="json";const uk={dsv:JM,csv:W5(","),tsv:W5(" "),json:eR,topojson:KW};function YW(n,e){return arguments.length>1?(uk[n]=e,this):rh(uk,n)?uk[n]:null}function tR(n,e,t,i){e=e||{};const s=YW(e.type||"json");return s||qi("Unknown data format type: "+e.type),n=s(n,e),e.parse&&hee(n,e.parse,t,i),rh(n,"columns")&&delete n.columns,n}function hee(n,e,t,i){if(!n.length)return;const s=jJ();t=t||s.timeParse,i=i||s.utcParse;let o=n.columns||Object.keys(n[0]),r,a,l,c,d,u;e==="auto"&&(e=lee(n,o)),o=Object.keys(e);const h=o.map(f=>{const g=e[f];let p,_;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),_=p[1],(_[0]==="'"&&_[_.length-1]==="'"||_[0]==='"'&&_[_.length-1]==='"')&&(_=_.slice(1,-1)),(p[0]==="utc"?i:t)(_);if(!B5[g])throw Error("Illegal format pattern: "+f+":"+g);return B5[g]});for(l=0,d=n.length,u=o.length;l2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)e[i]==null&&(this.ut.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ut.add(i);const o=typeof s=="string"&&s.endsWith(ZJ);i.includes("-")||o?t.setProperty(i,o?s.slice(0,-11):s,o?FW:""):t[i]=s}}return Hh}}),QJ="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e.spinner_ajPY{transform-origin:center;animation:spinner_AtaB%20.75s%20infinite%20linear}@keyframes%20spinner_AtaB{100%25{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z'%20opacity='.25'/%3e%3cpath%20d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%20class='spinner_ajPY'/%3e%3c/svg%3e",JJ=`.genome-spy { + */const ZW="important",fee=" !"+ZW,gee=RB(class extends PB{constructor(n){var e;if(super(n),n.type!==MB.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)e[i]==null&&(this.ut.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ut.add(i);const o=typeof s=="string"&&s.endsWith(fee);i.includes("-")||o?t.setProperty(i,o?s.slice(0,-11):s,o?ZW:""):t[i]=s}}return zh}}),pee="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e.spinner_ajPY{transform-origin:center;animation:spinner_AtaB%20.75s%20infinite%20linear}@keyframes%20spinner_AtaB{100%25{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z'%20opacity='.25'/%3e%3cpath%20d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%20class='spinner_ajPY'/%3e%3c/svg%3e",mee=`.genome-spy { font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; position: relative; } @@ -941,221 +941,30 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { border: 1px solid red; padding: 10px; background: #fff0f0; -}`;function eee(n,e){var t=n.getBoundingClientRect();return[e.clientX-t.left-n.clientLeft,e.clientY-t.top-n.clientTop]}function CC(n,e){return n.length==e.length&&n.every((t,i)=>n[i]===e[i])}function qs(n){return Array.isArray(n)?n:typeof n<"u"?[n]:[]}function zv(n){return n[n.length-1]}class tee{constructor(e){this.container=e,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(e){e!=this._visible&&(this.element.style.display=e?null:"none",this._visible=e)}get visible(){return this._visible}get enabled(){return zv(this.enabledStack)??!0}pushEnabledState(e){this.enabledStack.push(e),e||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(e){this.mouseCoords=eee(this.container,e);const t=performance.now();!this.visible&&!this._isPenalty()&&t-this._previousMove>500&&(this._penaltyUntil=t+70),this._lastCoords&&iee(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=t+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=t}updatePlacement(){const[t,i]=this.mouseCoords;let s=t+20;s>this.container.clientWidth-this.element.offsetWidth&&(s=t-20-this.element.offsetWidth),this.element.style.left=s+"px",this.element.style.top=Math.min(i+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(e){if(!e||!this.enabled||this._isPenalty()){this.visible&&(M_("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}M_(e,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(e,t){e!==this._previousTooltipDatum&&(this._previousTooltipDatum=e,t||(t=i=>Promise.resolve(Ti` ${JSON.stringify(i)} `)),t(e).then(i=>this.setContent(i)).catch(i=>{if(i!=="debounced")throw i}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function iee(n,e){let t=0;for(let i=0;i";tl[qh]="Identifier";tl[Zd]="Keyword";tl[Bx]="Null";tl[bf]="Numeric";tl[uo]="Punctuator";tl[Uv]="String";tl[mee]="RegularExpression";var _ee="ArrayExpression",bee="BinaryExpression",vee="CallExpression",wee="ConditionalExpression",BW="Identifier",yee="Literal",Cee="LogicalExpression",See="MemberExpression",xee="ObjectExpression",Lee="Property",Dee="UnaryExpression",Gn="Unexpected token %0",kee="Unexpected number",Eee="Unexpected string",Iee="Unexpected identifier",Aee="Unexpected reserved word",Tee="Unexpected end of input",CE="Invalid regular expression",sk="Invalid regular expression: missing /",WW="Octal literals are not allowed in strict mode.",Nee="Duplicate data property in object literal not allowed in strict mode",as="ILLEGAL",X_="Disabled.",Mee=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Ree=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Wx(n,e){if(!n)throw new Error("ASSERT: "+e)}function wl(n){return n>=48&&n<=57}function qM(n){return"0123456789abcdefABCDEF".indexOf(n)>=0}function t_(n){return"01234567".indexOf(n)>=0}function Pee(n){return n===32||n===9||n===11||n===12||n===160||n>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(n)>=0}function Q_(n){return n===10||n===13||n===8232||n===8233}function jv(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n===92||n>=128&&Mee.test(String.fromCharCode(n))}function SC(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===92||n>=128&&Ree.test(String.fromCharCode(n))}const Oee={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function VW(){for(;te1114111||n!=="}")&&Ut({},Gn,as),e<=65535?String.fromCharCode(e):(t=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(t,i))}function HW(){var n,e;for(n=Oe.charCodeAt(te++),e=String.fromCharCode(n),n===92&&(Oe.charCodeAt(te)!==117&&Ut({},Gn,as),++te,n=SE("u"),(!n||n==="\\"||!jv(n.charCodeAt(0)))&&Ut({},Gn,as),e=n);te>>=")return te+=4,{type:uo,value:r,start:n,end:te};if(o=r.substr(0,3),o===">>>"||o==="<<="||o===">>=")return te+=3,{type:uo,value:o,start:n,end:te};if(s=o.substr(0,2),i===s[1]&&"+-<>&|".indexOf(i)>=0||s==="=>")return te+=2,{type:uo,value:s,start:n,end:te};if(s==="//"&&Ut({},Gn,as),"<>=!+-*%&|^/".indexOf(i)>=0)return++te,{type:uo,value:i,start:n,end:te};Ut({},Gn,as)}function Vee(n){let e="";for(;te=0&&te=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,s)=>{if(parseInt(s,16)<=1114111)return"x";Ut({},CE)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(t)}catch{Ut({},CE)}try{return new RegExp(n,e)}catch{return null}}function Uee(){var n,e,t,i,s;for(n=Oe[te],Wx(n==="/","Regular expression literal must start with a slash"),e=Oe[te++],t=!1,i=!1;te=0&&Ut({},CE,t),{value:t,literal:e}}function qee(){var n,e,t,i;return oi=null,VW(),n=te,e=Uee(),t=jee(),i=$ee(e.value,t.value),{literal:e.literal+t.literal,value:i,regex:{pattern:e.value,flags:t.value},start:n,end:te}}function Gee(n){return n.type===qh||n.type===Zd||n.type===Fx||n.type===Bx}function zW(){if(VW(),te>=Ts)return{type:$v,start:te,end:te};const n=Oe.charCodeAt(te);return jv(n)?Wee():n===40||n===41||n===59?ok():n===39||n===34?zee():n===46?wl(Oe.charCodeAt(te+1))?I5():ok():wl(n)?I5():ok()}function fo(){const n=oi;return te=n.end,oi=zW(),te=n.end,n}function $W(){const n=te;oi=zW(),te=n}function Kee(n){const e=new sa(_ee);return e.elements=n,e}function A5(n,e,t){const i=new sa(n==="||"||n==="&&"?Cee:bee);return i.operator=n,i.left=e,i.right=t,i}function Yee(n,e){const t=new sa(vee);return t.callee=n,t.arguments=e,t}function Zee(n,e,t){const i=new sa(wee);return i.test=n,i.consequent=e,i.alternate=t,i}function GM(n){const e=new sa(BW);return e.name=n,e}function D0(n){const e=new sa(yee);return e.value=n.value,e.raw=Oe.slice(n.start,n.end),n.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=n.regex),e}function T5(n,e,t){const i=new sa(See);return i.computed=n==="[",i.object=e,i.property=t,i.computed||(t.member=!0),i}function Xee(n){const e=new sa(xee);return e.properties=n,e}function N5(n,e,t){const i=new sa(Lee);return i.key=e,i.value=t,i.kind=n,i}function Qee(n,e){const t=new sa(Dee);return t.operator=n,t.argument=e,t.prefix=!0,t}function Ut(n,e){var t,i=Array.prototype.slice.call(arguments,2),s=e.replace(/%(\d)/g,(o,r)=>(Wx(r":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function dte(){var n,e,t,i,s,o,r,a,l,c;if(n=oi,l=Sy(),i=oi,s=P5(i),s===0)return l;for(i.prec=s,fo(),e=[n,oi],r=Sy(),o=[l,i,r];(s=P5(oi))>0;){for(;o.length>2&&s<=o[o.length-2].prec;)r=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),t=A5(a,l,r),o.push(t);i=fo(),i.prec=s,o.push(i),e.push(oi),t=Sy(),o.push(t)}for(c=o.length-1,t=o[c],e.pop();c>1;)e.pop(),t=A5(o[c-1].value,o[c-2],t),c-=2;return t}function Gh(){var n,e,t;return n=dte(),Mi("?")&&(fo(),e=Gh(),Ns(":"),t=Gh(),n=Zee(n,e,t)),n}function KM(){const n=Gh();if(Mi(","))throw new Error(X_);return n}function ute(n){Oe=n,te=0,Ts=Oe.length,oi=null,$W();const e=KM();if(oi.type!==$v)throw new Error("Unexpect token after expression.");return e}var hte={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function UW(n){function e(r,a,l,c){let d=n(a[0]);return l&&(d=l+"("+d+")",l.lastIndexOf("new ",0)===0&&(d="("+d+")")),d+"."+r+(c<0?"":c===0?"()":"("+a.slice(1).map(n).join(",")+")")}function t(r,a,l){return c=>e(r,c,a,l)}const i="new Date",s="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(r){r.length<3&&qi("Missing arguments to clamp function."),r.length>3&&qi("Too many arguments to clamp function.");const a=r.map(n);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:t("getDate",i,0),day:t("getDay",i,0),year:t("getFullYear",i,0),month:t("getMonth",i,0),hours:t("getHours",i,0),minutes:t("getMinutes",i,0),seconds:t("getSeconds",i,0),milliseconds:t("getMilliseconds",i,0),time:t("getTime",i,0),timezoneoffset:t("getTimezoneOffset",i,0),utcdate:t("getUTCDate",i,0),utcday:t("getUTCDay",i,0),utcyear:t("getUTCFullYear",i,0),utcmonth:t("getUTCMonth",i,0),utchours:t("getUTCHours",i,0),utcminutes:t("getUTCMinutes",i,0),utcseconds:t("getUTCSeconds",i,0),utcmilliseconds:t("getUTCMilliseconds",i,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",s,0),lower:t("toLowerCase",s,0),substring:t("substring",s),split:t("split",s),trim:t("trim",s,0),regexp:o,test:t("test",o),if:function(r){r.length<3&&qi("Missing arguments to if function."),r.length>3&&qi("Too many arguments to if function.");const a=r.map(n);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function fte(n){const e=n&&n.length-1;return e&&(n[0]==='"'&&n[e]==='"'||n[0]==="'"&&n[e]==="'")?n.slice(1,-1):n}function gte(n){n=n||{};const e=n.allowed?mC(n.allowed):{},t=n.forbidden?mC(n.forbidden):{},i=n.constants||hte,s=(n.functions||UW)(u),o=n.globalvar,r=n.fieldvar,a=Co(o)?o:g=>`${o}["${g}"]`;let l={},c={},d=0;function u(g){if(Di(g))return g;const p=h[g.type];return p==null&&qi("Unsupported type: "+g.type),p(g)}const h={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return d>0?p:th(t,p)?qi("Illegal identifier: "+p):th(i,p)?i[p]:th(e,p)?p:(l[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,_=u(g.object);p&&(d+=1);const v=u(g.property);return _===r&&(c[fte(v)]=1),p&&(d-=1),_+(p?"."+v:"["+v+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&qi("Illegal callee type: "+g.callee.type);const p=g.callee.name,_=g.arguments,v=th(s,p)&&s[p];return v||qi("Unrecognized function: "+p),Co(v)?v(_):v+"("+_.map(u).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(u).join(",")+"]",BinaryExpression:g=>"("+u(g.left)+" "+g.operator+" "+u(g.right)+")",UnaryExpression:g=>"("+g.operator+u(g.argument)+")",ConditionalExpression:g=>"("+u(g.test)+"?"+u(g.consequent)+":"+u(g.alternate)+")",LogicalExpression:g=>"("+u(g.left)+g.operator+u(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(u).join(",")+"}",Property:g=>{d+=1;const p=u(g.key);return d-=1,p+":"+u(g.value)}};function f(g){const p={code:u(g),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},p}return f.functions=s,f.constants=i,f}function jW(n,e,t){return t=(t-n)/(e-n),t=Math.max(0,Math.min(1,t)),t*t*(3-2*t)}function J_(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function pte(n,e,t){return J_((t-n)/(e-n),0,1)}const qW={clamp:J_,isArray:Eo,isBoolean:Wv,isDefined(n){return n!==void 0},isNumber:Xs,isObject:Lo,isRegExp:DX,isString:Di,isValid(n){return n!=null&&n===n},lerp:oW,linearstep:pte,smoothstep:jW};function mte(n){const e=UW(n);for(const t in qW)e[t]=`this.${t}`;return e}const _te=gte({forbidden:[],allowed:["datum"],globalvar:"globalObject",fieldvar:"datum",functions:mte});function Hx(n,e={}){try{const t=ute(n),i=_te(t),s=Function("datum","globalObject",`"use strict"; return (${i.code});`).bind(qW),o=r=>s(r,e);return o.fields=i.fields,o.globals=i.globals,o.code=i.code,o}catch(t){throw new Error(`Invalid expression: ${n}, ${t.message}`)}}function il(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}function Xd(n,e){switch(arguments.length){case 0:break;case 1:{typeof n=="function"?this.interpolator(n):this.range(n);break}default:{this.domain(n),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const xE=Symbol("implicit");function YM(){var n=new kd,e=[],t=[],i=xE;function s(o){let r=n.get(o);if(r===void 0){if(i!==xE)return i;n.set(o,r=e.push(o)-1)}return t[r%t.length]}return s.domain=function(o){if(!arguments.length)return e.slice();e=[],n=new kd;for(const r of o)n.has(r)||n.set(r,e.push(r)-1);return s},s.range=function(o){return arguments.length?(t=Array.from(o),s):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.copy=function(){return YM(e,t).unknown(i)},il.apply(s,arguments),s}function Sm(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function qv(n,e){var t=Object.create(n.prototype);for(var i in e)t[i]=e[i];return t}function Qd(){}var Kh=.7,Fp=1/Kh,Gg="\\s*([+-]?\\d+)\\s*",eb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ba="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bte=/^#([0-9a-f]{3,8})$/,vte=new RegExp(`^rgb\\(${Gg},${Gg},${Gg}\\)$`),wte=new RegExp(`^rgb\\(${Ba},${Ba},${Ba}\\)$`),yte=new RegExp(`^rgba\\(${Gg},${Gg},${Gg},${eb}\\)$`),Cte=new RegExp(`^rgba\\(${Ba},${Ba},${Ba},${eb}\\)$`),Ste=new RegExp(`^hsl\\(${eb},${Ba},${Ba}\\)$`),xte=new RegExp(`^hsla\\(${eb},${Ba},${Ba},${eb}\\)$`),O5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sm(Qd,Td,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:F5,formatHex:F5,formatHex8:Lte,formatHsl:Dte,formatRgb:B5,toString:B5});function F5(){return this.rgb().formatHex()}function Lte(){return this.rgb().formatHex8()}function Dte(){return GW(this).formatHsl()}function B5(){return this.rgb().formatRgb()}function Td(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=bte.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?W5(e):t===3?new Kn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?ew(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?ew(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=vte.exec(n))?new Kn(e[1],e[2],e[3],1):(e=wte.exec(n))?new Kn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=yte.exec(n))?ew(e[1],e[2],e[3],e[4]):(e=Cte.exec(n))?ew(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ste.exec(n))?z5(e[1],e[2]/100,e[3]/100,1):(e=xte.exec(n))?z5(e[1],e[2]/100,e[3]/100,e[4]):O5.hasOwnProperty(n)?W5(O5[n]):n==="transparent"?new Kn(NaN,NaN,NaN,0):null}function W5(n){return new Kn(n>>16&255,n>>8&255,n&255,1)}function ew(n,e,t,i){return i<=0&&(n=e=t=NaN),new Kn(n,e,t,i)}function ZM(n){return n instanceof Qd||(n=Td(n)),n?(n=n.rgb(),new Kn(n.r,n.g,n.b,n.opacity)):new Kn}function xC(n,e,t,i){return arguments.length===1?ZM(n):new Kn(n,e,t,i??1)}function Kn(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}Sm(Kn,xC,qv(Qd,{brighter(n){return n=n==null?Fp:Math.pow(Fp,n),new Kn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Kh:Math.pow(Kh,n),new Kn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Kn(Ch(this.r),Ch(this.g),Ch(this.b),LC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:V5,formatHex:V5,formatHex8:kte,formatRgb:H5,toString:H5}));function V5(){return`#${ih(this.r)}${ih(this.g)}${ih(this.b)}`}function kte(){return`#${ih(this.r)}${ih(this.g)}${ih(this.b)}${ih((isNaN(this.opacity)?1:this.opacity)*255)}`}function H5(){const n=LC(this.opacity);return`${n===1?"rgb(":"rgba("}${Ch(this.r)}, ${Ch(this.g)}, ${Ch(this.b)}${n===1?")":`, ${n})`}`}function LC(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Ch(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ih(n){return n=Ch(n),(n<16?"0":"")+n.toString(16)}function z5(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new zr(n,e,t,i)}function GW(n){if(n instanceof zr)return new zr(n.h,n.s,n.l,n.opacity);if(n instanceof Qd||(n=Td(n)),!n)return new zr;if(n instanceof zr)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new zr(r,a,l,n.opacity)}function LE(n,e,t,i){return arguments.length===1?GW(n):new zr(n,e,t,i??1)}function zr(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}Sm(zr,LE,qv(Qd,{brighter(n){return n=n==null?Fp:Math.pow(Fp,n),new zr(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Kh:Math.pow(Kh,n),new zr(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Kn(ak(n>=240?n-240:n+120,s,i),ak(n,s,i),ak(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new zr($5(this.h),tw(this.s),tw(this.l),LC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=LC(this.opacity);return`${n===1?"hsl(":"hsla("}${$5(this.h)}, ${tw(this.s)*100}%, ${tw(this.l)*100}%${n===1?")":`, ${n})`}`}}));function $5(n){return n=(n||0)%360,n<0?n+360:n}function tw(n){return Math.max(0,Math.min(1,n||0))}function ak(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const KW=Math.PI/180,YW=180/Math.PI,DC=18,ZW=.96422,XW=1,QW=.82521,JW=4/29,Kg=6/29,eV=3*Kg*Kg,Ete=Kg*Kg*Kg;function tV(n){if(n instanceof Wa)return new Wa(n.l,n.a,n.b,n.opacity);if(n instanceof Wl)return iV(n);n instanceof Kn||(n=ZM(n));var e=uk(n.r),t=uk(n.g),i=uk(n.b),s=lk((.2225045*e+.7168786*t+.0606169*i)/XW),o,r;return e===t&&t===i?o=r=s:(o=lk((.4360747*e+.3850649*t+.1430804*i)/ZW),r=lk((.0139322*e+.0971045*t+.7141733*i)/QW)),new Wa(116*s-16,500*(o-s),200*(s-r),n.opacity)}function DE(n,e,t,i){return arguments.length===1?tV(n):new Wa(n,e,t,i??1)}function Wa(n,e,t,i){this.l=+n,this.a=+e,this.b=+t,this.opacity=+i}Sm(Wa,DE,qv(Qd,{brighter(n){return new Wa(this.l+DC*(n??1),this.a,this.b,this.opacity)},darker(n){return new Wa(this.l-DC*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,e=isNaN(this.a)?n:n+this.a/500,t=isNaN(this.b)?n:n-this.b/200;return e=ZW*ck(e),n=XW*ck(n),t=QW*ck(t),new Kn(dk(3.1338561*e-1.6168667*n-.4906146*t),dk(-.9787684*e+1.9161415*n+.033454*t),dk(.0719453*e-.2289914*n+1.4052427*t),this.opacity)}}));function lk(n){return n>Ete?Math.pow(n,1/3):n/eV+JW}function ck(n){return n>Kg?n*n*n:eV*(n-JW)}function dk(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function uk(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Ite(n){if(n instanceof Wl)return new Wl(n.h,n.c,n.l,n.opacity);if(n instanceof Wa||(n=tV(n)),n.a===0&&n.b===0)return new Wl(NaN,0=1?(t=1,e-1):Math.floor(t*e),s=n[i],o=n[i+1],r=i>0?n[i-1]:2*s-o,a=i()=>n;function aV(n,e){return function(t){return n+t*e}}function Tte(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function Ux(n,e){var t=e-n;return t?aV(n,t>180||t<-180?t-360*Math.round(t/360):t):$x(isNaN(n)?e:n)}function Nte(n){return(n=+n)==1?Yn:function(e,t){return t-e?Tte(e,t,n):$x(isNaN(e)?t:e)}}function Yn(n,e){var t=e-n;return t?aV(n,t):$x(isNaN(n)?e:n)}const IE=function n(e){var t=Nte(e);function i(s,o){var r=t((s=xC(s)).r,(o=xC(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=Yn(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function lV(n){return function(e){var t=e.length,i=new Array(t),s=new Array(t),o=new Array(t),r,a;for(r=0;rt&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:Wr(i,s)})),t=hk.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(s(u)+"rotate(",null,i)-2,x:Wr(c,d)})):d&&u.push(s(u)+"rotate("+d+i)}function a(c,d,u,h){c!==d?h.push({i:u.push(s(u)+"skewX(",null,i)-2,x:Wr(c,d)}):d&&u.push(s(u)+"skewX("+d+i)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Wr(c,u)},{i:p-2,x:Wr(d,h)})}else(u!==1||h!==1)&&f.push(s(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,u,h),r(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,_;++ge&&(t=n,n=e,e=t),function(i){return Math.max(n,Math.min(e,i))}}function oie(n,e,t){var i=n[0],s=n[1],o=e[0],r=e[1];return s2?rie:oie,l=c=null,u}function u(h){return h==null||isNaN(h=+h)?o:(l||(l=a(n.map(i),e,t)))(i(r(h)))}return u.invert=function(h){return r(s((c||(c=a(e,n.map(i),Wr)))(h)))},u.domain=function(h){return arguments.length?(n=Array.from(h,NE),d()):n.slice()},u.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},u.rangeRound=function(h){return e=Array.from(h),t=Gv,d()},u.clamp=function(h){return arguments.length?(r=h?!0:mo,d()):r!==mo},u.interpolate=function(h){return arguments.length?(t=h,d()):t},u.unknown=function(h){return arguments.length?(o=h,u):o},function(h,f){return i=h,s=f,d()}}function vV(){return jx()(mo,mo)}function wV(n,e,t,i){var s=Uh(n,e,t),o;switch(i=Ed(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(n),Math.abs(e));return i.precision==null&&!isNaN(o=mW(s,r))&&(i.precision=o),TM(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=_W(s,Math.max(Math.abs(n),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=pW(s))&&(i.precision=o-(i.type==="%")*2);break}}return cs(i)}function vf(n){var e=n.domain;return n.ticks=function(t){var i=e();return _C(i[0],i[i.length-1],t??10)},n.tickFormat=function(t,i){var s=e();return wV(s[0],s[s.length-1],t??10,i)},n.nice=function(t){t==null&&(t=10);var i=e(),s=0,o=i.length-1,r=i[s],a=i[o],l,c,d=10;for(a0;){if(c=hW(r,a,t),c===l)return i[s]=r,i[o]=a,e(i);if(c>0)r=Math.floor(r/c)*c,a=Math.ceil(a/c)*c;else if(c<0)r=Math.ceil(r*c)/c,a=Math.floor(a*c)/c;else break;l=c}return n},n}function yV(){var n=vV();return n.copy=function(){return Kv(n,yV())},il.apply(n,arguments),vf(n)}function CV(n){var e;function t(i){return i==null||isNaN(i=+i)?e:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=Array.from(i,NE),t):n.slice()},t.unknown=function(i){return arguments.length?(e=i,t):e},t.copy=function(){return CV(n).unknown(e)},n=arguments.length?Array.from(n,NE):[0,1],vf(t)}function SV(n,e){n=n.slice();var t=0,i=n.length-1,s=n[t],o=n[i],r;return oMath.pow(n,e)}function uie(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),e=>Math.log(e)/n)}function Q5(n){return(e,t)=>-n(-e,t)}function tR(n){const e=n(Z5,X5),t=e.domain;let i=10,s,o;function r(){return s=uie(i),o=die(i),t()[0]<0?(s=Q5(s),o=Q5(o),n(aie,lie)):n(Z5,X5),e}return e.base=function(a){return arguments.length?(i=+a,r()):i},e.domain=function(a){return arguments.length?(t(a),r()):t()},e.ticks=a=>{const l=t();let c=l[0],d=l[l.length-1];const u=d0){for(;h<=f;++h)for(g=1;gd)break;v.push(p)}}else for(;h<=f;++h)for(g=i-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(pd)break;v.push(p)}v.length*2<_&&(v=_C(c,d,_))}else v=_C(h,f,Math.min(f-h,_)).map(o);return u?v.reverse():v},e.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Ed(l)).precision==null&&(l.trim=!0),l=cs(l)),a===1/0)return l;const c=Math.max(1,i*a/e.ticks().length);return d=>{let u=d/o(Math.round(s(d)));return u*it(SV(t(),{floor:a=>o(Math.floor(s(a))),ceil:a=>o(Math.ceil(s(a)))})),e}function iR(){const n=tR(jx()).domain([1,10]);return n.copy=()=>Kv(n,iR()).base(n.base()),il.apply(n,arguments),n}function J5(n){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/n))}}function eO(n){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*n}}function nR(n){var e=1,t=n(J5(e),eO(e));return t.constant=function(i){return arguments.length?n(J5(e=+i),eO(e)):e},vf(t)}function xV(){var n=nR(jx());return n.copy=function(){return Kv(n,xV()).constant(n.constant())},il.apply(n,arguments)}function tO(n){return function(e){return e<0?-Math.pow(-e,n):Math.pow(e,n)}}function hie(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function fie(n){return n<0?-n*n:n*n}function sR(n){var e=n(mo,mo),t=1;function i(){return t===1?n(mo,mo):t===.5?n(hie,fie):n(tO(t),tO(1/t))}return e.exponent=function(s){return arguments.length?(t=+s,i()):t},vf(e)}function oR(){var n=sR(jx());return n.copy=function(){return Kv(n,oR()).exponent(n.exponent())},il.apply(n,arguments),n}function gie(){return oR.apply(null,arguments).exponent(.5)}function LV(){var n=[],e=[],t=[],i;function s(){var r=0,a=Math.max(1,e.length);for(t=new Array(a-1);++r0?t[a-1]:n[0],a=t?[i[t-1],e]:[i[c-1],i[c]]},r.unknown=function(l){return arguments.length&&(o=l),r},r.thresholds=function(){return i.slice()},r.copy=function(){return DV().domain([n,e]).range(s).unknown(o)},il.apply(vf(r),arguments)}function kV(){var n=[.5],e=[0,1],t,i=1;function s(o){return o!=null&&o<=o?e[Dd(n,o,0,i)]:t}return s.domain=function(o){return arguments.length?(n=Array.from(o),i=Math.min(n.length,e.length-1),s):n.slice()},s.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(n.length,e.length-1),s):e.slice()},s.invertExtent=function(o){var r=e.indexOf(o);return[n[r-1],n[r]]},s.unknown=function(o){return arguments.length?(t=o,s):t},s.copy=function(){return kV().domain(n).range(e).unknown(t)},il.apply(s,arguments)}function pie(n){return new Date(n)}function mie(n){return n instanceof Date?+n:+new Date(+n)}function rR(n,e,t,i,s,o,r,a,l,c){var d=vV(),u=d.invert,h=d.domain,f=c(".%L"),g=c(":%S"),p=c("%I:%M"),_=c("%I %p"),v=c("%a %d"),b=c("%b %d"),w=c("%B"),y=c("%Y");function S(L){return(l(L)0?i:1:0}const yie="identity",Bp="linear",Nd="log",Yv="pow",Zv="sqrt",Kx="symlog",MV="time",RV="utc",Va="sequential",xm="diverging",RE="quantile",PV="quantize",OV="threshold",uR="ordinal",PE="point",FV="band",hR="bin-ordinal",Wn="continuous",Xv="discrete",Qv="discretizing",wr="interpolating",BV="temporal";function Cie(n){return function(e){let t=e[0],i=e[1],s;return i=i&&t[l]<=s&&(o<0&&(o=l),r=l);if(!(o<0))return i=n.invertExtent(t[o]),s=n.invertExtent(t[r]),[i[0]===void 0?i[1]:i[0],s[1]===void 0?s[0]:s[1]]}}function fR(){const n=YM().unknown(void 0),e=n.domain,t=n.range;let i=[0,1],s,o,r=!1,a=0,l=0,c=.5;delete n.unknown;function d(){const u=e().length,h=i[1]p+s*v);return t(h?_.reverse():_)}return n.domain=function(u){return arguments.length?(e(u),d()):e()},n.range=function(u){return arguments.length?(i=[+u[0],+u[1]],d()):i.slice()},n.rangeRound=function(u){return i=[+u[0],+u[1]],r=!0,d()},n.bandwidth=function(){return o},n.step=function(){return s},n.round=function(u){return arguments.length?(r=!!u,d()):r},n.padding=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),a=l,d()):a},n.paddingInner=function(u){return arguments.length?(a=Math.max(0,Math.min(1,u)),d()):a},n.paddingOuter=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),d()):l},n.align=function(u){return arguments.length?(c=Math.max(0,Math.min(1,u)),d()):c},n.invertRange=function(u){if(u[0]==null||u[1]==null)return;const h=i[1]i[1-h])))return v=Math.max(0,Dd(f,p)-1),b=p===_?v:Dd(f,_)-1,p-f[v]>o+1e-10&&++v,h&&(w=v,v=g-b,b=g-w),v>b?void 0:e().slice(v,b+1)},n.invert=function(u){const h=n.invertRange([u,u]);return h&&h[0]},n.copy=function(){return fR().domain(e()).range(i).round(r).paddingInner(a).paddingOuter(l).align(c)},d()}function WV(n){const e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return WV(e())},n}function xie(){return WV(fR().paddingInner(1))}var Lie=Array.prototype.map;function Die(n){return Lie.call(n,W_)}const kie=Array.prototype.slice;function VV(){let n=[],e=[];function t(i){return i==null||i!==i?void 0:e[(Dd(n,i)-1)%e.length]}return t.domain=function(i){return arguments.length?(n=Die(i),t):n.slice()},t.range=function(i){return arguments.length?(e=kie.call(i),t):e.slice()},t.tickFormat=function(i,s){return wV(n[0],Yr(n),i??10,s)},t.copy=function(){return VV().domain(t.domain()).range(t.range())},t}const kC={};function Eie(n,e,t){const i=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?Cie(o):o.invertExtent?Sie(o):void 0),o.type=n,o};return i.metadata=mC(mE(t)),i}function Qt(n,e,t){return arguments.length>1?(kC[n]=Eie(n,e,t),this):Iie(n)?kC[n]:void 0}Qt(yie,CV);Qt(Bp,yV,Wn);Qt(Nd,iR,[Wn,Nd]);Qt(Yv,oR,Wn);Qt(Zv,gie,Wn);Qt(Kx,xV,Wn);Qt(MV,_ie,[Wn,BV]);Qt(RV,bie,[Wn,BV]);Qt(Va,aR,[Wn,wr]);Qt("".concat(Va,"-").concat(Bp),aR,[Wn,wr]);Qt("".concat(Va,"-").concat(Nd),EV,[Wn,wr,Nd]);Qt("".concat(Va,"-").concat(Yv),lR,[Wn,wr]);Qt("".concat(Va,"-").concat(Zv),vie,[Wn,wr]);Qt("".concat(Va,"-").concat(Kx),IV,[Wn,wr]);Qt("".concat(xm,"-").concat(Bp),AV,[Wn,wr]);Qt("".concat(xm,"-").concat(Nd),TV,[Wn,wr,Nd]);Qt("".concat(xm,"-").concat(Yv),cR,[Wn,wr]);Qt("".concat(xm,"-").concat(Zv),wie,[Wn,wr]);Qt("".concat(xm,"-").concat(Kx),NV,[Wn,wr]);Qt(RE,LV,[Qv,RE]);Qt(PV,DV,Qv);Qt(OV,kV,Qv);Qt(hR,VV,[Xv,Qv]);Qt(uR,YM,Xv);Qt(FV,fR,Xv);Qt(PE,xie,Xv);function Iie(n){return th(kC,n)}function Jv(n,e){const t=kC[n];return t&&t.metadata[e]}function rs(n){return Jv(n,Wn)}function Ua(n){return Jv(n,Xv)}function Vu(n){return Jv(n,Qv)}function HV(n){return Jv(n,Nd)}function Yx(n){return Jv(n,wr)}function Aie(n,e){const t=e[0],i=Yr(e)-t;return function(s){return n(t+s*i)}}function Zx(n,e,t){return eR(zV(e||"rgb",t),n)}function Tie(n,e){const t=new Array(e),i=e+1;for(let s=0;se[0].toUpperCase()+e.slice(1)).join("")}const Mie={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Rie={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function $V(n){const e=n.length/6|0,t=new Array(e);for(let i=0;iZx($V(n)));function gR(n,e){return n=n&&n.toLowerCase(),arguments.length>1?(iO[n]=e,this):iO[n]}function Pie(){let n=0,e,t=0;const i=new Map,s=o=>(o===e||(t=i.get(o),t===void 0&&(t=n++,i.set(o,t)),e=o),t);return s.addAll=o=>{for(const r of o)s(r)},s.invert=o=>{for(const r of i.entries())if(r[1]==o)return r[0]},s.domain=()=>[...i.keys()],s}function Xx(){const n=e=>e;return n.invert=e=>e,n.copy=Xx,n.invertRange=()=>{},n.type="null",n}function Oie(n,e){const t={};e||(e=n.encoding);for(const[i,s]of Object.entries(e)){if(!s)continue;const o=((_o(s)&&s.resolutionChannel)??(Lh(i)&&i))||void 0,r=n.unitView.getScaleResolution(o);t[i]=Fie(e[i],r==null?void 0:r.getScale(),n.unitView.getAccessor(i),i)}return t}function Fie(n,e,t,i){let s;if(Zr(n)){const o=n.value;s=r=>o,s.constant=!0,s.constantValue=!0,s.accessor=void 0}else if(t)if(i=="text")s=o=>{},s.accessor=t,s.constant=t.constant;else{if(!e)if(!Lh(i))e=Xx();else throw new Error(`Missing scale! "${i}": ${JSON.stringify(n)}`);if(s=o=>e(t(o)),Ua(e.type)){const o=Pie();o.addAll(e.domain()),s.indexer=o}s.constant=t.constant,s.accessor=t,s.scale=e}else throw new Error(`Missing value or accessor (field, expr, datum) on channel "${i}": ${JSON.stringify(n)}`);return s.invert=e?o=>e.invert(o):o=>{throw new Error("No scale available, cannot invert: "+JSON.stringify(n))},s.channelDef=n,s.applyMetadata=o=>{for(const r in s)r in s&&(o[r]=s[r]);return o},s}function Zr(n){return n&&"value"in n}function wf(n){return n&&"field"in n}function e1(n){return n&&"datum"in n}function _o(n){return wf(n)||e1(n)||Qx(n)||jV(n)}function OE(n,e){const t=n.mark.encoding[e];if(_o(t))return t;throw new Error("Not a channel def with scale!")}function jV(n){return n&&"chrom"in n}function Qx(n){return n&&"expr"in n}const Lm=["x","y"],Bie=["x2","y2"],Wie=[...Lm,...Bie];function qV(n){return Lm.includes(n)}function ib(n){return Wie.includes(n)}const pR={x:"x2",y:"y2"},GV=Object.fromEntries(Object.entries(pR).map(n=>[n[1],n[0]]));function i_(n){return n in GV}function Vie(n){const e=pR[n];if(e)return e;throw new Error(`${n} has no secondary channel!`)}function Yh(n){return GV[n]??n}function xh(n){return["color","fill","stroke"].includes(Yh(n))}function Jx(n){return["shape","squeeze"].includes(n)}function Lh(n){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy","sample"].includes(n)}function Hie(n){switch(n){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function KV(n){if(!Jx(n))throw new Error("Not a discrete channel: "+n);const e=new Map(Hie(n).map((t,i)=>[t,i]));return t=>{const i=e.get(t);if(i!==void 0)return i;throw new Error(`Invalid value for "${n}" channel: ${t}`)}}function yi(n,e=n){if(/^[A-Za-z0-9_]+$/.test(n)){const t=new Function("datum",`return datum[${JSON.stringify(n)}]`);return Yd(t,[n],e)}else return Ex(n)}class zie{constructor(){this.accessorCreators=[],this.register(e=>{if(wf(e))try{const t=yi(e.field);return t.constant=!1,t.fields=QB(t),t}catch(t){throw new Error(`Invalid field definition: ${t.message}`)}}),this.register(e=>Qx(e)?$ie(e.expr):void 0),this.register(e=>{if(e1(e)){const i=CX(e.datum);return i.constant=!0,i.fields=[],i}})}register(e){this.accessorCreators.push(e)}createAccessor(e){for(const t of this.accessorCreators){const i=t(e);if(i)return i}}}function $ie(n){const t=Hx(n);return t.constant=t.fields.length==0,t}/* @license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved. +}`;function _ee(n,e){var t=n.getBoundingClientRect();return[e.clientX-t.left-n.clientLeft,e.clientY-t.top-n.clientTop]}function EE(n,e){return n.length==e.length&&n.every((t,i)=>n[i]===e[i])}function js(n){return Array.isArray(n)?n:typeof n<"u"?[n]:[]}function Yv(n){return n[n.length-1]}class bee{constructor(e){this.container=e,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(e){e!=this._visible&&(this.element.style.display=e?null:"none",this._visible=e)}get visible(){return this._visible}get enabled(){return Yv(this.enabledStack)??!0}pushEnabledState(e){this.enabledStack.push(e),e||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(e){this.mouseCoords=_ee(this.container,e);const t=performance.now();!this.visible&&!this._isPenalty()&&t-this._previousMove>500&&(this._penaltyUntil=t+70),this._lastCoords&&vee(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=t+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=t}updatePlacement(){const[t,i]=this.mouseCoords;let s=t+20;s>this.container.clientWidth-this.element.offsetWidth&&(s=t-20-this.element.offsetWidth),this.element.style.left=s+"px",this.element.style.top=Math.min(i+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(e){if(!e||!this.enabled||this._isPenalty()){this.visible&&(Rp("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}Rp(e,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(e,t){e!==this._previousTooltipDatum&&(this._previousTooltipDatum=e,t||(t=i=>Promise.resolve(zt` ${JSON.stringify(i)} `)),t(e).then(i=>this.setContent(i)).catch(i=>{if(i!=="debounced")throw i}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function vee(n,e){let t=0;for(let i=0;i";tl[qh]="Identifier";tl[tu]="Keyword";tl[jx]="Null";tl[bf]="Numeric";tl[uo]="Punctuator";tl[Xv]="String";tl[Mee]="RegularExpression";var Ree="ArrayExpression",Pee="BinaryExpression",Oee="CallExpression",Fee="ConditionalExpression",XW="Identifier",Bee="Literal",Wee="LogicalExpression",Vee="MemberExpression",Hee="ObjectExpression",zee="Property",$ee="UnaryExpression",Gn="Unexpected token %0",Uee="Unexpected number",jee="Unexpected string",qee="Unexpected identifier",Gee="Unexpected reserved word",Kee="Unexpected end of input",IE="Invalid regular expression",hk="Invalid regular expression: missing /",QW="Octal literals are not allowed in strict mode.",Yee="Duplicate data property in object literal not allowed in strict mode",os="ILLEGAL",Q_="Disabled.",Zee=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Xee=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function qx(n,e){if(!n)throw new Error("ASSERT: "+e)}function yl(n){return n>=48&&n<=57}function iR(n){return"0123456789abcdefABCDEF".indexOf(n)>=0}function n_(n){return"01234567".indexOf(n)>=0}function Qee(n){return n===32||n===9||n===11||n===12||n===160||n>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(n)>=0}function J_(n){return n===10||n===13||n===8232||n===8233}function Qv(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n===92||n>=128&&Zee.test(String.fromCharCode(n))}function IC(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===92||n>=128&&Xee.test(String.fromCharCode(n))}const Jee={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function JW(){for(;te1114111||n!=="}")&&jt({},Gn,os),e<=65535?String.fromCharCode(e):(t=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(t,i))}function eV(){var n,e;for(n=Oe.charCodeAt(te++),e=String.fromCharCode(n),n===92&&(Oe.charCodeAt(te)!==117&&jt({},Gn,os),++te,n=AE("u"),(!n||n==="\\"||!Qv(n.charCodeAt(0)))&&jt({},Gn,os),e=n);te>>=")return te+=4,{type:uo,value:r,start:n,end:te};if(o=r.substr(0,3),o===">>>"||o==="<<="||o===">>=")return te+=3,{type:uo,value:o,start:n,end:te};if(s=o.substr(0,2),i===s[1]&&"+-<>&|".indexOf(i)>=0||s==="=>")return te+=2,{type:uo,value:s,start:n,end:te};if(s==="//"&&jt({},Gn,os),"<>=!+-*%&|^/".indexOf(i)>=0)return++te,{type:uo,value:i,start:n,end:te};jt({},Gn,os)}function nte(n){let e="";for(;te=0&&te=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,s)=>{if(parseInt(s,16)<=1114111)return"x";jt({},IE)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(t)}catch{jt({},IE)}try{return new RegExp(n,e)}catch{return null}}function ate(){var n,e,t,i,s;for(n=Oe[te],qx(n==="/","Regular expression literal must start with a slash"),e=Oe[te++],t=!1,i=!1;te=0&&jt({},IE,t),{value:t,literal:e}}function cte(){var n,e,t,i;return ri=null,JW(),n=te,e=ate(),t=lte(),i=rte(e.value,t.value),{literal:e.literal+t.literal,value:i,regex:{pattern:e.value,flags:t.value},start:n,end:te}}function dte(n){return n.type===qh||n.type===tu||n.type===Ux||n.type===jx}function tV(){if(JW(),te>=As)return{type:Zv,start:te,end:te};const n=Oe.charCodeAt(te);return Qv(n)?ite():n===40||n===41||n===59?fk():n===39||n===34?ote():n===46?yl(Oe.charCodeAt(te+1))?V5():fk():yl(n)?V5():fk()}function fo(){const n=ri;return te=n.end,ri=tV(),te=n.end,n}function iV(){const n=te;ri=tV(),te=n}function ute(n){const e=new oa(Ree);return e.elements=n,e}function H5(n,e,t){const i=new oa(n==="||"||n==="&&"?Wee:Pee);return i.operator=n,i.left=e,i.right=t,i}function hte(n,e){const t=new oa(Oee);return t.callee=n,t.arguments=e,t}function fte(n,e,t){const i=new oa(Fee);return i.test=n,i.consequent=e,i.alternate=t,i}function nR(n){const e=new oa(XW);return e.name=n,e}function E0(n){const e=new oa(Bee);return e.value=n.value,e.raw=Oe.slice(n.start,n.end),n.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=n.regex),e}function z5(n,e,t){const i=new oa(Vee);return i.computed=n==="[",i.object=e,i.property=t,i.computed||(t.member=!0),i}function gte(n){const e=new oa(Hee);return e.properties=n,e}function $5(n,e,t){const i=new oa(zee);return i.key=e,i.value=t,i.kind=n,i}function pte(n,e){const t=new oa($ee);return t.operator=n,t.argument=e,t.prefix=!0,t}function jt(n,e){var t,i=Array.prototype.slice.call(arguments,2),s=e.replace(/%(\d)/g,(o,r)=>(qx(r":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function kte(){var n,e,t,i,s,o,r,a,l,c;if(n=ri,l=Ay(),i=ri,s=q5(i),s===0)return l;for(i.prec=s,fo(),e=[n,ri],r=Ay(),o=[l,i,r];(s=q5(ri))>0;){for(;o.length>2&&s<=o[o.length-2].prec;)r=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),t=H5(a,l,r),o.push(t);i=fo(),i.prec=s,o.push(i),e.push(ri),t=Ay(),o.push(t)}for(c=o.length-1,t=o[c],e.pop();c>1;)e.pop(),t=H5(o[c-1].value,o[c-2],t),c-=2;return t}function Gh(){var n,e,t;return n=kte(),Mi("?")&&(fo(),e=Gh(),Ts(":"),t=Gh(),n=fte(n,e,t)),n}function sR(){const n=Gh();if(Mi(","))throw new Error(Q_);return n}function Ete(n){Oe=n,te=0,As=Oe.length,ri=null,iV();const e=sR();if(ri.type!==Zv)throw new Error("Unexpect token after expression.");return e}var Ite={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function nV(n){function e(r,a,l,c){let d=n(a[0]);return l&&(d=l+"("+d+")",l.lastIndexOf("new ",0)===0&&(d="("+d+")")),d+"."+r+(c<0?"":c===0?"()":"("+a.slice(1).map(n).join(",")+")")}function t(r,a,l){return c=>e(r,c,a,l)}const i="new Date",s="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(r){r.length<3&&qi("Missing arguments to clamp function."),r.length>3&&qi("Too many arguments to clamp function.");const a=r.map(n);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:t("getDate",i,0),day:t("getDay",i,0),year:t("getFullYear",i,0),month:t("getMonth",i,0),hours:t("getHours",i,0),minutes:t("getMinutes",i,0),seconds:t("getSeconds",i,0),milliseconds:t("getMilliseconds",i,0),time:t("getTime",i,0),timezoneoffset:t("getTimezoneOffset",i,0),utcdate:t("getUTCDate",i,0),utcday:t("getUTCDay",i,0),utcyear:t("getUTCFullYear",i,0),utcmonth:t("getUTCMonth",i,0),utchours:t("getUTCHours",i,0),utcminutes:t("getUTCMinutes",i,0),utcseconds:t("getUTCSeconds",i,0),utcmilliseconds:t("getUTCMilliseconds",i,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",s,0),lower:t("toLowerCase",s,0),substring:t("substring",s),split:t("split",s),trim:t("trim",s,0),regexp:o,test:t("test",o),if:function(r){r.length<3&&qi("Missing arguments to if function."),r.length>3&&qi("Too many arguments to if function.");const a=r.map(n);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Ate(n){const e=n&&n.length-1;return e&&(n[0]==='"'&&n[e]==='"'||n[0]==="'"&&n[e]==="'")?n.slice(1,-1):n}function Tte(n){n=n||{};const e=n.allowed?SC(n.allowed):{},t=n.forbidden?SC(n.forbidden):{},i=n.constants||Ite,s=(n.functions||nV)(u),o=n.globalvar,r=n.fieldvar,a=yo(o)?o:g=>`${o}["${g}"]`;let l={},c={},d=0;function u(g){if(Ei(g))return g;const p=h[g.type];return p==null&&qi("Unsupported type: "+g.type),p(g)}const h={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return d>0?p:rh(t,p)?qi("Illegal identifier: "+p):rh(i,p)?i[p]:rh(e,p)?p:(l[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,_=u(g.object);p&&(d+=1);const v=u(g.property);return _===r&&(c[Ate(v)]=1),p&&(d-=1),_+(p?"."+v:"["+v+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&qi("Illegal callee type: "+g.callee.type);const p=g.callee.name,_=g.arguments,v=rh(s,p)&&s[p];return v||qi("Unrecognized function: "+p),yo(v)?v(_):v+"("+_.map(u).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(u).join(",")+"]",BinaryExpression:g=>"("+u(g.left)+" "+g.operator+" "+u(g.right)+")",UnaryExpression:g=>"("+g.operator+u(g.argument)+")",ConditionalExpression:g=>"("+u(g.test)+"?"+u(g.consequent)+":"+u(g.alternate)+")",LogicalExpression:g=>"("+u(g.left)+g.operator+u(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(u).join(",")+"}",Property:g=>{d+=1;const p=u(g.key);return d-=1,p+":"+u(g.value)}};function f(g){const p={code:u(g),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},p}return f.functions=s,f.constants=i,f}function sV(n,e,t){return t=(t-n)/(e-n),t=Math.max(0,Math.min(1,t)),t*t*(3-2*t)}function eb(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function Nte(n,e,t){return eb((t-n)/(e-n),0,1)}const oV={clamp:eb,isArray:Zs,isBoolean:qv,isDefined(n){return n!==void 0},isNumber:Xs,isObject:xo,isRegExp:$X,isString:Ei,isValid(n){return n!=null&&n===n},lerp:bW,linearstep:Nte,smoothstep:sV};function Mte(n){const e=nV(n);for(const t in oV)e[t]=`this.${t}`;return e}const Rte=Tte({forbidden:[],allowed:["datum"],globalvar:"globalObject",fieldvar:"datum",functions:Mte});function Kx(n,e={}){try{const t=Ete(n),i=Rte(t),s=Function("datum","globalObject",`"use strict"; return (${i.code});`).bind(oV),o=r=>s(r,e);return o.fields=i.fields,o.globals=i.globals,o.code=i.code,o}catch(t){throw new Error(`Invalid expression: ${n}, ${t.message}`)}}function il(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}function iu(n,e){switch(arguments.length){case 0:break;case 1:{typeof n=="function"?this.interpolator(n):this.range(n);break}default:{this.domain(n),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const TE=Symbol("implicit");function oR(){var n=new Ad,e=[],t=[],i=TE;function s(o){let r=n.get(o);if(r===void 0){if(i!==TE)return i;n.set(o,r=e.push(o)-1)}return t[r%t.length]}return s.domain=function(o){if(!arguments.length)return e.slice();e=[],n=new Ad;for(const r of o)n.has(r)||n.set(r,e.push(r)-1);return s},s.range=function(o){return arguments.length?(t=Array.from(o),s):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.copy=function(){return oR(e,t).unknown(i)},il.apply(s,arguments),s}function Lm(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Jv(n,e){var t=Object.create(n.prototype);for(var i in e)t[i]=e[i];return t}function nu(){}var Kh=.7,Wp=1/Kh,Gg="\\s*([+-]?\\d+)\\s*",tb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ba="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pte=/^#([0-9a-f]{3,8})$/,Ote=new RegExp(`^rgb\\(${Gg},${Gg},${Gg}\\)$`),Fte=new RegExp(`^rgb\\(${Ba},${Ba},${Ba}\\)$`),Bte=new RegExp(`^rgba\\(${Gg},${Gg},${Gg},${tb}\\)$`),Wte=new RegExp(`^rgba\\(${Ba},${Ba},${Ba},${tb}\\)$`),Vte=new RegExp(`^hsl\\(${tb},${Ba},${Ba}\\)$`),Hte=new RegExp(`^hsla\\(${tb},${Ba},${Ba},${tb}\\)$`),G5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Lm(nu,Pd,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:K5,formatHex:K5,formatHex8:zte,formatHsl:$te,formatRgb:Y5,toString:Y5});function K5(){return this.rgb().formatHex()}function zte(){return this.rgb().formatHex8()}function $te(){return rV(this).formatHsl()}function Y5(){return this.rgb().formatRgb()}function Pd(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Pte.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?Z5(e):t===3?new Kn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?aw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?aw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ote.exec(n))?new Kn(e[1],e[2],e[3],1):(e=Fte.exec(n))?new Kn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Bte.exec(n))?aw(e[1],e[2],e[3],e[4]):(e=Wte.exec(n))?aw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Vte.exec(n))?J5(e[1],e[2]/100,e[3]/100,1):(e=Hte.exec(n))?J5(e[1],e[2]/100,e[3]/100,e[4]):G5.hasOwnProperty(n)?Z5(G5[n]):n==="transparent"?new Kn(NaN,NaN,NaN,0):null}function Z5(n){return new Kn(n>>16&255,n>>8&255,n&255,1)}function aw(n,e,t,i){return i<=0&&(n=e=t=NaN),new Kn(n,e,t,i)}function rR(n){return n instanceof nu||(n=Pd(n)),n?(n=n.rgb(),new Kn(n.r,n.g,n.b,n.opacity)):new Kn}function AC(n,e,t,i){return arguments.length===1?rR(n):new Kn(n,e,t,i??1)}function Kn(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}Lm(Kn,AC,Jv(nu,{brighter(n){return n=n==null?Wp:Math.pow(Wp,n),new Kn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Kh:Math.pow(Kh,n),new Kn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Kn(Lh(this.r),Lh(this.g),Lh(this.b),TC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:X5,formatHex:X5,formatHex8:Ute,formatRgb:Q5,toString:Q5}));function X5(){return`#${ah(this.r)}${ah(this.g)}${ah(this.b)}`}function Ute(){return`#${ah(this.r)}${ah(this.g)}${ah(this.b)}${ah((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q5(){const n=TC(this.opacity);return`${n===1?"rgb(":"rgba("}${Lh(this.r)}, ${Lh(this.g)}, ${Lh(this.b)}${n===1?")":`, ${n})`}`}function TC(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Lh(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ah(n){return n=Lh(n),(n<16?"0":"")+n.toString(16)}function J5(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Ur(n,e,t,i)}function rV(n){if(n instanceof Ur)return new Ur(n.h,n.s,n.l,n.opacity);if(n instanceof nu||(n=Pd(n)),!n)return new Ur;if(n instanceof Ur)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Ur(r,a,l,n.opacity)}function NE(n,e,t,i){return arguments.length===1?rV(n):new Ur(n,e,t,i??1)}function Ur(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}Lm(Ur,NE,Jv(nu,{brighter(n){return n=n==null?Wp:Math.pow(Wp,n),new Ur(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Kh:Math.pow(Kh,n),new Ur(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Kn(pk(n>=240?n-240:n+120,s,i),pk(n,s,i),pk(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Ur(eO(this.h),lw(this.s),lw(this.l),TC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=TC(this.opacity);return`${n===1?"hsl(":"hsla("}${eO(this.h)}, ${lw(this.s)*100}%, ${lw(this.l)*100}%${n===1?")":`, ${n})`}`}}));function eO(n){return n=(n||0)%360,n<0?n+360:n}function lw(n){return Math.max(0,Math.min(1,n||0))}function pk(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const aV=Math.PI/180,lV=180/Math.PI,NC=18,cV=.96422,dV=1,uV=.82521,hV=4/29,Kg=6/29,fV=3*Kg*Kg,jte=Kg*Kg*Kg;function gV(n){if(n instanceof Wa)return new Wa(n.l,n.a,n.b,n.opacity);if(n instanceof Hl)return pV(n);n instanceof Kn||(n=rR(n));var e=vk(n.r),t=vk(n.g),i=vk(n.b),s=mk((.2225045*e+.7168786*t+.0606169*i)/dV),o,r;return e===t&&t===i?o=r=s:(o=mk((.4360747*e+.3850649*t+.1430804*i)/cV),r=mk((.0139322*e+.0971045*t+.7141733*i)/uV)),new Wa(116*s-16,500*(o-s),200*(s-r),n.opacity)}function ME(n,e,t,i){return arguments.length===1?gV(n):new Wa(n,e,t,i??1)}function Wa(n,e,t,i){this.l=+n,this.a=+e,this.b=+t,this.opacity=+i}Lm(Wa,ME,Jv(nu,{brighter(n){return new Wa(this.l+NC*(n??1),this.a,this.b,this.opacity)},darker(n){return new Wa(this.l-NC*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,e=isNaN(this.a)?n:n+this.a/500,t=isNaN(this.b)?n:n-this.b/200;return e=cV*_k(e),n=dV*_k(n),t=uV*_k(t),new Kn(bk(3.1338561*e-1.6168667*n-.4906146*t),bk(-.9787684*e+1.9161415*n+.033454*t),bk(.0719453*e-.2289914*n+1.4052427*t),this.opacity)}}));function mk(n){return n>jte?Math.pow(n,1/3):n/fV+hV}function _k(n){return n>Kg?n*n*n:fV*(n-hV)}function bk(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function vk(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function qte(n){if(n instanceof Hl)return new Hl(n.h,n.c,n.l,n.opacity);if(n instanceof Wa||(n=gV(n)),n.a===0&&n.b===0)return new Hl(NaN,0=1?(t=1,e-1):Math.floor(t*e),s=n[i],o=n[i+1],r=i>0?n[i-1]:2*s-o,a=i()=>n;function wV(n,e){return function(t){return n+t*e}}function Kte(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function Xx(n,e){var t=e-n;return t?wV(n,t>180||t<-180?t-360*Math.round(t/360):t):Zx(isNaN(n)?e:n)}function Yte(n){return(n=+n)==1?Yn:function(e,t){return t-e?Kte(e,t,n):Zx(isNaN(e)?t:e)}}function Yn(n,e){var t=e-n;return t?wV(n,t):Zx(isNaN(n)?e:n)}const OE=function n(e){var t=Yte(e);function i(s,o){var r=t((s=AC(s)).r,(o=AC(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=Yn(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function yV(n){return function(e){var t=e.length,i=new Array(t),s=new Array(t),o=new Array(t),r,a;for(r=0;rt&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:Hr(i,s)})),t=wk.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(s(u)+"rotate(",null,i)-2,x:Hr(c,d)})):d&&u.push(s(u)+"rotate("+d+i)}function a(c,d,u,h){c!==d?h.push({i:u.push(s(u)+"skewX(",null,i)-2,x:Hr(c,d)}):d&&u.push(s(u)+"skewX("+d+i)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Hr(c,u)},{i:p-2,x:Hr(d,h)})}else(u!==1||h!==1)&&f.push(s(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,u,h),r(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,_;++ge&&(t=n,n=e,e=t),function(i){return Math.max(n,Math.min(e,i))}}function Cie(n,e,t){var i=n[0],s=n[1],o=e[0],r=e[1];return s2?Sie:Cie,l=c=null,u}function u(h){return h==null||isNaN(h=+h)?o:(l||(l=a(n.map(i),e,t)))(i(r(h)))}return u.invert=function(h){return r(s((c||(c=a(e,n.map(i),Hr)))(h)))},u.domain=function(h){return arguments.length?(n=Array.from(h,WE),d()):n.slice()},u.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},u.rangeRound=function(h){return e=Array.from(h),t=e1,d()},u.clamp=function(h){return arguments.length?(r=h?!0:mo,d()):r!==mo},u.interpolate=function(h){return arguments.length?(t=h,d()):t},u.unknown=function(h){return arguments.length?(o=h,u):o},function(h,f){return i=h,s=f,d()}}function NV(){return Qx()(mo,mo)}function MV(n,e,t,i){var s=Td(n,e,t),o;switch(i=Nd(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(n),Math.abs(e));return i.precision==null&&!isNaN(o=IW(s,r))&&(i.precision=o),HM(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=AW(s,Math.max(Math.abs(n),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=EW(s))&&(i.precision=o-(i.type==="%")*2);break}}return ls(i)}function vf(n){var e=n.domain;return n.ticks=function(t){var i=e();return xC(i[0],i[i.length-1],t??10)},n.tickFormat=function(t,i){var s=e();return MV(s[0],s[s.length-1],t??10,i)},n.nice=function(t){t==null&&(t=10);var i=e(),s=0,o=i.length-1,r=i[s],a=i[o],l,c,d=10;for(a0;){if(c=LW(r,a,t),c===l)return i[s]=r,i[o]=a,e(i);if(c>0)r=Math.floor(r/c)*c,a=Math.ceil(a/c)*c;else if(c<0)r=Math.ceil(r*c)/c,a=Math.floor(a*c)/c;else break;l=c}return n},n}function RV(){var n=NV();return n.copy=function(){return t1(n,RV())},il.apply(n,arguments),vf(n)}function PV(n){var e;function t(i){return i==null||isNaN(i=+i)?e:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=Array.from(i,WE),t):n.slice()},t.unknown=function(i){return arguments.length?(e=i,t):e},t.copy=function(){return PV(n).unknown(e)},n=arguments.length?Array.from(n,WE):[0,1],vf(t)}function OV(n,e){n=n.slice();var t=0,i=n.length-1,s=n[t],o=n[i],r;return oMath.pow(n,e)}function Eie(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),e=>Math.log(e)/n)}function cO(n){return(e,t)=>-n(-e,t)}function uR(n){const e=n(aO,lO),t=e.domain;let i=10,s,o;function r(){return s=Eie(i),o=kie(i),t()[0]<0?(s=cO(s),o=cO(o),n(xie,Lie)):n(aO,lO),e}return e.base=function(a){return arguments.length?(i=+a,r()):i},e.domain=function(a){return arguments.length?(t(a),r()):t()},e.ticks=a=>{const l=t();let c=l[0],d=l[l.length-1];const u=d0){for(;h<=f;++h)for(g=1;gd)break;v.push(p)}}else for(;h<=f;++h)for(g=i-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(pd)break;v.push(p)}v.length*2<_&&(v=xC(c,d,_))}else v=xC(h,f,Math.min(f-h,_)).map(o);return u?v.reverse():v},e.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Nd(l)).precision==null&&(l.trim=!0),l=ls(l)),a===1/0)return l;const c=Math.max(1,i*a/e.ticks().length);return d=>{let u=d/o(Math.round(s(d)));return u*it(OV(t(),{floor:a=>o(Math.floor(s(a))),ceil:a=>o(Math.ceil(s(a)))})),e}function hR(){const n=uR(Qx()).domain([1,10]);return n.copy=()=>t1(n,hR()).base(n.base()),il.apply(n,arguments),n}function dO(n){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/n))}}function uO(n){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*n}}function fR(n){var e=1,t=n(dO(e),uO(e));return t.constant=function(i){return arguments.length?n(dO(e=+i),uO(e)):e},vf(t)}function FV(){var n=fR(Qx());return n.copy=function(){return t1(n,FV()).constant(n.constant())},il.apply(n,arguments)}function hO(n){return function(e){return e<0?-Math.pow(-e,n):Math.pow(e,n)}}function Iie(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function Aie(n){return n<0?-n*n:n*n}function gR(n){var e=n(mo,mo),t=1;function i(){return t===1?n(mo,mo):t===.5?n(Iie,Aie):n(hO(t),hO(1/t))}return e.exponent=function(s){return arguments.length?(t=+s,i()):t},vf(e)}function pR(){var n=gR(Qx());return n.copy=function(){return t1(n,pR()).exponent(n.exponent())},il.apply(n,arguments),n}function Tie(){return pR.apply(null,arguments).exponent(.5)}function BV(){var n=[],e=[],t=[],i;function s(){var r=0,a=Math.max(1,e.length);for(t=new Array(a-1);++r0?t[a-1]:n[0],a=t?[i[t-1],e]:[i[c-1],i[c]]},r.unknown=function(l){return arguments.length&&(o=l),r},r.thresholds=function(){return i.slice()},r.copy=function(){return WV().domain([n,e]).range(s).unknown(o)},il.apply(vf(r),arguments)}function VV(){var n=[.5],e=[0,1],t,i=1;function s(o){return o!=null&&o<=o?e[Id(n,o,0,i)]:t}return s.domain=function(o){return arguments.length?(n=Array.from(o),i=Math.min(n.length,e.length-1),s):n.slice()},s.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(n.length,e.length-1),s):e.slice()},s.invertExtent=function(o){var r=e.indexOf(o);return[n[r-1],n[r]]},s.unknown=function(o){return arguments.length?(t=o,s):t},s.copy=function(){return VV().domain(n).range(e).unknown(t)},il.apply(s,arguments)}function Nie(n){return new Date(n)}function Mie(n){return n instanceof Date?+n:+new Date(+n)}function mR(n,e,t,i,s,o,r,a,l,c){var d=NV(),u=d.invert,h=d.domain,f=c(".%L"),g=c(":%S"),p=c("%I:%M"),_=c("%I %p"),v=c("%a %d"),b=c("%b %d"),w=c("%B"),y=c("%Y");function S(L){return(l(L)0?i:1:0}const Bie="identity",Vp="linear",Od="log",i1="pow",n1="sqrt",tL="symlog",qV="time",GV="utc",Va="sequential",Dm="diverging",HE="quantile",KV="quantize",YV="threshold",yR="ordinal",zE="point",ZV="band",CR="bin-ordinal",Wn="continuous",s1="discrete",o1="discretizing",yr="interpolating",XV="temporal";function Wie(n){return function(e){let t=e[0],i=e[1],s;return i=i&&t[l]<=s&&(o<0&&(o=l),r=l);if(!(o<0))return i=n.invertExtent(t[o]),s=n.invertExtent(t[r]),[i[0]===void 0?i[1]:i[0],s[1]===void 0?s[0]:s[1]]}}function SR(){const n=oR().unknown(void 0),e=n.domain,t=n.range;let i=[0,1],s,o,r=!1,a=0,l=0,c=.5;delete n.unknown;function d(){const u=e().length,h=i[1]p+s*v);return t(h?_.reverse():_)}return n.domain=function(u){return arguments.length?(e(u),d()):e()},n.range=function(u){return arguments.length?(i=[+u[0],+u[1]],d()):i.slice()},n.rangeRound=function(u){return i=[+u[0],+u[1]],r=!0,d()},n.bandwidth=function(){return o},n.step=function(){return s},n.round=function(u){return arguments.length?(r=!!u,d()):r},n.padding=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),a=l,d()):a},n.paddingInner=function(u){return arguments.length?(a=Math.max(0,Math.min(1,u)),d()):a},n.paddingOuter=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),d()):l},n.align=function(u){return arguments.length?(c=Math.max(0,Math.min(1,u)),d()):c},n.invertRange=function(u){if(u[0]==null||u[1]==null)return;const h=i[1]i[1-h])))return v=Math.max(0,Id(f,p)-1),b=p===_?v:Id(f,_)-1,p-f[v]>o+1e-10&&++v,h&&(w=v,v=g-b,b=g-w),v>b?void 0:e().slice(v,b+1)},n.invert=function(u){const h=n.invertRange([u,u]);return h&&h[0]},n.copy=function(){return SR().domain(e()).range(i).round(r).paddingInner(a).paddingOuter(l).align(c)},d()}function QV(n){const e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return QV(e())},n}function Hie(){return QV(SR().paddingInner(1))}var zie=Array.prototype.map;function $ie(n){return zie.call(n,V_)}const Uie=Array.prototype.slice;function JV(){let n=[],e=[];function t(i){return i==null||i!==i?void 0:e[(Id(n,i)-1)%e.length]}return t.domain=function(i){return arguments.length?(n=$ie(i),t):n.slice()},t.range=function(i){return arguments.length?(e=Uie.call(i),t):e.slice()},t.tickFormat=function(i,s){return MV(n[0],Xr(n),i??10,s)},t.copy=function(){return JV().domain(t.domain()).range(t.range())},t}const MC={};function jie(n,e,t){const i=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?Wie(o):o.invertExtent?Vie(o):void 0),o.type=n,o};return i.metadata=SC(CE(t)),i}function Jt(n,e,t){return arguments.length>1?(MC[n]=jie(n,e,t),this):qie(n)?MC[n]:void 0}Jt(Bie,PV);Jt(Vp,RV,Wn);Jt(Od,hR,[Wn,Od]);Jt(i1,pR,Wn);Jt(n1,Tie,Wn);Jt(tL,FV,Wn);Jt(qV,Rie,[Wn,XV]);Jt(GV,Pie,[Wn,XV]);Jt(Va,_R,[Wn,yr]);Jt("".concat(Va,"-").concat(Vp),_R,[Wn,yr]);Jt("".concat(Va,"-").concat(Od),HV,[Wn,yr,Od]);Jt("".concat(Va,"-").concat(i1),bR,[Wn,yr]);Jt("".concat(Va,"-").concat(n1),Oie,[Wn,yr]);Jt("".concat(Va,"-").concat(tL),zV,[Wn,yr]);Jt("".concat(Dm,"-").concat(Vp),$V,[Wn,yr]);Jt("".concat(Dm,"-").concat(Od),UV,[Wn,yr,Od]);Jt("".concat(Dm,"-").concat(i1),vR,[Wn,yr]);Jt("".concat(Dm,"-").concat(n1),Fie,[Wn,yr]);Jt("".concat(Dm,"-").concat(tL),jV,[Wn,yr]);Jt(HE,BV,[o1,HE]);Jt(KV,WV,o1);Jt(YV,VV,o1);Jt(CR,JV,[s1,o1]);Jt(yR,oR,s1);Jt(ZV,SR,s1);Jt(zE,Hie,s1);function qie(n){return rh(MC,n)}function r1(n,e){const t=MC[n];return t&&t.metadata[e]}function rs(n){return r1(n,Wn)}function Ua(n){return r1(n,s1)}function ju(n){return r1(n,o1)}function eH(n){return r1(n,Od)}function iL(n){return r1(n,yr)}function Gie(n,e){const t=e[0],i=Xr(e)-t;return function(s){return n(t+s*i)}}function nL(n,e,t){return dR(tH(e||"rgb",t),n)}function Kie(n,e){const t=new Array(e),i=e+1;for(let s=0;se[0].toUpperCase()+e.slice(1)).join("")}const Zie={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Xie={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function iH(n){const e=n.length/6|0,t=new Array(e);for(let i=0;inL(iH(n)));function xR(n,e){return n=n&&n.toLowerCase(),arguments.length>1?(fO[n]=e,this):fO[n]}function Qie(){let n=0,e,t=0;const i=new Map,s=o=>(o===e||(t=i.get(o),t===void 0&&(t=n++,i.set(o,t)),e=o),t);return s.addAll=o=>{for(const r of o)s(r)},s.invert=o=>{for(const r of i.entries())if(r[1]==o)return r[0]},s.domain=()=>[...i.keys()],s}function sL(){const n=e=>e;return n.invert=e=>e,n.copy=sL,n.invertRange=()=>{},n.type="null",n}/* @license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved. Available via the MIT license. -see: http://github.com/greggman/twgl.js for details */const mR=5120,nb=5121,_R=5122,bR=5123,vR=5124,wR=5125,yR=5126,Uie=32819,jie=32820,qie=33635,Gie=5131,Kie=33640,Yie=35899,Zie=35902,Xie=36269,Qie=34042,YV={};{const n=YV;n[mR]=Int8Array,n[nb]=Uint8Array,n[_R]=Int16Array,n[bR]=Uint16Array,n[vR]=Int32Array,n[wR]=Uint32Array,n[yR]=Float32Array,n[Uie]=Uint16Array,n[jie]=Uint16Array,n[qie]=Uint16Array,n[Gie]=Uint16Array,n[Kie]=Uint32Array,n[Yie]=Uint32Array,n[Zie]=Uint32Array,n[Xie]=Uint32Array,n[Qie]=Uint32Array}function CR(n){if(n instanceof Int8Array)return mR;if(n instanceof Uint8Array||n instanceof Uint8ClampedArray)return nb;if(n instanceof Int16Array)return _R;if(n instanceof Uint16Array)return bR;if(n instanceof Int32Array)return vR;if(n instanceof Uint32Array)return wR;if(n instanceof Float32Array)return yR;throw new Error("unsupported typed array type")}function Jie(n){if(n===Int8Array)return mR;if(n===Uint8Array||n===Uint8ClampedArray)return nb;if(n===Int16Array)return _R;if(n===Uint16Array)return bR;if(n===Int32Array)return vR;if(n===Uint32Array)return wR;if(n===Float32Array)return yR;throw new Error("unsupported typed array type")}function ene(n){const e=YV[n];if(!e)throw new Error("unknown gl type");return e}const EC=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function tne(...n){console.error(...n)}function ZV(...n){console.warn(...n)}function ine(n,e){return typeof WebGLBuffer<"u"&&e instanceof WebGLBuffer}function XV(n,e){return typeof WebGLRenderbuffer<"u"&&e instanceof WebGLRenderbuffer}function eL(n,e){return typeof WebGLTexture<"u"&&e instanceof WebGLTexture}function nne(n,e){return typeof WebGLSampler<"u"&&e instanceof WebGLSampler}const QV=35044,Ha=34962,sne=34963,one=34660,rne=5120,ane=5121,lne=5122,cne=5123,dne=5124,une=5125,hne=5126,JV={attribPrefix:""};function eH(n,e,t,i,s){n.bindBuffer(e,t),n.bufferData(e,i,s||QV)}function tH(n,e,t,i){if(ine(n,e))return e;t=t||Ha;const s=n.createBuffer();return eH(n,t,s,e,i),s}function iH(n){return n==="indices"}function fne(n){return n instanceof Int8Array||n instanceof Uint8Array}function gne(n){return n===Int8Array||n===Uint8Array}function pne(n){return n.length?n:n.data}const mne=/coord|texture/i,_ne=/color|colour/i;function nH(n,e){let t;if(mne.test(n)?t=2:_ne.test(n)?t=4:t=3,e%t>0)throw new Error(`Can not guess numComponents for attribute '${n}'. Tried ${t} but ${e} values is not evenly divisible by ${t}. You should specify it.`);return t}function bne(n,e){return n.numComponents||n.size||nH(e,pne(n).length)}function SR(n,e){if(EC(n))return n;if(EC(n.data))return n.data;Array.isArray(n)&&(n={data:n});let t=n.type;return t||(iH(e)?t=Uint16Array:t=Float32Array),new t(n.data)}function vne(n,e){const t={};return Object.keys(e).forEach(function(i){if(!iH(i)){const s=e[i],o=s.attrib||s.name||s.attribName||JV.attribPrefix+i;if(s.value){if(!Array.isArray(s.value)&&!EC(s.value))throw new Error("array.value is not array or typedarray");t[o]={value:s.value}}else{let r,a,l,c;if(s.buffer&&s.buffer instanceof WebGLBuffer)r=s.buffer,c=s.numComponents||s.size,a=s.type,l=s.normalize;else if(typeof s=="number"||typeof s.data=="number"){const d=s.data||s,u=s.type||Float32Array,h=d*u.BYTES_PER_ELEMENT;a=Jie(u),l=s.normalize!==void 0?s.normalize:gne(u),c=s.numComponents||s.size||nH(i,d),r=n.createBuffer(),n.bindBuffer(Ha,r),n.bufferData(Ha,h,s.drawType||QV)}else{const d=SR(s,i);r=tH(n,d,void 0,s.drawType),a=CR(d),l=s.normalize!==void 0?s.normalize:fne(d),c=bne(s,i)}t[o]={buffer:r,numComponents:c,type:a,normalize:l,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),n.bindBuffer(Ha,null),t}function wne(n,e,t,i){t=SR(t),i!==void 0?(n.bindBuffer(Ha,e.buffer),n.bufferSubData(Ha,i,t)):eH(n,Ha,e.buffer,t,e.drawType)}function yne(n,e){return e===rne||e===ane?1:e===lne||e===cne?2:e===dne||e===une||e===hne?4:0}const fk=["position","positions","a_position"];function Cne(n,e){let t,i;for(i=0;i{const w=v*b.ndx,y=t.subarray(w,w+v);n.texImage2D(b.face,l,c,o,r,0,u,h,y)})}else s===Md||s===Rd?n.texImage3D(s,l,c,o,r,a,0,u,h,t):n.texImage2D(s,l,c,o,r,0,u,h,t);return{width:o,height:r,depth:a,type:h}}function Jse(n,e,t){const i=t.target||ac;n.bindTexture(i,e);const s=t.level||0,o=t.internalFormat||t.format||Wi,r=km(o),a=t.format||r.format,l=t.type||r.type;if(Vp(n,t),i===nc)for(let c=0;c<6;++c)n.texImage2D(tL+c,s,o,t.width,t.height,0,a,l,null);else i===Md||i===Rd?n.texImage3D(i,s,o,t.width,t.height,t.depth,0,a,l,null):n.texImage2D(i,s,o,t.width,t.height,0,a,l,null)}function ob(n,e,t){t=t||t1,e=e||tu.textureOptions;const i=n.createTexture(),s=e.target||ac;let o=e.width||1,r=e.height||1;const a=e.internalFormat||Wi;n.bindTexture(s,i),s===nc&&(n.texParameteri(s,AC,IC),n.texParameteri(s,TC,IC));let l=e.src;if(l)if(typeof l=="function"&&(l=l(n,e)),typeof l=="string")Zse(n,i,e,t);else if(Wp(l)||Array.isArray(l)&&(typeof l[0]=="number"||Array.isArray(l[0])||Wp(l[0]))){const c=pH(n,i,l,e);o=c.width,r=c.height}else Array.isArray(l)&&(typeof l[0]=="string"||gH(l[0]))?s===nc?Xse(n,i,e,t):Qse(n,i,e,t):(fH(n,i,l,e),o=l.width,r=l.height);else Jse(n,i,e);return sb(e)&&VE(n,i,e,o,r,a),hH(n,i,e),i}function eoe(n,e,t,i,s,o){i=i||t.width,s=s||t.height,o=o||t.depth;const r=t.target||ac;n.bindTexture(r,e);const a=t.level||0,l=t.internalFormat||t.format||Wi,c=km(l),d=t.format||c.format;let u;const h=t.src;if(h&&(Wp(h)||Array.isArray(h)&&typeof h[0]=="number")?u=t.type||dH(n,h,c.type):u=t.type||c.type,r===nc)for(let f=0;f<6;++f)n.texImage2D(tL+f,a,l,i,s,0,d,u,null);else r===Md||r===Rd?n.texImage3D(r,a,l,i,s,o,0,d,u,null):n.texImage2D(r,a,l,i,s,0,d,u,null)}const toe=ZV,NC=33984,ioe=35048,nL=34962,noe=34963,kR=35345,mH=35718,soe=35721,ooe=35971,roe=35382,aoe=35396,loe=35398,coe=35392,doe=35395,sL=5126,_H=35664,bH=35665,vH=35666,ER=5124,wH=35667,yH=35668,CH=35669,SH=35670,xH=35671,LH=35672,DH=35673,kH=35674,EH=35675,IH=35676,uoe=35678,hoe=35680,foe=35679,goe=35682,poe=35685,moe=35686,_oe=35687,boe=35688,voe=35689,woe=35690,yoe=36289,Coe=36292,Soe=36293,IR=5125,AH=36294,TH=36295,NH=36296,xoe=36298,Loe=36299,Doe=36300,koe=36303,Eoe=36306,Ioe=36307,Aoe=36308,Toe=36311,oL=3553,rL=34067,AR=32879,aL=35866,vt={};function MH(n,e){return vt[e].bindPoint}function Noe(n,e){return function(t){n.uniform1f(e,t)}}function Moe(n,e){return function(t){n.uniform1fv(e,t)}}function Roe(n,e){return function(t){n.uniform2fv(e,t)}}function Poe(n,e){return function(t){n.uniform3fv(e,t)}}function Ooe(n,e){return function(t){n.uniform4fv(e,t)}}function RH(n,e){return function(t){n.uniform1i(e,t)}}function PH(n,e){return function(t){n.uniform1iv(e,t)}}function OH(n,e){return function(t){n.uniform2iv(e,t)}}function FH(n,e){return function(t){n.uniform3iv(e,t)}}function BH(n,e){return function(t){n.uniform4iv(e,t)}}function Foe(n,e){return function(t){n.uniform1ui(e,t)}}function Boe(n,e){return function(t){n.uniform1uiv(e,t)}}function Woe(n,e){return function(t){n.uniform2uiv(e,t)}}function Voe(n,e){return function(t){n.uniform3uiv(e,t)}}function Hoe(n,e){return function(t){n.uniform4uiv(e,t)}}function zoe(n,e){return function(t){n.uniformMatrix2fv(e,!1,t)}}function $oe(n,e){return function(t){n.uniformMatrix3fv(e,!1,t)}}function Uoe(n,e){return function(t){n.uniformMatrix4fv(e,!1,t)}}function joe(n,e){return function(t){n.uniformMatrix2x3fv(e,!1,t)}}function qoe(n,e){return function(t){n.uniformMatrix3x2fv(e,!1,t)}}function Goe(n,e){return function(t){n.uniformMatrix2x4fv(e,!1,t)}}function Koe(n,e){return function(t){n.uniformMatrix4x2fv(e,!1,t)}}function Yoe(n,e){return function(t){n.uniformMatrix3x4fv(e,!1,t)}}function Zoe(n,e){return function(t){n.uniformMatrix4x3fv(e,!1,t)}}function to(n,e,t,i){const s=MH(n,e);return Dm(n)?function(o){let r,a;eL(n,o)?(r=o,a=null):(r=o.texture,a=o.sampler),n.uniform1i(i,t),n.activeTexture(NC+t),n.bindTexture(s,r),n.bindSampler(t,a)}:function(o){n.uniform1i(i,t),n.activeTexture(NC+t),n.bindTexture(s,o)}}function io(n,e,t,i,s){const o=MH(n,e),r=new Int32Array(s);for(let a=0;an>="0"&&n<="9";function VH(n,e,t,i){const s=n.split(Xoe).filter(a=>a!=="");let o=0,r="";for(;;){const a=s[o++];r+=a;const l=Qoe(a[0]),c=l?parseInt(a):a;if(l&&(r+=s[o++]),o===s.length){t[c]=e;break}else{const u=s[o++],h=u==="[",f=t[c]||(h?[]:{});t[c]=f,t=f,i[r]=i[r]||function(g){return function(p){zH(g,p)}}(f),r+=u}}}function Joe(n,e){let t=0;function i(a,l,c){const d=l.name.endsWith("[0]"),u=l.type,h=vt[u];if(!h)throw new Error(`unknown type: 0x${u.toString(16)}`);let f;if(h.bindPoint){const g=t;t+=l.size,d?f=h.arraySetter(n,u,g,c,l.size):f=h.setter(n,u,g,c,l.size)}else h.arraySetter&&d?f=h.arraySetter(n,c):f=h.setter(n,c);return f.location=c,f}const s={},o={},r=n.getProgramParameter(e,mH);for(let a=0;a((n+(e-1))/e|0)*e;function nre(n,e,t,i){if(e||t){i=i||1;const o=n.length/4;return function(r){let a=0,l=0;for(let c=0;c1?n.renderbufferStorageMultisample(sh,d,u,t,i):n.renderbufferStorage(sh,u,t,i);else{const f=Object.assign({},l);f.width=t,f.height=i,f.auto===void 0&&(f.auto=!1,f.min=f.min||f.minMag||UE,f.mag=f.mag||f.minMag||UE,f.wrapS=f.wrapS||f.wrap||$E,f.wrapT=f.wrapT||f.wrap||$E),c=ob(n,f)}if(XV(n,c))n.framebufferRenderbuffer(s,h,sh,c);else if(eL(n,c))l.layer!==void 0?n.framebufferTextureLayer(s,h,c,l.level||0,l.layer):n.framebufferTexture2D(s,h,l.target||dre,c,l.level||0);else throw new Error("unknown attachment type");a.attachments.push(c)}),a}function Lre(n,e,t,i,s){i=i||n.drawingBufferWidth,s=s||n.drawingBufferHeight,e.width=i,e.height=s,t=t||GH,t.forEach(function(o,r){const a=e.attachments[r],l=o.format,c=o.samples;if(c!==void 0||XV(n,a))n.bindRenderbuffer(sh,a),c>1?n.renderbufferStorageMultisample(sh,c,l,i,s):n.renderbufferStorage(sh,l,i,s);else if(eL(n,a))eoe(n,a,o,i,s);else throw new Error("unknown attachment type")})}function Dre(n,e,t){const i=n.createVertexArray();return n.bindVertexArray(i),e.length||(e=[e]),e.forEach(function(s){Zh(n,s,t)}),n.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:i}}const kre=/^(.*?)_/;function Ere(n,e){FE(n,0);const t=n.getExtension(e);if(t){const i={},s=kre.exec(e)[1],o="_"+s;for(const r in t){const a=t[r],l=typeof a=="function",c=l?s:o;let d=r;r.endsWith(c)&&(d=r.substring(0,r.length-c.length)),n[d]!==void 0?!l&&n[d]!==a&&ZV(d,n[d],a,r):l?n[d]=function(u){return function(){return u.apply(t,arguments)}}(a):(n[d]=a,i[d]=a)}i.constructor={name:t.constructor.name},FE(i,0)}return t}const gO=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function KH(n){for(let e=0;e 0.0 && abs(size) < minSize) { - pos += (frac - 0.5) * (minSize * sign(size) - size); - return abs(size) / minSize; - } - - return 1.0; -} - -void sort(inout float a, inout float b) { - if (a > b) { - float tmp = b; - b = a; - a = tmp; - } -} - -/** - * The vertex position wrt the rectangle specified by (x, x2, y, y2). - * [0, 0] = [x, y], [1, 1] = [x2, y2]. - * The x or y component may contain fractional values if the rectangle - * have been tessellated. - */ -vec2 getVertexPos() { - int index = gl_VertexID % 6; - return vec2( - index == 0 || index == 1 || index == 3 ? 0.0 : 1.0, - index == 0 || index == 1 || index == 2 ? 0.0 : 1.0 - ); - -} - -void main(void) { - vec2 frac = getVertexPos(); - - vec2 normalizedMinSize = vec2(uMinWidth, uMinHeight) / uViewportSize; - vec4 cornerRadii = vec4( - uCornerRadiusTopRight, - uCornerRadiusBottomRight, - uCornerRadiusBottomLeft, - uCornerRadiusTopLeft - ); - - float x = getScaled_x(); - float x2 = getScaled_x2(); - float y = getScaled_y(); - float y2 = getScaled_y2(); - - sort(x, x2); - sort(y, y2); - - // Clamp x to prevent precision artifacts when the scale is zoomed very close. - // TODO: clamp y as well - float clampMargin = 1.0; - vec2 pos1 = vec2(clamp(x, 0.0 - clampMargin, 1.0 + clampMargin), y); - vec2 pos2 = vec2(clamp(x2, 0.0 - clampMargin, 1.0 + clampMargin), y2); - - vec2 size = pos2 - pos1; - - if (size.x <= 0.0 || size.y <= 0.0) { - // Early exit. May increase performance or not... - gl_Position = vec4(0.0, 0.0, 0.0, 1.0); - return; - } - - vec2 pos = pos1 + frac * size; - - size.y *= getSampleFacetHeight(pos); - - // Clamp to minimum size, optionally compensate with opacity - float opaFactor = uViewOpacity * max(uMinOpacity, - clampMinSize(pos.x, frac.x, size.x, normalizedMinSize.x) * - clampMinSize(pos.y, frac.y, size.y, normalizedMinSize.y)); - - pos = applySampleFacet(pos); - -#if defined(ROUNDED_CORNERS) || defined(STROKED) - // Add an extra pixel to stroke width to accommodate edge antialiasing - float aaPadding = 1.0 / uDevicePixelRatio; - float strokeWidth = getScaled_strokeWidth(); - float strokeOpacity = getScaled_strokeOpacity() * opaFactor; - - vec2 centeredFrac = frac - 0.5; - vec2 expand = centeredFrac * (strokeWidth + aaPadding) / uViewportSize; - pos += expand; - - vec2 sizeInPixels = size * uViewportSize; - vPosInPixels = (centeredFrac + expand / size) * sizeInPixels; - - vHalfSizeInPixels = sizeInPixels / 2.0; - - vCornerRadii = min(cornerRadii, min(vHalfSizeInPixels.x, vHalfSizeInPixels.y)); - vHalfStrokeWidth = strokeWidth / 2.0; - vStrokeColor = vec4(getScaled_stroke() * strokeOpacity, strokeOpacity); -#endif - - gl_Position = unitToNdc(pos); - - float fillOpacity = getScaled_fillOpacity() * opaFactor; - vFillColor = vec4(getScaled_fill() * fillOpacity, fillOpacity); - - setupPicking(); -} -`,Nre=`#if defined(ROUNDED_CORNERS) || defined(STROKED) -in vec2 vPosInPixels; -#endif - -in vec2 vHalfSizeInPixels; - -in lowp vec4 vFillColor; -in lowp vec4 vStrokeColor; -in float vHalfStrokeWidth; -in vec4 vCornerRadii; - -out lowp vec4 fragColor; - -// Source: https://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm -float sdRoundedBox(vec2 p, vec2 b, vec4 r) { - r.xy = p.x > 0.0 ? r.xy : r.zw; - r.x = p.y > 0.0 ? r.x : r.y; - vec2 q = abs(p) - b + r.x; - return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r.x; -} - -// Not a true SDF. Makes the corners of strokes sharp and is faster. -float sdSharpBox(vec2 p, vec2 b) { - vec2 q = abs(p) - b; - return max(q.x, q.y); -} - -void main(void) { - -#if defined(ROUNDED_CORNERS) || defined(STROKED) -#ifdef ROUNDED_CORNERS - // Distance from rectangle's edge in pixels. Negative inside the rectangle. - float d = sdRoundedBox(vPosInPixels, vHalfSizeInPixels, vCornerRadii); -#else - float d = sdSharpBox(vPosInPixels, vHalfSizeInPixels); -#endif - - fragColor = distanceToColor(d, vFillColor, vStrokeColor, vHalfStrokeWidth); - - if (fragColor.a == 0.0) { - discard; - } -#else - // The trivial, non-decorated case - fragColor = vFillColor; -#endif - - if (uPickingEnabled) { - fragColor = vPickingColor; - } -} -`,RR="attr_",YH="uDomain_",Mre="range_",pO="scale_",ZH="getScaled_",jE="uRangeTexture_",mO=3402823466e29;function Rre(n){const e=n.match(/^(?:(\w+)-)?(\w+)$/);if(!e)throw new Error("Not a scale type: "+n);return{family:e[1]||"continuous",transform:e[2]}}function Pre(n,e){let t;if(Jx(n))t=oh(KV(n)(e));else if(Di(e))if(xh(n))t=Fre(e);else throw new Error(`String values are not supported on the "${n}" channel: ${e}`);else if(Wv(e))t=oh(e?1:0);else if(e===null)if(xh(n))t=oh([0,0,0]);else throw new Error(`null value is not supported on the "${n}" chanel.`);else t=oh(e);return` +see: http://github.com/greggman/twgl.js for details */const LR=5120,nb=5121,DR=5122,kR=5123,ER=5124,IR=5125,AR=5126,Jie=32819,ene=32820,tne=33635,ine=5131,nne=33640,sne=35899,one=35902,rne=36269,ane=34042,sH={};{const n=sH;n[LR]=Int8Array,n[nb]=Uint8Array,n[DR]=Int16Array,n[kR]=Uint16Array,n[ER]=Int32Array,n[IR]=Uint32Array,n[AR]=Float32Array,n[Jie]=Uint16Array,n[ene]=Uint16Array,n[tne]=Uint16Array,n[ine]=Uint16Array,n[nne]=Uint32Array,n[sne]=Uint32Array,n[one]=Uint32Array,n[rne]=Uint32Array,n[ane]=Uint32Array}function TR(n){if(n instanceof Int8Array)return LR;if(n instanceof Uint8Array||n instanceof Uint8ClampedArray)return nb;if(n instanceof Int16Array)return DR;if(n instanceof Uint16Array)return kR;if(n instanceof Int32Array)return ER;if(n instanceof Uint32Array)return IR;if(n instanceof Float32Array)return AR;throw new Error("unsupported typed array type")}function lne(n){if(n===Int8Array)return LR;if(n===Uint8Array||n===Uint8ClampedArray)return nb;if(n===Int16Array)return DR;if(n===Uint16Array)return kR;if(n===Int32Array)return ER;if(n===Uint32Array)return IR;if(n===Float32Array)return AR;throw new Error("unsupported typed array type")}function cne(n){const e=sH[n];if(!e)throw new Error("unknown gl type");return e}const RC=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function dne(...n){console.error(...n)}function oH(...n){console.warn(...n)}function une(n,e){return typeof WebGLBuffer<"u"&&e instanceof WebGLBuffer}function rH(n,e){return typeof WebGLRenderbuffer<"u"&&e instanceof WebGLRenderbuffer}function oL(n,e){return typeof WebGLTexture<"u"&&e instanceof WebGLTexture}function hne(n,e){return typeof WebGLSampler<"u"&&e instanceof WebGLSampler}const aH=35044,Ha=34962,fne=34963,gne=34660,pne=5120,mne=5121,_ne=5122,bne=5123,vne=5124,wne=5125,yne=5126,lH={attribPrefix:""};function cH(n,e,t,i,s){n.bindBuffer(e,t),n.bufferData(e,i,s||aH)}function dH(n,e,t,i){if(une(n,e))return e;t=t||Ha;const s=n.createBuffer();return cH(n,t,s,e,i),s}function uH(n){return n==="indices"}function Cne(n){return n instanceof Int8Array||n instanceof Uint8Array}function Sne(n){return n===Int8Array||n===Uint8Array}function xne(n){return n.length?n:n.data}const Lne=/coord|texture/i,Dne=/color|colour/i;function hH(n,e){let t;if(Lne.test(n)?t=2:Dne.test(n)?t=4:t=3,e%t>0)throw new Error(`Can not guess numComponents for attribute '${n}'. Tried ${t} but ${e} values is not evenly divisible by ${t}. You should specify it.`);return t}function kne(n,e){return n.numComponents||n.size||hH(e,xne(n).length)}function NR(n,e){if(RC(n))return n;if(RC(n.data))return n.data;Array.isArray(n)&&(n={data:n});let t=n.type;return t||(uH(e)?t=Uint16Array:t=Float32Array),new t(n.data)}function Ene(n,e){const t={};return Object.keys(e).forEach(function(i){if(!uH(i)){const s=e[i],o=s.attrib||s.name||s.attribName||lH.attribPrefix+i;if(s.value){if(!Array.isArray(s.value)&&!RC(s.value))throw new Error("array.value is not array or typedarray");t[o]={value:s.value}}else{let r,a,l,c;if(s.buffer&&s.buffer instanceof WebGLBuffer)r=s.buffer,c=s.numComponents||s.size,a=s.type,l=s.normalize;else if(typeof s=="number"||typeof s.data=="number"){const d=s.data||s,u=s.type||Float32Array,h=d*u.BYTES_PER_ELEMENT;a=lne(u),l=s.normalize!==void 0?s.normalize:Sne(u),c=s.numComponents||s.size||hH(i,d),r=n.createBuffer(),n.bindBuffer(Ha,r),n.bufferData(Ha,h,s.drawType||aH)}else{const d=NR(s,i);r=dH(n,d,void 0,s.drawType),a=TR(d),l=s.normalize!==void 0?s.normalize:Cne(d),c=kne(s,i)}t[o]={buffer:r,numComponents:c,type:a,normalize:l,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),n.bindBuffer(Ha,null),t}function Ine(n,e,t,i){t=NR(t),i!==void 0?(n.bindBuffer(Ha,e.buffer),n.bufferSubData(Ha,i,t)):cH(n,Ha,e.buffer,t,e.drawType)}function Ane(n,e){return e===pne||e===mne?1:e===_ne||e===bne?2:e===vne||e===wne||e===yne?4:0}const yk=["position","positions","a_position"];function Tne(n,e){let t,i;for(i=0;i{const w=v*b.ndx,y=t.subarray(w,w+v);n.texImage2D(b.face,l,c,o,r,0,u,h,y)})}else s===Fd||s===Bd?n.texImage3D(s,l,c,o,r,a,0,u,h,t):n.texImage2D(s,l,c,o,r,0,u,h,t);return{width:o,height:r,depth:a,type:h}}function loe(n,e,t){const i=t.target||dc;n.bindTexture(i,e);const s=t.level||0,o=t.internalFormat||t.format||Wi,r=Em(o),a=t.format||r.format,l=t.type||r.type;if(zp(n,t),i===rc)for(let c=0;c<6;++c)n.texImage2D(rL+c,s,o,t.width,t.height,0,a,l,null);else i===Fd||i===Bd?n.texImage3D(i,s,o,t.width,t.height,t.depth,0,a,l,null):n.texImage2D(i,s,o,t.width,t.height,0,a,l,null)}function ob(n,e,t){t=t||a1,e=e||ru.textureOptions;const i=n.createTexture(),s=e.target||dc;let o=e.width||1,r=e.height||1;const a=e.internalFormat||Wi;n.bindTexture(s,i),s===rc&&(n.texParameteri(s,OC,PC),n.texParameteri(s,FC,PC));let l=e.src;if(l)if(typeof l=="function"&&(l=l(n,e)),typeof l=="string")ooe(n,i,e,t);else if(Hp(l)||Array.isArray(l)&&(typeof l[0]=="number"||Array.isArray(l[0])||Hp(l[0]))){const c=xH(n,i,l,e);o=c.width,r=c.height}else Array.isArray(l)&&(typeof l[0]=="string"||SH(l[0]))?s===rc?roe(n,i,e,t):aoe(n,i,e,t):(CH(n,i,l,e),o=l.width,r=l.height);else loe(n,i,e);return sb(e)&&qE(n,i,e,o,r,a),yH(n,i,e),i}function coe(n,e,t,i,s,o){i=i||t.width,s=s||t.height,o=o||t.depth;const r=t.target||dc;n.bindTexture(r,e);const a=t.level||0,l=t.internalFormat||t.format||Wi,c=Em(l),d=t.format||c.format;let u;const h=t.src;if(h&&(Hp(h)||Array.isArray(h)&&typeof h[0]=="number")?u=t.type||vH(n,h,c.type):u=t.type||c.type,r===rc)for(let f=0;f<6;++f)n.texImage2D(rL+f,a,l,i,s,0,d,u,null);else r===Fd||r===Bd?n.texImage3D(r,a,l,i,s,o,0,d,u,null):n.texImage2D(r,a,l,i,s,0,d,u,null)}const doe=oH,BC=33984,uoe=35048,lL=34962,hoe=34963,OR=35345,LH=35718,foe=35721,goe=35971,poe=35382,moe=35396,_oe=35398,boe=35392,voe=35395,cL=5126,DH=35664,kH=35665,EH=35666,FR=5124,IH=35667,AH=35668,TH=35669,NH=35670,MH=35671,RH=35672,PH=35673,OH=35674,FH=35675,BH=35676,woe=35678,yoe=35680,Coe=35679,Soe=35682,xoe=35685,Loe=35686,Doe=35687,koe=35688,Eoe=35689,Ioe=35690,Aoe=36289,Toe=36292,Noe=36293,BR=5125,WH=36294,VH=36295,HH=36296,Moe=36298,Roe=36299,Poe=36300,Ooe=36303,Foe=36306,Boe=36307,Woe=36308,Voe=36311,dL=3553,uL=34067,WR=32879,hL=35866,vt={};function zH(n,e){return vt[e].bindPoint}function Hoe(n,e){return function(t){n.uniform1f(e,t)}}function zoe(n,e){return function(t){n.uniform1fv(e,t)}}function $oe(n,e){return function(t){n.uniform2fv(e,t)}}function Uoe(n,e){return function(t){n.uniform3fv(e,t)}}function joe(n,e){return function(t){n.uniform4fv(e,t)}}function $H(n,e){return function(t){n.uniform1i(e,t)}}function UH(n,e){return function(t){n.uniform1iv(e,t)}}function jH(n,e){return function(t){n.uniform2iv(e,t)}}function qH(n,e){return function(t){n.uniform3iv(e,t)}}function GH(n,e){return function(t){n.uniform4iv(e,t)}}function qoe(n,e){return function(t){n.uniform1ui(e,t)}}function Goe(n,e){return function(t){n.uniform1uiv(e,t)}}function Koe(n,e){return function(t){n.uniform2uiv(e,t)}}function Yoe(n,e){return function(t){n.uniform3uiv(e,t)}}function Zoe(n,e){return function(t){n.uniform4uiv(e,t)}}function Xoe(n,e){return function(t){n.uniformMatrix2fv(e,!1,t)}}function Qoe(n,e){return function(t){n.uniformMatrix3fv(e,!1,t)}}function Joe(n,e){return function(t){n.uniformMatrix4fv(e,!1,t)}}function ere(n,e){return function(t){n.uniformMatrix2x3fv(e,!1,t)}}function tre(n,e){return function(t){n.uniformMatrix3x2fv(e,!1,t)}}function ire(n,e){return function(t){n.uniformMatrix2x4fv(e,!1,t)}}function nre(n,e){return function(t){n.uniformMatrix4x2fv(e,!1,t)}}function sre(n,e){return function(t){n.uniformMatrix3x4fv(e,!1,t)}}function ore(n,e){return function(t){n.uniformMatrix4x3fv(e,!1,t)}}function to(n,e,t,i){const s=zH(n,e);return km(n)?function(o){let r,a;oL(n,o)?(r=o,a=null):(r=o.texture,a=o.sampler),n.uniform1i(i,t),n.activeTexture(BC+t),n.bindTexture(s,r),n.bindSampler(t,a)}:function(o){n.uniform1i(i,t),n.activeTexture(BC+t),n.bindTexture(s,o)}}function io(n,e,t,i,s){const o=zH(n,e),r=new Int32Array(s);for(let a=0;an>="0"&&n<="9";function YH(n,e,t,i){const s=n.split(rre).filter(a=>a!=="");let o=0,r="";for(;;){const a=s[o++];r+=a;const l=are(a[0]),c=l?parseInt(a):a;if(l&&(r+=s[o++]),o===s.length){t[c]=e;break}else{const u=s[o++],h=u==="[",f=t[c]||(h?[]:{});t[c]=f,t=f,i[r]=i[r]||function(g){return function(p){XH(g,p)}}(f),r+=u}}}function lre(n,e){let t=0;function i(a,l,c){const d=l.name.endsWith("[0]"),u=l.type,h=vt[u];if(!h)throw new Error(`unknown type: 0x${u.toString(16)}`);let f;if(h.bindPoint){const g=t;t+=l.size,d?f=h.arraySetter(n,u,g,c,l.size):f=h.setter(n,u,g,c,l.size)}else h.arraySetter&&d?f=h.arraySetter(n,c):f=h.setter(n,c);return f.location=c,f}const s={},o={},r=n.getProgramParameter(e,LH);for(let a=0;a((n+(e-1))/e|0)*e;function hre(n,e,t,i){if(e||t){i=i||1;const o=n.length/4;return function(r){let a=0,l=0;for(let c=0;c1?n.renderbufferStorageMultisample(lh,d,u,t,i):n.renderbufferStorage(lh,u,t,i);else{const f=Object.assign({},l);f.width=t,f.height=i,f.auto===void 0&&(f.auto=!1,f.min=f.min||f.minMag||ZE,f.mag=f.mag||f.minMag||ZE,f.wrapS=f.wrapS||f.wrap||YE,f.wrapT=f.wrapT||f.wrap||YE),c=ob(n,f)}if(rH(n,c))n.framebufferRenderbuffer(s,h,lh,c);else if(oL(n,c))l.layer!==void 0?n.framebufferTextureLayer(s,h,c,l.level||0,l.layer):n.framebufferTexture2D(s,h,l.target||vre,c,l.level||0);else throw new Error("unknown attachment type");a.attachments.push(c)}),a}function Rre(n,e,t,i,s){i=i||n.drawingBufferWidth,s=s||n.drawingBufferHeight,e.width=i,e.height=s,t=t||iz,t.forEach(function(o,r){const a=e.attachments[r],l=o.format,c=o.samples;if(c!==void 0||rH(n,a))n.bindRenderbuffer(lh,a),c>1?n.renderbufferStorageMultisample(lh,c,l,i,s):n.renderbufferStorage(lh,l,i,s);else if(oL(n,a))coe(n,a,o,i,s);else throw new Error("unknown attachment type")})}function Pre(n,e,t){const i=n.createVertexArray();return n.bindVertexArray(i),e.length||(e=[e]),e.forEach(function(s){Yh(n,s,t)}),n.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:i}}const Ore=/^(.*?)_/;function Fre(n,e){$E(n,0);const t=n.getExtension(e);if(t){const i={},s=Ore.exec(e)[1],o="_"+s;for(const r in t){const a=t[r],l=typeof a=="function",c=l?s:o;let d=r;r.endsWith(c)&&(d=r.substring(0,r.length-c.length)),n[d]!==void 0?!l&&n[d]!==a&&oH(d,n[d],a,r):l?n[d]=function(u){return function(){return u.apply(t,arguments)}}(a):(n[d]=a,i[d]=a)}i.constructor={name:t.constructor.name},$E(i,0)}return t}const kO=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function nz(n){for(let e=0;eBre.apply(null,[R,"value",...P]);let v;switch(p){case"linear":v=_("scaleLinear","domain",a);break;case"log":v=_("scaleLog","domain",a,e.base());break;case"symlog":v=_("scaleSymlog","domain",a,e.constant());break;case"pow":case"sqrt":v=_("scalePow","domain",a,e.exponent());break;case"index":case"locus":v=_("scaleBandHp","domain",a,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"point":case"band":v=_("scaleBand","domain",a,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"ordinal":case"null":case"identity":v=_("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${e.type}! ${n}: ${JSON.stringify(t)}`)}const b=Yx(e.type)||rs(e.type)&&xh(n)?[0,1]:e.range?e.range():void 0;if(b&&n==s&&b.length&&b.every(Xs)){const R=_O(b);g.push(`const ${R.type} ${a} = ${R};`)}const w=xh(n)?"vec3":"float";let y;if(xh(n)){const R=jE+s;if(n==s&&g.push(`uniform sampler2D ${R};`),rs(e.type))y=`getInterpolatedColor(${R}, transformed)`;else if(Ua(e.type)||Vu(e.type))y=`getDiscreteColor(${R}, int(transformed))`;else throw new Error("Problem with color scale!")}else if(e.type==="ordinal"||Vu(e.type)){const R=jE+s;n==s&&g.push(`uniform sampler2D ${R};`),y=`getDiscreteColor(${R}, int(transformed)).r`}const S=e1(t)?`uniform highp ${u} ${o};`:`in highp ${u} ${o};`,L=[],x=rs(e.type)&&h>2,D=Vu(e.type)||x;if(L.push("int slot = 0;"),D){const R=r;L.push(x?`while (slot < ${R}.length() - 2 && value >= ${R}[slot + 1]) { slot++; }`:`while (slot < ${R}.length() && value >= ${R}[slot]) { slot++; }`)}const k=rs(e.type)||Vu(e.type)||["band","point"].includes(e.type);if(v){const R=r;k&&(c?L.push(`vec3 domain = ${R};`):L.push(`vec2 domain = vec2(${R}[slot], ${R}[slot + 1]);`)),L.push(`float transformed = ${v};`),x&&L.push(`transformed = (float(slot) + transformed) / (float(${R}.length() - 1));`)}else L.push("float transformed = float(slot);");"clamp"in e&&e.clamp()&&L.push(`transformed = clampToRange(transformed, ${_O(b)});`),L.push(`return ${y??"transformed"};`),g.push(` -${w} ${pO}${n}(${u} value) { -${L.map(R=>` ${R} +}`}function Ure(n){let e="float",t=r=>r;Wd(n)&&(e="vec3",t=r=>az(r));const i=`u${Xre(n)}`,s=` // Dynamic value + uniform ${e} ${i};`;let o=` +#define ${n}_DEFINED +${e} ${$R}${n}() { + // Dynamic value + return ${i}; +}`;return{channel:n,uniformName:i,uniformGlsl:s,scaleGlsl:o,adjuster:t}}function jre(n,e,t,i=[n]){if(pr(t))throw new Error(`Cannot create scale for "value": ${JSON.stringify(t)}`);const s=e?e.scale:sL(),o=Zh(n),r=sz+dz(i),a=Vre+o,l=Hre+o,c=Ua(s.type),d=WC(s.type),h=d&&UR(s.domain())?"uvec2":d||c?"uint":"float",f=s.domain?s.domain().length:void 0;let g;const p=[];p.push(""),p.push("/".repeat(70)),p.push(`// Channel: ${n}`),p.push(""),p.push(`#define ${n}_DEFINED`);const{transform:_}=zre(s.type),v=(W,...G)=>Gre.apply(null,[W,"value",...G]);let b;switch(_){case"linear":b=v("scaleLinear","domain",l);break;case"log":b=v("scaleLog","domain",l,s.base());break;case"symlog":b=v("scaleSymlog","domain",l,s.constant());break;case"pow":case"sqrt":b=v("scalePow","domain",l,s.exponent());break;case"index":case"locus":b=v("scaleBandHp","domain",l,s.paddingInner(),s.paddingOuter(),s.align(),t.band??.5);break;case"point":case"band":b=v("scaleBand","domain",l,s.paddingInner(),s.paddingOuter(),s.align(),t.band??.5);break;case"ordinal":case"null":case"identity":b=v("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${s.type}! ${n}: ${JSON.stringify(t)}`)}const w=uz(s,n);let y;if(w&&n==o){const W=s.props.range??[];if(Kl(W)||W.some(Kl)){if(w.length<1||w.length>4)throw new Error(`A range with ExprRefs must have 1-4 elements, not ${w.length}! Range: ${JSON.stringify(w)}`);y=` uniform ${rz(w.length)} ${l};`}else if(w.length&&w.every(Xs)){const G=AO(w);p.push(`const ${G.type} ${l} = ${G};`)}}const S=Wd(n)?"vec3":"float";let L;if(Wd(n)){const W=XE+o;if(n==o&&p.push(`uniform sampler2D ${W};`),rs(s.type))L=`getInterpolatedColor(${W}, transformed)`;else if(Ua(s.type)||ju(s.type))L=`getDiscreteColor(${W}, int(transformed))`;else throw new Error("Problem with color scale!")}else if(s.type==="ordinal"||ju(s.type)){const W=XE+o;n==o&&p.push(`uniform sampler2D ${W};`),L=`getDiscreteColor(${W}, int(transformed)).r`}const[x,D]=c1(t)?[void 0,` uniform highp ${h} ${r};`]:[`in highp ${h} ${r};`,void 0],k=[],P=rs(s.type)&&f>2,O=ju(s.type)||P;if(k.push("int slot = 0;"),O){const W=a;k.push(P?`while (slot < ${W}.length() - 2 && value >= ${W}[slot + 1]) { slot++; }`:`while (slot < ${W}.length() && value >= ${W}[slot]) { slot++; }`)}const R=rs(s.type)||ju(s.type)||["band","point"].includes(s.type);if(b){const W=a;R&&(d?k.push(`vec3 domain = ${W};`):k.push(`vec2 domain = vec2(${W}[slot], ${W}[slot + 1]);`)),k.push(`float transformed = ${b};`),P&&k.push(`transformed = (float(slot) + transformed) / (float(${W}.length() - 1));`)}else k.push("float transformed = float(slot);");"clamp"in s&&s.clamp()&&k.push(`transformed = clampToRange(transformed, ${AO(w)});`),k.push(`return ${L??"transformed"};`),p.push(` +${S} ${EO}${n}(${h} value) { +${k.map(W=>` ${W} `).join("")} -}`),g.push(` -${w} ${ZH}${n}() { - return ${pO}${n}(${o}); -}`);const O=g.join(` -`);if(k&&n==s){const R=rs(e.type)||Vu(e.type)?h:2;f=c?`highp vec3 ${r};`:`mediump float ${r}[${R}];`}return{attributeGlsl:S,glsl:O,domainUniform:f}}function qE(n){if(!Xs(n))throw new Error(`Not a number: ${n}`);if(n==1/0)return""+mO;if(n==-1/0)return""+-mO;{let e=`${n}`;return/^(-)?\d+$/.test(e)&&(e+=".0"),e}}function oh(n){typeof n=="number"&&(n=[n]);const e=n.length;if(e<1||e>4)throw new Error("Invalid number of components: "+e);let t,i;return e>1?(t=`vec${e}`,i=`${t}(${n.map(qE).join(", ")})`):(t="float",i=qE(n[0])),Object.assign(i,{type:t,numComponents:e})}function Fre(n){const e=Td(n).rgb();return oh([e.r,e.g,e.b].map(t=>t/255))}function _O(n){return oh([n[0],zv(n)])}function Bre(n,...e){const t=[];for(const i of e)Xs(i)?t.push(qE(i)):Eo(i)?t.push(oh(i)):t.push(i);return`${n}(${t.join(", ")})`}function MC(n){return n=="index"||n=="locus"}function XH(n){return n[1]>2**32}const Wre=12,RC=2**Wre,Vre=RC-1;function Hre(n,e=[]){const t=n&Vre,i=n-t;return e[0]=i,e[1]=t,e}function zre(n,e=[]){const t=n%RC,i=(n-t)/RC;return e[0]=i,e[1]=t,e}function $re(n){const e=n%RC;return[n-e,e]}function Ure(n){return[...$re(n[0]),n[1]-n[0]]}function QH(n){const e=new kd([],JSON.stringify);for(const[t,i]of Object.entries(n)){const s=i.channelDef;if(wf(s)){const r=[s.field,i.scale?(rs(i.scale.type)||Vu(i.scale.type))??!1:!1];e.set(r,[...e.get(r)??[],t])}}return e}function JH(n){return qs(n).join("_")}const bO=1e4;var bv,mx,ez,_x,tz;class jre{constructor(e){et(this,mx);et(this,_x);et(this,bv,!1);this.size=e,this.arrays={},this.pushers=[],this.dataUpdaters=[],this.vertexCount=0}configure(){if(ve(this,bv))throw new Error("Already configured!");tt(this,mx,ez).call(this),tt(this,_x,tz).call(this),Ei(this,bv,!0)}addConverter(e,t){const i=this.createUpdater(RR+e,t.numComponents||1,t.targetArrayType??Float32Array,t.arrayReference),s=t.f;this.dataUpdaters.push(t.arrayReference?o=>i(s(o)):o=>i(s(o)))}createUpdater(e,t,i=Float32Array,s=void 0){if(!Xs(this.size))throw new Error("The number of vertices must be defined!");let o,r,a=0;const l=new i(this.size*t);if(this.arrays[e]={data:l,numComponents:t},t==1){let c=0;const d=u=>{c=+u};o=()=>{l[a++]=c},r=d}else{let c=s??[0];const d=s?u=>{}:u=>{c=u};switch(t){case 1:break;case 2:o=()=>{l[a++]=c[0],l[a++]=c[1]},r=d;break;case 3:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2]},r=d;break;case 4:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2],l[a++]=c[3]},r=d;break;default:throw new Error("Invalid numComponents: "+t)}}return this.pushers.push(o),r}pushAll(){throw new Error("Call configure() first!")}updateFromDatum(e){throw new Error("Call configure() first!")}pushFromDatum(e){this.updateFromDatum(e),this.pushAll()}}bv=new WeakMap,mx=new WeakSet,ez=function(){if(this.size>bO){const e=this.pushers.map((i,s)=>`const p${s} = that.pushers[${s}];`).join(` -`),t=this.pushers.map((i,s)=>` p${s}();`).join(` -`);this.pushAll=new Function("that",`${e} -return function unrolledPushAll() { -${t} - that.vertexCount++; -};`)(this)}else this.pushAll=()=>{for(let e=0;ebO){const e=this.dataUpdaters.map((i,s)=>`const u${s} = that.dataUpdaters[${s}];`).join(` -`),t=this.dataUpdaters.map((i,s)=>` u${s}(datum);`).join(` -`);this.updateFromDatum=new Function("that","datum",`${e} -return function unrolledUpdateFromDatum(datum) { -${t} -};`)(this)}else this.updateFromDatum=e=>{for(let t=0;t{const w=(v-c)/u,y=Math.floor(w);return J_(b&&y==w?y-1:y,0,n-1)};function f(v,b,w){if(a)return;if(b>o)o=b;else{a=!0,console.debug("Items are not ordered properly. Disabling binned index.");return}const y=t(v);if(yb&&(s[S]=b),l[S]o)o=b;else{a=!0,console.debug("Items (vertices) are not ordered properly. Disabling binned index.");return}const y=t(v),S=i(v);if(yb&&(s[D]=b),l[D]{const y=h(v,!1),S=h(b,!0),L=s[y],x=Math.max(l[S],L);return w[0]=L,w[1]=x,w},_=()=>{if(a)return;for(let b=1;b0;b--)v&&s[b]==vO?(s[b]=l[b],v=!1):s[b-1]>s[b]&&(s[b-1]=s[b]);return p};return f.getIndex=_,g.getIndex=_,t==i?f:g}class i1{constructor({encoders:e,numVertices:t=void 0,attributes:i=[]}){this.encoders=e,this.variableEncoders=Object.fromEntries(Object.entries(e).filter(([o,r])=>i.includes(o)&&r&&r.scale&&!r.constant));const s=[...QH(e).entries()].filter(([o,r])=>o[1]&&r.length>1).map(([o,r])=>r);this.allocatedVertices=t,this.variableBuilder=new jre(t);for(const[o,r]of Object.entries(this.variableEncoders)){const a=s.find(p=>p.find(_=>_==o));if(a&&o!=a[0])continue;const l=r.accessor,c=MC(r.scale.type),d=c&&XH(r.scale.domain()),u=[0,0],h=r.indexer,f=h?p=>h(l(p)):d?p=>zre(l(p),u):l,g=a?JH(a):o;this.variableBuilder.addConverter(g,{f,numComponents:d?2:1,arrayReference:d?u:void 0,targetArrayType:Ua(r.scale.type)?Uint16Array:c?Uint32Array:Float32Array})}this.lastOffset=0,this.rangeMap=new kd([],JSON.stringify)}registerBatch(e){var o;const t=this.lastOffset,i=this.variableBuilder.vertexCount,s=i-t;s&&this.rangeMap.set(e,{offset:t,count:s,xIndex:(o=this.xIndexer)==null?void 0:o.getIndex()}),this.lastOffset=i}addBatches(e){for(const[t,i]of e)this.addBatch(t,i)}addBatch(e,t,i=0,s=t.length){this.prepareXIndexer(t,i,s);for(let o=i;o{this.addToXIndex=d=>{},this.xIndexer=void 0},o=(c=this.encoders.x)==null?void 0:c.channelDef;if(!("buildIndex"in o)||!o.buildIndex||!e.length||i-t<0){s();return}const r=d=>{var u;return d&&rs((u=d.scale)==null?void 0:u.type)&&d},a=r(this.variableEncoders.x),l=r(this.variableEncoders.x2);if(a){const d=a.accessor,u=l?l.accessor:d,h=[d(e[t]),u(e[i-1])];if(h[1]>h[0]){this.xIndexer=Gre(50,h,d,u);let f=this.variableBuilder.vertexCount;this.addToXIndex=g=>{let p=this.variableBuilder.vertexCount;this.xIndexer(g,f,p),f=p}}else s()}else s()}addToXIndex(e){}toArrays(){return{arrays:this.variableBuilder.arrays,vertexCount:this.variableBuilder.vertexCount,allocatedVertices:this.allocatedVertices,rangeMap:this.rangeMap}}}class Kre extends i1{constructor({encoders:e,attributes:t,numItems:i}){super({encoders:e,attributes:t,numVertices:i*6}),this.variableBuilder.configure();const s=this.variableBuilder.pushAll;this.pushAllSixTimes=i>500?new Function("pushAll",`return function unrolledPushAllSixTimes() { - pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); -};`)(s):function(){s(),s(),s(),s(),s(),s()}}addBatch(e,t,i=0,s=t.length){if(!(s<=i)){this.prepareXIndexer(t,i,s);for(let o=i;ol,this.updateVertexCoord=this.variableBuilder.createUpdater("vertexCoord",2),this.updateTextureCoord=this.variableBuilder.createUpdater("textureCoord",2),this.updateWidth=this.variableBuilder.createUpdater("width",1),this.variableBuilder.configure()}addBatch(e,t,i=0,s=t.length){const o=this.properties.align||"left",r=this.properties.logoLetters??!1,a=this.metadata.common.base,l=this.metadata.common.scaleH;let c=-vg;switch(this.properties.baseline){case"top":c+=this.metrics.capHeight;break;case"middle":c+=this.metrics.capHeight/2;break;case"bottom":c-=this.metrics.descent;break}const d=this.encoders.text.accessor||this.encoders.text,u=[0,0];this.updateVertexCoord(u);const h=[0,0];this.updateTextureCoord(h),this.prepareXIndexer(t,i,s);for(let f=i;f4)throw new Error("Invalid number of components: "+e);const t=rz(e),i=`${t}(${n.map(oz).join(", ")})`;return Object.assign(i,{type:t,numComponents:e})}function rz(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("Invalid number of components: "+n)}}function az(n){const e=Pd(n).rgb();return[e.r,e.g,e.b].map(t=>t/255)}function qre(n){return ch(az(n))}function AO(n){return ch([n[0],Yv(n)])}function Gre(n,...e){const t=[];for(const i of e)Xs(i)?t.push(oz(i)):Zs(i)?t.push(ch(i)):t.push(i);return`${n}(${t.join(", ")})`}function WC(n){return n=="index"||n=="locus"}function UR(n){return n[1]>2**32}const Kre=12,QE=2**Kre;function lz(n,e=[]){const t=n%QE,i=(n-t)/QE;return e[0]=i,e[1]=t,e}function Yre(n){const e=n%QE;return[n-e,e]}function Zre(n){return[...Yre(n[0]),n[1]-n[0]]}function cz(n){const e=new Ad([],JSON.stringify);for(const[t,i]of Object.entries(n)){const s=i.channelDef;if(wf(s)){const r=[s.field,i.scale?(rs(i.scale.type)||ju(i.scale.type))??!1:!1];e.set(r,[...e.get(r)??[],t])}}return e}function dz(n){return js(n).join("_")}function Xre(n){return n[0].toUpperCase()+n.slice(1)}const uz=(n,e)=>iL(n.type)||rs(n.type)&&Wd(e)?[0,1]:n.range?n.range():void 0,TO=`#define PI 3.141593 uniform View { /** Offset in "unit" units */ @@ -1218,7 +1027,7 @@ vec4 distanceToColor(float d, vec4 fill, vec4 stroke, float halfStrokeWidth) { return fill * distanceToRatio(-d); } } -`,Jre=`uniform highp float uZero; +`,Qre=`uniform highp float uZero; // Utils ------------ @@ -1387,7 +1196,7 @@ float scaleBandHp(uvec2 value, vec3 domainExtent, vec2 range, return dot(vec4(start, hi, lo, bandwidth), vec4(1.0, step, step, band)); } -`,eae=` +`,Jre=` /** * Describes where a sample facet should be shown. Interpolating between the * current and target positions/heights allows for transitioning between facet @@ -1494,7 +1303,7 @@ float getSampleFacetHeight(vec2 pos) { return facetPos.height; } } -`,tae=`/* +`,eae=`/* * Based on concepts presented at: * https://webglfundamentals.org/webgl/lessons/webgl-picking.html * https://deck.gl/docs/developer-guide/custom-layers/picking @@ -1521,23 +1330,218 @@ bool setupPicking() { } return false; } -`,iae=`in highp vec4 vPickingColor; -`,xy=Symbol("cacheMap");function zp(n,e,t){let i=rb(n).get(e);return i===void 0&&(i=t(e),rb(n).set(e,i)),i}function iz(n,e){rb(n).delete(e)}function Ly(n,e){const t=rb(n);for(const i of t.keys())i.startsWith(e)&&t.delete(i);rb(n).delete(e)}function nz(n){n[xy]=new Map}function rb(n){return n[xy]||nz(n),n[xy]}function nae(n,e,t,i){const s=Di(n)?n:n.name,o=!Di(n)&&n.extent||[0,1];if(t===void 0&&!Di(n)&&(t=n.count),s){const r=gR(s);if(Co(r)){const a=sz(r,{extent:o,count:t});return hL(e,{minMag:e.LINEAR,format:e.RGB,height:1,wrap:e.CLAMP_TO_EDGE},a,i)}else{if(Eo(r))return KE(r,e);throw new Error("Unknown scheme: "+s)}}}function sae(n,e="rgb",t,i){const s=Zx(n,Di(e)?e:e.type,Di(e)?void 0:e.gamma),o=sz(s);return hL(t,{minMag:t.LINEAR,format:t.RGB,height:1,wrap:t.CLAMP_TO_EDGE},o,i)}function oae(n,e,t,i){const s=Math.max(n.length,t||0),o=new Float32Array(s);for(let r=0;ra/(i-1)).map(a=>s+a/o).map(n);return t&&r.reverse(),oz(r)}function oz(n,e){const t=Math.max(n.length,e||0),i=new Uint8Array(t*3);for(let s=0;s({width:void 0,height:void 0})),this._shaderCache=new Map,this.rangeTextures=new WeakMap;const s=document.createElement("canvas");e.appendChild(s);const o=Are(s,{antialias:!0,depth:!1,premultipliedAlpha:!0});if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");if(!Dm(o))throw new Error("Your web browser does not support WebGL 2.0. Chrome, Firefox, and Safari Tech Preview should work.");if(KH(o),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),this.canvas=s,this.gl=o,this._pickingAttachmentOptions=[{format:o.RGBA,type:o.UNSIGNED_BYTE,minMag:o.LINEAR,wrap:o.CLAMP_TO_EDGE}],this._pickingBufferInfo=xre(o,this._pickingAttachmentOptions),o.bindFramebuffer(o.FRAMEBUFFER,null),this.adjustGl(),this._updateDpr(),this._clearColor=[0,0,0,0],i){const r=Td(i).rgb();this._clearColor=[r.r/255,r.g/255,r.b/255,r.opacity]}}invalidateSize(){this._logicalCanvasSize=void 0,this._updateDpr(),this.adjustGl()}_updateDpr(){this.dpr=window.devicePixelRatio}compileShader(e,t){const i="#version 300 es",s="precision mediump float;";Eo(t)&&(t=t.join(` +`,tae=`in highp vec4 vPickingColor; +`,Ty=Symbol("cacheMap");function _L(n,e,t){let i=rb(n).get(e);return i===void 0&&(i=t(e),rb(n).set(e,i)),i}function iae(n,e){rb(n).delete(e)}function Ny(n,e){const t=rb(n);for(const i of t.keys())i.startsWith(e)&&t.delete(i);rb(n).delete(e)}function hz(n){n[Ty]=new Map}function rb(n){return n[Ty]||hz(n),n[Ty]}function nae(n,e,t,i){const s=Ei(n)?n:n.name,o=!Ei(n)&&n.extent||[0,1];if(t===void 0&&!Ei(n)&&(t=n.count),s){const r=xR(s);if(yo(r)){const a=fz(r,{extent:o,count:t});return bL(e,{minMag:e.LINEAR,format:e.RGB,height:1,wrap:e.CLAMP_TO_EDGE},a,i)}else{if(Zs(r))return JE(r,e);throw new Error("Unknown scheme: "+s)}}}function sae(n,e="rgb",t,i){const s=nL(n,Ei(e)?e:e.type,Ei(e)?void 0:e.gamma),o=fz(s);return bL(t,{minMag:t.LINEAR,format:t.RGB,height:1,wrap:t.CLAMP_TO_EDGE},o,i)}function oae(n,e,t,i){const s=Math.max(n.length,t||0),o=new Float32Array(s);for(let r=0;ra/(i-1)).map(a=>s+a/o).map(n);return t&&r.reverse(),gz(r)}function gz(n,e){const t=Math.max(n.length,e||0),i=new Uint8Array(t*3);for(let s=0;s({width:void 0,height:void 0})),this._shaderCache=new Map,this.rangeTextures=new WeakMap;const s=document.createElement("canvas");e.appendChild(s);const o=Wre(s,{antialias:!0,depth:!1,premultipliedAlpha:!0});if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");if(!km(o))throw new Error("Your web browser does not support WebGL 2.0. Chrome, Firefox, and Safari Tech Preview should work.");if(nz(o),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),this.canvas=s,this.gl=o,this._pickingAttachmentOptions=[{format:o.RGBA,type:o.UNSIGNED_BYTE,minMag:o.LINEAR,wrap:o.CLAMP_TO_EDGE}],this._pickingBufferInfo=Mre(o,this._pickingAttachmentOptions),o.bindFramebuffer(o.FRAMEBUFFER,null),this.adjustGl(),this._updateDpr(),this._clearColor=[0,0,0,0],i){const r=Pd(i).rgb();this._clearColor=[r.r/255,r.g/255,r.b/255,r.opacity]}}invalidateSize(){this._logicalCanvasSize=void 0,this._updateDpr(),this.adjustGl()}_updateDpr(){this.dpr=window.devicePixelRatio}compileShader(e,t){const i="#version 300 es",s="precision mediump float;";Zs(t)&&(t=t.join(` `));const o=this.gl,r=t.replaceAll(/ {2,}|^\s*\/\/.*$/gm,"");let a=this._shaderCache.get(r);if(!a){const l=[i,s,t].join(` -`);a=o.createShader(e),o.shaderSource(a,l),o.compileShader(a),this._shaderCache.set(r,a)}return a}adjustGl(){const e=this.getLogicalCanvasSize();this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`;const t=this.getPhysicalCanvasSize(e);this.canvas.width=t.width,this.canvas.height=t.height,Lre(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(e){return e=e||this.getLogicalCanvasSize(),{width:e.width*this.dpr,height:e.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const e=this._sizeSource(),t=window.getComputedStyle(this._container,null),i=e.width??this._container.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight),s=e.height??this._container.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return this._logicalCanvasSize={width:i,height:s},this._logicalCanvasSize}readPickingPixel(e,t){const i=this.gl;e*=this.dpr,t*=this.dpr;const s=this.getPhysicalCanvasSize().height,o=new Uint8Array(4);return i.bindFramebuffer(i.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),i.readPixels(e,s-t-1,1,1,i.RGBA,i.UNSIGNED_BYTE,o),i.bindFramebuffer(i.FRAMEBUFFER,null),o}clearAll(){const e=this.gl,{width:t,height:i}=this.getPhysicalCanvasSize();e.viewport(0,0,t,i),e.disable(e.SCISSOR_TEST),e.clearColor(...this._clearColor),e.clear(e.COLOR_BUFFER_BIT)}createRangeTexture(e,t=!1){const i=this.rangeTextures.get(e);if(!t&&i)return;function s(r,a){return Ua(a.type)?a.domain().length:a.type=="threshold"?a.domain().length+1:a.type=="quantize"||a.type=="quantile"?r??4:r}const o=e.channel;if(xh(o)){const r=e.getScaleProps(),a=e.getScale(),l=a.range();let c;if(r.scheme)if(a.type=="threshold"&&l)c=KE(l,this.gl,a.domain().length,i);else{let d=Di(r.scheme)?void 0:r.scheme.count;d=s(d,a),c=nae(r.scheme,this.gl,d,i)}else Yx(a.type)||rs(a.type)&&l.length>2?c=sae(l,r.interpolate,this.gl,i):c=KE(l,this.gl,a.domain().length,i);this.rangeTextures.set(e,c)}else{const r=e.getScale();if(r.type==="ordinal"||Vu(r.type)){const a=Jx(o)?KV(o):c=>c,l=e.getScale().range();this.rangeTextures.set(e,oae(l.map(a),this.gl,r.domain().length,i))}}}}function aae(n,e="",t=0){const i=/ERROR:\s*\d+:(\d+)/gi,s=[...e.matchAll(i)],o=new Map(s.map((r,a)=>{const l=parseInt(r[1]),c=s[a+1],d=c?c.index:e.length,u=e.substring(r.index,d);return[l-1,u]}));return n.split(` +`);a=o.createShader(e),o.shaderSource(a,l),o.compileShader(a),this._shaderCache.set(r,a)}return a}adjustGl(){const e=this.getLogicalCanvasSize();this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`;const t=this.getPhysicalCanvasSize(e);this.canvas.width=t.width,this.canvas.height=t.height,Rre(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(e){return e=e||this.getLogicalCanvasSize(),{width:e.width*this.dpr,height:e.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const e=this._sizeSource(),t=window.getComputedStyle(this._container,null),i=e.width??this._container.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight),s=e.height??this._container.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return this._logicalCanvasSize={width:i,height:s},this._logicalCanvasSize}readPickingPixel(e,t){const i=this.gl;e*=this.dpr,t*=this.dpr;const s=this.getPhysicalCanvasSize().height,o=new Uint8Array(4);return i.bindFramebuffer(i.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),i.readPixels(e,s-t-1,1,1,i.RGBA,i.UNSIGNED_BYTE,o),i.bindFramebuffer(i.FRAMEBUFFER,null),o}clearAll(){const e=this.gl,{width:t,height:i}=this.getPhysicalCanvasSize();e.viewport(0,0,t,i),e.disable(e.SCISSOR_TEST),e.clearColor(...this._clearColor),e.clear(e.COLOR_BUFFER_BIT)}createRangeTexture(e,t=!1){const i=this.rangeTextures.get(e);if(!t&&i)return;function s(r,a){return Ua(a.type)?a.domain().length:a.type=="threshold"?a.domain().length+1:a.type=="quantize"||a.type=="quantile"?r??4:r}const o=e.channel;if(Wd(o)){const r=e.scale,a=r.props,l=r.range();let c;if(a.scheme)if(r.type=="threshold"&&l)c=JE(l,this.gl,r.domain().length,i);else{let d=Ei(a.scheme)?void 0:a.scheme.count;d=s(d,r),c=nae(a.scheme,this.gl,d,i)}else iL(r.type)||rs(r.type)&&l.length>1?c=sae(l,a.interpolate,this.gl,i):c=JE(l,this.gl,r.domain().length,i);this.rangeTextures.set(e,c)}else{const r=e.scale;if(r.type==="ordinal"||ju(r.type)){const a=wL(o)?bz(o):c=>c,l=r.range();this.rangeTextures.set(e,oae(l.map(a),this.gl,r.domain().length,i))}}}}function aae(n,e="",t=0){const i=/ERROR:\s*\d+:(\d+)/gi,s=[...e.matchAll(i)],o=new Map(s.map((r,a)=>{const l=parseInt(r[1]),c=s[a+1],d=c?c.index:e.length,u=e.substring(r.index,d);return[l-1,u]}));return n.split(` `).map((r,a)=>{const l=o.get(a);return`${a+1+t}: ${r}${l?` ^^^ ${l}`:""}`}).join(` `)}function lae(n,e,t){const i=n.createProgram();n.attachShader(i,e),n.attachShader(i,t),n.linkProgram(i);function s(){let o,r;if(!n.getProgramParameter(i,n.LINK_STATUS)){o=n.getProgramInfoLog(i);for(const l of[e,t])n.getShaderParameter(l,n.COMPILE_STATUS)||(o=n.getShaderInfoLog(l),r=aae(n.getShaderSource(l),o,0)+` -Error compiling: ${o}`,n.deleteShader(l));n.deleteProgram(i)}if(o)return{message:o,detail:r}}return{program:i,getProgramErrors:s}}function hL(n,e,t,i){return i?pH(n,i,t,e):i=ob(n,{...e,src:t}),i}function cae(...n){const e={get(t,i,s){for(const o of n){const a=o()[i];if(a!==void 0)return a}},has(t,i,s){for(const o of n){const r=o();if(i in r)return!0}return!1}};return new Proxy({},e)}function dae(n){return Di(n)||Xs(n)||Wv(n)}class Dh extends Error{constructor(e,t){super(e),this.name="ViewError",this.view=t}}const uae="SAMPLE_FACET_UNIFORM",yO="SAMPLE_FACET_TEXTURE";class n1{constructor(e){this.unitView=e,this.encoders=void 0,this.bufferInfo=void 0,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.domainUniformInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.rangeMap=new hae,this.defaultProperties={get clip(){return["x","y"].map(t=>e.getScaleResolution(t)).some(t=>(t==null?void 0:t.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=cae(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const e={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(e.uniqueId={field:"_uniqueId"}),e}fixEncoding(e){return e}get encoding(){return zp(this,"encoding",()=>{var r;const e=this.getDefaultEncoding(),t=this.unitView.getEncoding(),i=a=>{const l=this.properties[a];return dae(l)&&{value:l}},s=Object.fromEntries(this.getSupportedChannels().map(a=>[a,i(a)]).filter(a=>a[1].value!==void 0)),o=this.fixEncoding({...e,...s,...t});for(const a of Object.keys(o))this.getSupportedChannels().includes(a)||delete o[a];return o.x&&((r=o.x).buildIndex??(r.buildIndex=!0)),o})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=Oie(this)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return yO;if(this.unitView.getLayoutAncestors().find(e=>"samples"in e.spec))return uae}createAndLinkShaders(e,t,i=[]){const s=this.getAttributes(),o="// view: "+this.unitView.getPathString();this.domainUniforms=[];let r=[];const a=new Set,l=QH(this.encoders),c=this.getSampleFacetMode();c&&i.push(`#define ${c}`);for(const p of s){let _;if(p in this.encoding)_=p;else continue;const v=this.encoding[_];if(v)if(Zr(v))r.push(Pre(_,v.value));else{const b=_o(v)&&v.resolutionChannel||_,w=Lh(b)?this.unitView.getScaleResolution(b).getScale():Xx(),y=wf(v)?l.get([v.field,!0]):[_],S=Ore(_,w,v,y!=null&&y.includes(_)?y:[_]);r.push(S.glsl),S.domainUniform&&this.domainUniforms.push(S.domainUniform),S.attributeGlsl&&a.add(S.attributeGlsl)}}const d=this.domainUniforms.length?`layout(std140) uniform Domains { -`+this.domainUniforms.map(p=>` ${p} -`).join("")+`}; +Error compiling: ${o}`,n.deleteShader(l));n.deleteProgram(i)}if(o)return{message:o,detail:r}}return{program:i,getProgramErrors:s}}function bL(n,e,t,i){return i?xH(n,i,t,e):i=ob(n,{...e,src:t}),i}function cae(...n){const e={get(t,i,s){for(const o of n){const a=o()[i];if(a!==void 0)return a}},has(t,i,s){for(const o of n){const r=o();if(i in r)return!0}return!1}};return new Proxy({},e)}function dae(n){return Ei(n)||Xs(n)||qv(n)}class kh extends Error{constructor(e,t){super(e),this.name="ViewError",this.view=t}}const uae="SAMPLE_FACET_UNIFORM",NO="SAMPLE_FACET_TEXTURE";var Dl;class l1{constructor(e){Fe(this,Dl,[]);this.unitView=e,this.encoders=void 0,this.bufferInfo=void 0,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.domainUniformInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.rangeMap=new hae,this.defaultProperties={get clip(){return["x","y"].map(t=>e.getScaleResolution(t)).some(t=>(t==null?void 0:t.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=cae(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const e={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(e.uniqueId={field:"_uniqueId"}),e}fixEncoding(e){return e}get encoding(){return _L(this,"encoding",()=>{var r;const e=this.getDefaultEncoding(),t=this.unitView.getEncoding(),i=a=>{const l=this.properties[a];return dae(l)||Kl(l)?{value:l}:void 0},s=Object.fromEntries(this.getSupportedChannels().map(a=>[a,i(a)]).filter(a=>pr(a[1]))),o=this.fixEncoding({...e,...s,...t});for(const a of Object.keys(o))this.getSupportedChannels().includes(a)||delete o[a];return o.x&&((r=o.x).buildIndex??(r.buildIndex=!0)),o})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=fae(this)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return NO;if(this.unitView.getLayoutAncestors().find(e=>"samples"in e.spec))return uae}createAndLinkShaders(e,t,i=[]){const s=this.getAttributes(),o="// view: "+this.unitView.getPathString();let r=[];const a=new Set,l=cz(this.encoders),c=this.getSampleFacetMode();c&&i.push(`#define ${c}`);const d=[];for(const _ of s){let v;if(_ in this.encoding)v=_;else continue;const b=this.encoding[v];if(b)if(pr(b))if(Kl(b.value)){const{uniformName:w,uniformGlsl:y,scaleGlsl:S,adjuster:L}=Ure(v);r.push(S),d.push(y),me(this,Dl).push(()=>{this.registerMarkUniformValue(w,b.value,L)})}else r.push($re(v,b.value));else{const w=Bo(b)&&b.resolutionChannel||v,y=Up(w)?this.unitView.getScaleResolution(w):null,S=wf(b)?l.get([b.field,!0]):[v],L=jre(v,y,b,S!=null&&S.includes(v)?S:[v]);if(r.push(L.glsl),d.push(L.domainUniform),d.push(L.rangeUniform),a.add(L.attributeGlsl),L.rangeUniform&&me(this,Dl).push(()=>{const x=this.createMarkUniformSetter(L.rangeName),D=()=>x(uz(y.scale,v));y.addEventListener("range",D),D()}),L.markUniformGlsl){if(!c1(b))throw new Error("Bug!");const x=this.encoders[v],D=x.indexer,P=WC(x.scale.type)&&UR(x.scale.domain()),O=D||(P?lz:R=>+R);d.push(L.markUniformGlsl),me(this,Dl).push(()=>{this.registerMarkUniformValue(L.attributeName,b.datum,O)})}L.domainUniform&&me(this,Dl).push(()=>{const x=this.createMarkUniformSetter(L.domainUniformName),D=y.scale,k=()=>{const P=Ua(D.type)?[0,D.domain().length]:D.domain();x(WC(D.type)?Zre(P):P)};y.addEventListener("domain",k),k()})}}const u=`precision highp float; +precision highp int;`,h=_=>_.replace("#pragma markUniforms",d.join(` +`));i=i.map(h),e=h(e),t=h(t);const f=[u,o,...i,TO,Qre,[...a].join(` +`),...r,Jre,eae,e],g=[u,o,...i,TO,tae,t],p=this.gl;this.programStatus=lae(p,this.glHelper.compileShader(p.VERTEX_SHADER,f),this.glHelper.compileShader(p.FRAGMENT_SHADER,g))}finalizeGraphicsInitialization(){const e=this.programStatus.getProgramErrors();if(e){e.detail&&console.warn(e.detail);const t=new Error("Cannot create shader program: "+e.message);throw t.view=this.unitView,t}this.programInfo=mre(this.gl,this.programStatus.program),delete this.programStatus,this.viewUniformInfo=xO(this.gl,this.programInfo,"View"),this.markUniformInfo=xO(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),Yg(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0});for(const t of me(this,Dl))t();_i(this,Dl,void 0)}createMarkUniformSetter(e){const t=this.markUniformInfo.setters[e];if(!t)throw new Error(`Uniform "${e}" not found int the Mark block!`);return i=>{t(i),this.markUniformsAltered=!0,this.unitView.context.animator.requestRender()}}registerMarkUniformValue(e,t,i=s=>s){const s=this.createMarkUniformSetter(e);if(Kl(t)){const o=this.unitView.context.paramBroker.createExpression(t.expr),r=()=>s(i(o(null)));o.addListener(r),r()}else s(i(t))}deleteGraphicsData(){if(this.bufferInfo){const e=this.gl;for(let t=0;t<8;t++)e.disableVertexAttribArray(t);Object.values(this.bufferInfo.attribs).forEach(t=>this.gl.deleteBuffer(t.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(e){if(this.gl.bindVertexArray(null),this.bufferInfo&&e.vertexCount<=this.bufferInfo.allocatedVertices)for(const[t,i]of Object.entries(e.arrays))i.data&&Ine(this.gl,this.bufferInfo.attribs[t],i.data,0);else this.deleteGraphicsData(),this.bufferInfo=Nne(this.gl,e.arrays,{numElements:e.vertexCount}),this.bufferInfo.allocatedVertices=e.allocatedVertices,this.vertexArrayInfo=void 0}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null)return!1;for(const e of this.unitView.getLayoutAncestors())if(!e.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(LO(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):ZH(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(e){const t=this.glHelper,i=this.gl,s=[];s.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=Pre(this.gl,this.programInfo,this.bufferInfo)),i.useProgram(this.programInfo.program)});for(const[r,a]of Object.entries(this.encoding))if(Bo(a)){const l=Bo(a)&&a.resolutionChannel||r;if(Up(l)){const c=this.unitView.getScaleResolution(l),d=t.rangeTextures.get(c);d&&s.push(()=>Yg(this.programInfo,{[XE+r]:d}))}}this.getSampleFacetMode()==NO&&s.push(()=>{let r;for(const a of this.unitView.getLayoutAncestors())if(r=a.getSampleFacetTexture(),r)break;if(!r)throw new Error("No facet texture available. This is bug.");Yg(this.programInfo,{uSampleFacetTexture:r})});const o=(e.picking??!1)&&this.isPickingParticipant();return s.push(()=>$p(this.viewUniformInfo,{uViewOpacity:this.unitView.getEffectiveOpacity(),uPickingEnabled:o})),this.opaque||e.picking?s.push(()=>i.disable(i.BLEND)):s.push(()=>i.enable(i.BLEND)),s}prepareSampleFacetRendering(e){const t=e.sampleFacetRenderingOptions,i=this.programInfo.uniformSetters.uSampleFacet;if(t&&i){const s=t.locSize?t.locSize.location:0,o=t.locSize?t.locSize.size:1;if(s>1||s+o<0)return!1;const r=t.targetLocSize?t.targetLocSize.location:s,a=t.targetLocSize?t.targetLocSize.size:o;this.gl.uniform4f(i.location,s,o,r,a)}return!0}render(e){}createRenderCallback(e,t){var u;if(!this.bufferInfo)throw new kh(`${this.getType()} mark has no data. This is bug.`,this.unitView);const i=this;let s;const o=(u=this.unitView.getScaleResolution("x"))==null?void 0:u.scale,r=o&&rs(o.type),a=["index","locus"].includes(o==null?void 0:o.type)?-1:0,l=[0,0];s=h=>{if(r&&h.xIndex){const f=o.domain(),g=h.xIndex(f[0]+a,f[1],l),p=g[0],_=g[1]-p;_>0&&e(p,_)}else e(h.offset,h.count)};const c=this.rangeMap.get(void 0).count==0?t.facetId:void 0,d=this.rangeMap.get(c);return t.sampleFacetRenderingOptions?function(){d.count&&i.prepareSampleFacetRendering(t)&&s(d)}:function(){d.count&&s(d)}}setViewport(e,t){e=e.flatten();const i=this.unitView.context.devicePixelRatio,s=this.gl,o=this.properties,r=this.glHelper.getLogicalCanvasSize(),a=.5,l=(o.xOffset??0)+a,c=(o.yOffset??0)+a;let d,u=e;if(o.clip!=="never"&&(o.clip||t)){let h=0,f=0,g;if(t){if(u=e.intersect(t).flatten(),!u.isDefined())return!1;g=[e.width/u.width,e.height/u.height],f=Math.max(0,e.y2-t.y2),h=Math.min(0,e.x-t.x)}else g=[1,1];const p=[u.x,r.height-u.y2,u.width,u.height].map(w=>w*i),_=p.map(w=>Math.round(w)),[v,b]=p.map((w,y)=>w-_[y]);s.viewport(..._),s.scissor(..._),s.enable(s.SCISSOR_TEST),d={uViewOffset:[(l+h+v/i)/u.width,-(c+f-b/i)/u.height],uViewScale:g}}else{if(!e.isDefined())return!1;s.viewport(0,0,r.width*i,r.height*i),s.disable(s.SCISSOR_TEST),d={uViewOffset:[(e.x+l)/r.width,(r.height-e.y-c-e.height)/r.height],uViewScale:[e.width/r.width,e.height/r.height]}}return $p(this.viewUniformInfo,{...d,uViewportSize:[e.width,e.height],uDevicePixelRatio:i}),LO(this.gl,this.programInfo,this.viewUniformInfo),!0}findDatumAt(e,t){}}Dl=new WeakMap;let hae=class extends Ad{constructor(){super([],JSON.stringify)}get(e){let t=super.get(e);return t===void 0&&(t={offset:0,count:0,xIndex:void 0},super.set(e,t)),t}migrateEntries(e){for(const[t,i]of e.entries())Object.assign(this.get(t),i)}};function Kl(n){return typeof n=="object"&&n!=null&&"expr"in n&&Ei(n.expr)}function fae(n,e){const t={};e||(e=n.encoding);for(const[i,s]of Object.entries(e)){if(!s)continue;const o=((Bo(s)&&s.resolutionChannel)??(Up(i)&&i))||void 0,r=n.unitView.getScaleResolution(o);t[i]=gae(e[i],r==null?void 0:r.scale,n.unitView.getAccessor(i),i)}return t}function gae(n,e,t,i){let s;if(pr(n))if(Kl(n.value))s=o=>{},s.constant=!0,s.constantValue=!1,s.accessor=t;else{const o=n.value;s=r=>o,s.constant=!0,s.constantValue=!0,s.accessor=void 0}else if(t)if(i=="text")s=o=>{},s.accessor=t,s.constant=t.constant;else{if(!e)if(!Up(i))e=sL();else throw new Error(`Missing scale! "${i}": ${JSON.stringify(n)}`);if(s=o=>e(t(o)),Ua(e.type)){const o=Qie();o.addAll(e.domain()),s.indexer=o}s.constant=t.constant,s.accessor=t,s.scale=e}else throw new Error(`Missing value or accessor (field, expr, datum) on channel "${i}": ${JSON.stringify(n)}`);return s.invert=e?o=>e.invert(o):o=>{throw new Error("No scale available, cannot invert: "+JSON.stringify(n))},s.channelDef=n,s.applyMetadata=o=>{for(const r in s)r in s&&(o[r]=s[r]);return o},s}function pr(n){return n&&"value"in n}function wf(n){return n&&"field"in n}function c1(n){return n&&"datum"in n}function Bo(n){return wf(n)||c1(n)||vL(n)||pz(n)}function eI(n,e){const t=n.mark.encoding[e];if(Bo(t))return t;throw new Error("Not a channel def with scale!")}function pz(n){return n&&"chrom"in n}function vL(n){return n&&"expr"in n}const Im=["x","y"],pae=["x2","y2"],mae=[...Im,...pae];function mz(n){return Im.includes(n)}function ab(n){return mae.includes(n)}const jR={x:"x2",y:"y2"},_z=Object.fromEntries(Object.entries(jR).map(n=>[n[1],n[0]]));function s_(n){return n in _z}function _ae(n){const e=jR[n];if(e)return e;throw new Error(`${n} has no secondary channel!`)}function Zh(n){return _z[n]??n}function Wd(n){return["color","fill","stroke"].includes(Zh(n))}function wL(n){return["shape","squeeze"].includes(n)}function Up(n){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy","sample"].includes(n)}function bae(n){switch(n){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function bz(n){if(!wL(n))throw new Error("Not a discrete channel: "+n);const e=new Map(bae(n).map((t,i)=>[t,i]));return t=>{const i=e.get(t);if(i!==void 0)return i;throw new Error(`Invalid value for "${n}" channel: ${t}`)}}function Si(n,e=n){if(/^[A-Za-z0-9_]+$/.test(n)){const t=new Function("datum",`return datum[${JSON.stringify(n)}]`);return eu(t,[n],e)}else return Px(n)}class vae{constructor(){this.accessorCreators=[],this.register(e=>{if(wf(e))try{const t=Si(e.field);return t.constant=!1,t.fields=uW(t),t}catch(t){throw new Error(`Invalid field definition: ${t.message}`)}}),this.register(e=>vL(e)?wae(e.expr):void 0),this.register(e=>{if(c1(e)){const i=WX(e.datum);return i.constant=!0,i.fields=[],i}})}register(e){this.accessorCreators.push(e)}createAccessor(e){for(const t of this.accessorCreators){const i=t(e);if(i)return i}}}function wae(n){const t=Kx(n);return t.constant=t.fields.length==0,t}const yae=`out lowp vec4 vFillColor; +out lowp vec4 vStrokeColor; +out float vHalfStrokeWidth; +out vec4 vCornerRadii; + +#if defined(ROUNDED_CORNERS) || defined(STROKED) +/** Position for SDF-strokes */ +out vec2 vPosInPixels; +#endif -`:"",h=[`precision highp float; -`,o,...i,wO,Jre,d,[...a].join(` -`),...r,eae,tae,e],f=[o,...i,wO,iae,t],g=this.gl;this.programStatus=lae(g,this.glHelper.compileShader(g.VERTEX_SHADER,h),this.glHelper.compileShader(g.FRAGMENT_SHADER,f))}finalizeGraphicsInitialization(){const e=this.programStatus.getProgramErrors();if(e){e.detail&&console.warn(e.detail);const t=new Error("Cannot create shader program: "+e.message);throw t.view=this.unitView,t}this.programInfo=are(this.gl,this.programStatus.program),delete this.programStatus,this.domainUniforms.length&&(this.domainUniformInfo=mk(this.gl,this.programInfo,"Domains")),this.viewUniformInfo=mk(this.gl,this.programInfo,"View"),this.markUniformInfo=mk(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),this._setDatums(),nh(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0})}registerMarkUniform(e,t,i=s=>s){const s=this.markUniformInfo.setters[e];if(rz(t)){const o=this.unitView.context.paramBroker.createExpression(t.expr),r=()=>{s(i(o(null))),this.markUniformsAltered=!0};o.addListener(r),r()}else s(i(t)),this.markUniformsAltered=!0}_setDatums(){for(const[e,t]of Object.entries(this.encoding))if(e1(t)){const i=this.encoders[e],s=i.indexer?i.indexer(t.datum):MC(i.scale.type)?Hre(+t.datum):+t.datum;nh(this.programInfo,{[RR+e]:s})}}deleteGraphicsData(){if(this.bufferInfo){const e=this.gl;for(let t=0;t<8;t++)e.disableVertexAttribArray(t);Object.values(this.bufferInfo.attribs).forEach(t=>this.gl.deleteBuffer(t.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(e){if(this.gl.bindVertexArray(null),this.bufferInfo&&e.vertexCount<=this.bufferInfo.allocatedVertices)for(const[t,i]of Object.entries(e.arrays))i.data&&wne(this.gl,this.bufferInfo.attribs[t],i.data,0);else this.deleteGraphicsData(),this.bufferInfo=Sne(this.gl,e.arrays,{numElements:e.vertexCount}),this.bufferInfo.allocatedVertices=e.allocatedVertices,this.vertexArrayInfo=void 0}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null)return!1;for(const e of this.unitView.getLayoutAncestors())if(!e.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(_k(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):HH(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(e){const t=this.glHelper,i=this.gl,s=[];if(s.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=Dre(this.gl,this.programInfo,this.bufferInfo)),i.useProgram(this.programInfo.program)}),this.domainUniformInfo){for(const[r,a]of Object.entries(this.domainUniformInfo.setters)){const l=r.substring(YH.length),c=this.encoding[l],d=_o(c)&&c.resolutionChannel||l;if(Lh(d)){const u=this.unitView.getScaleResolution(d).getScale();s.push(()=>{const h=Ua(u.type)?[0,u.domain().length]:u.domain();a(MC(u.type)?Ure(h):h)})}}s.push(()=>_k(i,this.programInfo,this.domainUniformInfo))}for(const[r,a]of Object.entries(this.encoding))if(_o(a)){const l=_o(a)&&a.resolutionChannel||r;if(Lh(l)){const c=this.unitView.getScaleResolution(l),d=t.rangeTextures.get(c);d&&s.push(()=>nh(this.programInfo,{[jE+r]:d}))}}this.getSampleFacetMode()==yO&&s.push(()=>{let r;for(const a of this.unitView.getLayoutAncestors())if(r=a.getSampleFacetTexture(),r)break;if(!r)throw new Error("No facet texture available. This is bug.");nh(this.programInfo,{uSampleFacetTexture:r})});const o=(e.picking??!1)&&this.isPickingParticipant();return s.push(()=>Hp(this.viewUniformInfo,{uViewOpacity:this.unitView.getEffectiveOpacity(),uPickingEnabled:o})),this.opaque||e.picking?s.push(()=>i.disable(i.BLEND)):s.push(()=>i.enable(i.BLEND)),s}prepareSampleFacetRendering(e){const t=e.sampleFacetRenderingOptions,i=this.programInfo.uniformSetters.uSampleFacet;if(t&&i){const s=t.locSize?t.locSize.location:0,o=t.locSize?t.locSize.size:1;if(s>1||s+o<0)return!1;const r=t.targetLocSize?t.targetLocSize.location:s,a=t.targetLocSize?t.targetLocSize.size:o;this.gl.uniform4f(i.location,s,o,r,a)}return!0}render(e){}createRenderCallback(e,t){var u;if(!this.bufferInfo)throw new Dh(`${this.getType()} mark has no data. This is bug.`,this.unitView);const i=this;let s;const o=(u=this.unitView.getScaleResolution("x"))==null?void 0:u.getScale(),r=o&&rs(o.type),a=["index","locus"].includes(o==null?void 0:o.type)?-1:0,l=[0,0];s=h=>{if(r&&h.xIndex){const f=o.domain(),g=h.xIndex(f[0]+a,f[1],l),p=g[0],_=g[1]-p;_>0&&e(p,_)}else e(h.offset,h.count)};const c=this.rangeMap.get(void 0).count==0?t.facetId:void 0,d=this.rangeMap.get(c);return t.sampleFacetRenderingOptions?function(){d.count&&i.prepareSampleFacetRendering(t)&&s(d)}:function(){d.count&&s(d)}}setViewport(e,t){e=e.flatten();const i=this.unitView.context.devicePixelRatio,s=this.gl,o=this.properties,r=this.glHelper.getLogicalCanvasSize(),a=.5,l=(o.xOffset??0)+a,c=(o.yOffset??0)+a;let d,u=e;if(o.clip!=="never"&&(o.clip||t)){let h=0,f=0,g;if(t){if(u=e.intersect(t).flatten(),!u.isDefined())return!1;g=[e.width/u.width,e.height/u.height],f=Math.max(0,e.y2-t.y2),h=Math.min(0,e.x-t.x)}else g=[1,1];const p=[u.x,r.height-u.y2,u.width,u.height].map(w=>w*i),_=p.map(w=>Math.round(w)),[v,b]=p.map((w,y)=>w-_[y]);s.viewport(..._),s.scissor(..._),s.enable(s.SCISSOR_TEST),d={uViewOffset:[(l+h+v/i)/u.width,-(c+f-b/i)/u.height],uViewScale:g}}else{if(!e.isDefined())return!1;s.viewport(0,0,r.width*i,r.height*i),s.disable(s.SCISSOR_TEST),d={uViewOffset:[(e.x+l)/r.width,(r.height-e.y-c-e.height)/r.height],uViewScale:[e.width/r.width,e.height/r.height]}}return Hp(this.viewUniformInfo,{...d,uViewportSize:[e.width,e.height],uDevicePixelRatio:i}),_k(this.gl,this.programInfo,this.viewUniformInfo),!0}findDatumAt(e,t){}}let hae=class extends kd{constructor(){super([],JSON.stringify)}get(e){let t=super.get(e);return t===void 0&&(t={offset:0,count:0,xIndex:void 0},super.set(e,t)),t}migrateEntries(e){for(const[t,i]of e.entries())Object.assign(this.get(t),i)}};function rz(n){return typeof n=="object"&&"expr"in n&&Di(n.expr)}function YE(n,e){const t=Vie(e);let i=n[e]&&{...n[e]},s=n[t]&&{...n[t]};if(!(Zr(i)||Zr(s))){if(i){if(!_o(n[e]))return;if(s){if(i.type!="quantitative"){const o=(1-(i.band||1))/2;i.band=o,s.band=-o}}else if(i.type=="quantitative")s={datum:0};else{s={...i};const o=(1-(i.band??1))/2;i.band=0+o,s.band=1-o}}else i={value:0},s={value:1};n[e]=i,n[t]=s}}function az(n,e){n.stroke||(e?n.stroke={value:null}:n.stroke={resolutionChannel:"color",...n.color}),Zr(n.stroke)&&n.stroke.value===null&&(n.strokeWidth={value:0}),n.strokeOpacity||(n.strokeOpacity={resolutionChannel:"opacity",...n.opacity})}function lz(n,e){Zr(n.fill)&&n.fill.value===null?n.fillOpacity={value:0}:n.fill||(n.fill={resolutionChannel:"color",...n.color},!e&&!n.fillOpacity&&(n.fillOpacity={value:0})),n.fillOpacity||(e?n.fillOpacity={resolutionChannel:"opacity",...n.opacity}:n.fillOpacity={value:0})}var vv,ZE,wv,XE;class fae extends n1{constructor(t){super(t);et(this,vv);et(this,wv);Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x2:void 0,y2:void 0,filled:!0,color:"#4c78a8",opacity:1,strokeWidth:3,cornerRadius:0,minWidth:.5,minHeight:.5,minOpacity:1,tessellationZoomThreshold:10,tessellationTiles:35}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}get opaque(){return zp(this,"opaque",()=>!tt(this,vv,ZE).call(this)&&!tt(this,wv,XE).call(this)&&Zr(this.encoding.fillOpacity)&&this.encoding.fillOpacity.value==1&&this.properties.minOpacity==1)&&this.unitView.getEffectiveOpacity()==1}fixEncoding(t){return YE(t,"x"),YE(t,"y"),az(t,this.properties.filled),lz(t,this.properties.filled),delete t.color,delete t.opacity,t}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}async initializeGraphics(){await super.initializeGraphics();const t=[];tt(this,vv,ZE).call(this)&&t.push("ROUNDED_CORNERS"),tt(this,wv,XE).call(this)&&t.push("STROKED"),this.createAndLinkShaders(Tre,Nre,t.map(i=>"#define "+i))}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniform("uMinWidth",t.minWidth),this.registerMarkUniform("uMinHeight",t.minHeight),this.registerMarkUniform("uMinOpacity",t.minOpacity),this.registerMarkUniform("uCornerRadiusTopRight",t.cornerRadiusTopRight??t.cornerRadius??0),this.registerMarkUniform("uCornerRadiusBottomRight",t.cornerRadiusBottomRight??t.cornerRadius??0),this.registerMarkUniform("uCornerRadiusTopLeft",t.cornerRadiusTopLeft??t.cornerRadius??0),this.registerMarkUniform("uCornerRadiusBottomLeft",t.cornerRadiusBottomLeft??t.cornerRadius??0)}updateGraphicsData(){const t=this.unitView.getCollector(),i=t.getItemCount(),s=new Kre({encoders:this.encoders,attributes:this.getAttributes(),numItems:i});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>Zh(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{dL(i,this.vertexArrayInfo,i.TRIANGLE_STRIP,o,s)},t)}findDatumAt(t,i){t=qs(t);const s=this.unitView.getCollector().facetBatches.get(t);if(!s)return;const o=this.encoders,r=o.x.scale.type;if(Ua(r)){const a=o.x.accessor;return s.find(l=>i==a(l))}else{const a=o.x.accessor,l=o.x2.accessor;return s.find(c=>i>=a(c)&&i 0.0 && abs(size) < minSize) { + pos += (frac - 0.5) * (minSize * sign(size) - size); + return abs(size) / minSize; + } + + return 1.0; +} + +void sort(inout float a, inout float b) { + if (a > b) { + float tmp = b; + b = a; + a = tmp; + } +} + +/** + * The vertex position wrt the rectangle specified by (x, x2, y, y2). + * [0, 0] = [x, y], [1, 1] = [x2, y2]. + * The x or y component may contain fractional values if the rectangle + * have been tessellated. + */ +vec2 getVertexPos() { + int index = gl_VertexID % 6; + return vec2( + index == 0 || index == 1 || index == 3 ? 0.0 : 1.0, + index == 0 || index == 1 || index == 2 ? 0.0 : 1.0 + ); + +} + +void main(void) { + vec2 frac = getVertexPos(); + + vec2 normalizedMinSize = vec2(uMinWidth, uMinHeight) / uViewportSize; + vec4 cornerRadii = vec4( + uCornerRadiusTopRight, + uCornerRadiusBottomRight, + uCornerRadiusBottomLeft, + uCornerRadiusTopLeft + ); + + float x = getScaled_x(); + float x2 = getScaled_x2(); + float y = getScaled_y(); + float y2 = getScaled_y2(); + + sort(x, x2); + sort(y, y2); + + // Clamp x to prevent precision artifacts when the scale is zoomed very close. + // TODO: clamp y as well + float clampMargin = 1.0; + vec2 pos1 = vec2(clamp(x, 0.0 - clampMargin, 1.0 + clampMargin), y); + vec2 pos2 = vec2(clamp(x2, 0.0 - clampMargin, 1.0 + clampMargin), y2); + + vec2 size = pos2 - pos1; + + if (size.x <= 0.0 || size.y <= 0.0) { + // Early exit. May increase performance or not... + gl_Position = vec4(0.0, 0.0, 0.0, 1.0); + return; + } + + vec2 pos = pos1 + frac * size; + + size.y *= getSampleFacetHeight(pos); + + // Clamp to minimum size, optionally compensate with opacity + float opaFactor = uViewOpacity * max(uMinOpacity, + clampMinSize(pos.x, frac.x, size.x, normalizedMinSize.x) * + clampMinSize(pos.y, frac.y, size.y, normalizedMinSize.y)); + + pos = applySampleFacet(pos); + +#if defined(ROUNDED_CORNERS) || defined(STROKED) + // Add an extra pixel to stroke width to accommodate edge antialiasing + float aaPadding = 1.0 / uDevicePixelRatio; + float strokeWidth = getScaled_strokeWidth(); + float strokeOpacity = getScaled_strokeOpacity() * opaFactor; + + vec2 centeredFrac = frac - 0.5; + vec2 expand = centeredFrac * (strokeWidth + aaPadding) / uViewportSize; + pos += expand; + + vec2 sizeInPixels = size * uViewportSize; + vPosInPixels = (centeredFrac + expand / size) * sizeInPixels; + + vHalfSizeInPixels = sizeInPixels / 2.0; + + vCornerRadii = min(cornerRadii, min(vHalfSizeInPixels.x, vHalfSizeInPixels.y)); + vHalfStrokeWidth = strokeWidth / 2.0; + vStrokeColor = vec4(getScaled_stroke() * strokeOpacity, strokeOpacity); +#endif + + gl_Position = unitToNdc(pos); + + float fillOpacity = getScaled_fillOpacity() * opaFactor; + vFillColor = vec4(getScaled_fill() * fillOpacity, fillOpacity); + + setupPicking(); +} +`,Cae=`#if defined(ROUNDED_CORNERS) || defined(STROKED) +in vec2 vPosInPixels; +#endif + +in vec2 vHalfSizeInPixels; + +in lowp vec4 vFillColor; +in lowp vec4 vStrokeColor; +in float vHalfStrokeWidth; +in vec4 vCornerRadii; + +out lowp vec4 fragColor; + +// Source: https://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm +float sdRoundedBox(vec2 p, vec2 b, vec4 r) { + r.xy = p.x > 0.0 ? r.xy : r.zw; + r.x = p.y > 0.0 ? r.x : r.y; + vec2 q = abs(p) - b + r.x; + return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r.x; +} + +// Not a true SDF. Makes the corners of strokes sharp and is faster. +float sdSharpBox(vec2 p, vec2 b) { + vec2 q = abs(p) - b; + return max(q.x, q.y); +} + +void main(void) { + +#if defined(ROUNDED_CORNERS) || defined(STROKED) +#ifdef ROUNDED_CORNERS + // Distance from rectangle's edge in pixels. Negative inside the rectangle. + float d = sdRoundedBox(vPosInPixels, vHalfSizeInPixels, vCornerRadii); +#else + float d = sdSharpBox(vPosInPixels, vHalfSizeInPixels); +#endif + + fragColor = distanceToColor(d, vFillColor, vStrokeColor, vHalfStrokeWidth); + + if (fragColor.a == 0.0) { + discard; + } +#else + // The trivial, non-decorated case + fragColor = vFillColor; +#endif + + if (uPickingEnabled) { + fragColor = vPickingColor; + } +} +`,Sae=`layout(std140) uniform Mark { + /** Minimum size (width, height) of the displayed rectangle in pixels */ + uniform float uMinWidth; + uniform float uMinHeight; + + /** Minimum opacity for the size clamping */ + uniform float uMinOpacity; + + uniform float uCornerRadiusTopRight; + uniform float uCornerRadiusBottomRight; + uniform float uCornerRadiusTopLeft; + uniform float uCornerRadiusBottomLeft; + +#pragma markUniforms +}; +`,MO=1e4;var wv,wx,vz,yx,wz;class xae{constructor(e){Fe(this,wx);Fe(this,yx);Fe(this,wv,!1);this.size=e,this.arrays={},this.pushers=[],this.dataUpdaters=[],this.vertexCount=0}configure(){if(me(this,wv))throw new Error("Already configured!");Be(this,wx,vz).call(this),Be(this,yx,wz).call(this),_i(this,wv,!0)}addConverter(e,t){const i=this.createUpdater(sz+e,t.numComponents||1,t.targetArrayType??Float32Array,t.arrayReference),s=t.f;this.dataUpdaters.push(t.arrayReference?o=>i(s(o)):o=>i(s(o)))}createUpdater(e,t,i=Float32Array,s=void 0){if(!Xs(this.size))throw new Error("The number of vertices must be defined!");let o,r,a=0;const l=new i(this.size*t);if(this.arrays[e]={data:l,numComponents:t},t==1){let c=0;const d=u=>{c=+u};o=()=>{l[a++]=c},r=d}else{let c=s??[0];const d=s?u=>{}:u=>{c=u};switch(t){case 1:break;case 2:o=()=>{l[a++]=c[0],l[a++]=c[1]},r=d;break;case 3:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2]},r=d;break;case 4:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2],l[a++]=c[3]},r=d;break;default:throw new Error("Invalid numComponents: "+t)}}return this.pushers.push(o),r}pushAll(){throw new Error("Call configure() first!")}updateFromDatum(e){throw new Error("Call configure() first!")}pushFromDatum(e){this.updateFromDatum(e),this.pushAll()}}wv=new WeakMap,wx=new WeakSet,vz=function(){if(this.size>MO){const e=this.pushers.map((i,s)=>`const p${s} = that.pushers[${s}];`).join(` +`),t=this.pushers.map((i,s)=>` p${s}();`).join(` +`);this.pushAll=new Function("that",`${e} +return function unrolledPushAll() { +${t} + that.vertexCount++; +};`)(this)}else this.pushAll=()=>{for(let e=0;eMO){const e=this.dataUpdaters.map((i,s)=>`const u${s} = that.dataUpdaters[${s}];`).join(` +`),t=this.dataUpdaters.map((i,s)=>` u${s}(datum);`).join(` +`);this.updateFromDatum=new Function("that","datum",`${e} +return function unrolledUpdateFromDatum(datum) { +${t} +};`)(this)}else this.updateFromDatum=e=>{for(let t=0;t{const w=(v-c)/u,y=Math.floor(w);return eb(b&&y==w?y-1:y,0,n-1)};function f(v,b,w){if(a)return;if(b>o)o=b;else{a=!0,console.debug("Items are not ordered properly. Disabling binned index.");return}const y=t(v);if(yb&&(s[S]=b),l[S]o)o=b;else{a=!0,console.debug("Items (vertices) are not ordered properly. Disabling binned index.");return}const y=t(v),S=i(v);if(yb&&(s[D]=b),l[D]{const y=h(v,!1),S=h(b,!0),L=s[y],x=Math.max(l[S],L);return w[0]=L,w[1]=x,w},_=()=>{if(a)return;for(let b=1;b0;b--)v&&s[b]==RO?(s[b]=l[b],v=!1):s[b-1]>s[b]&&(s[b-1]=s[b]);return p};return f.getIndex=_,g.getIndex=_,t==i?f:g}class d1{constructor({encoders:e,numVertices:t=void 0,attributes:i=[]}){this.encoders=e,this.variableEncoders=Object.fromEntries(Object.entries(e).filter(([o,r])=>i.includes(o)&&r&&r.scale&&!r.constant));const s=[...cz(e).entries()].filter(([o,r])=>o[1]&&r.length>1).map(([o,r])=>r);this.allocatedVertices=t,this.variableBuilder=new xae(t);for(const[o,r]of Object.entries(this.variableEncoders)){const a=s.find(p=>p.find(_=>_==o));if(a&&o!=a[0])continue;const l=r.accessor,c=WC(r.scale.type),d=c&&UR(r.scale.domain()),u=[0,0],h=r.indexer,f=h?p=>h(l(p)):d?p=>lz(l(p),u):l,g=a?dz(a):o;this.variableBuilder.addConverter(g,{f,numComponents:d?2:1,arrayReference:d?u:void 0,targetArrayType:Ua(r.scale.type)?Uint16Array:c?Uint32Array:Float32Array})}this.lastOffset=0,this.rangeMap=new Ad([],JSON.stringify)}registerBatch(e){var o;const t=this.lastOffset,i=this.variableBuilder.vertexCount,s=i-t;s&&this.rangeMap.set(e,{offset:t,count:s,xIndex:(o=this.xIndexer)==null?void 0:o.getIndex()}),this.lastOffset=i}addBatches(e){for(const[t,i]of e)this.addBatch(t,i)}addBatch(e,t,i=0,s=t.length){this.prepareXIndexer(t,i,s);for(let o=i;o{this.addToXIndex=d=>{},this.xIndexer=void 0},o=(c=this.encoders.x)==null?void 0:c.channelDef;if(!("buildIndex"in o)||!o.buildIndex||!e.length||i-t<0){s();return}const r=d=>{var u;return d&&rs((u=d.scale)==null?void 0:u.type)&&d},a=r(this.variableEncoders.x),l=r(this.variableEncoders.x2);if(a){const d=a.accessor,u=l?l.accessor:d,h=[d(e[t]),u(e[i-1])];if(h[1]>h[0]){this.xIndexer=Dae(50,h,d,u);let f=this.variableBuilder.vertexCount;this.addToXIndex=g=>{let p=this.variableBuilder.vertexCount;this.xIndexer(g,f,p),f=p}}else s()}else s()}addToXIndex(e){}toArrays(){return{arrays:this.variableBuilder.arrays,vertexCount:this.variableBuilder.vertexCount,allocatedVertices:this.allocatedVertices,rangeMap:this.rangeMap}}}class kae extends d1{constructor({encoders:e,attributes:t,numItems:i}){super({encoders:e,attributes:t,numVertices:i*6}),this.variableBuilder.configure();const s=this.variableBuilder.pushAll;this.pushAllSixTimes=i>500?new Function("pushAll",`return function unrolledPushAllSixTimes() { + pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); +};`)(s):function(){s(),s(),s(),s(),s(),s()}}addBatch(e,t,i=0,s=t.length){if(!(s<=i)){this.prepareXIndexer(t,i,s);for(let o=i;ol,this.updateVertexCoord=this.variableBuilder.createUpdater("vertexCoord",2),this.updateTextureCoord=this.variableBuilder.createUpdater("textureCoord",2),this.updateWidth=this.variableBuilder.createUpdater("width",1),this.variableBuilder.configure()}addBatch(e,t,i=0,s=t.length){const o=this.properties.align||"left",r=this.properties.logoLetters??!1,a=this.metadata.common.base,l=this.metadata.common.scaleH;let c=-vg;switch(this.properties.baseline){case"top":c+=this.metrics.capHeight;break;case"middle":c+=this.metrics.capHeight/2;break;case"bottom":c-=this.metrics.descent;break}const d=this.encoders.text.accessor||this.encoders.text,u=[0,0];this.updateVertexCoord(u);const h=[0,0];this.updateTextureCoord(h),this.prepareXIndexer(t,i,s);for(let f=i;f!Be(this,yv,nI).call(this)&&!Be(this,Cv,sI).call(this)&&pr(this.encoding.fillOpacity)&&this.encoding.fillOpacity.value==1&&this.properties.minOpacity==1)&&this.unitView.getEffectiveOpacity()==1}fixEncoding(t){return iI(t,"x"),iI(t,"y"),yz(t,this.properties.filled),Cz(t,this.properties.filled),delete t.color,delete t.opacity,t}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}async initializeGraphics(){await super.initializeGraphics();const t=[];Be(this,yv,nI).call(this)&&t.push("ROUNDED_CORNERS"),Be(this,Cv,sI).call(this)&&t.push("STROKED"),this.createAndLinkShaders(yae,Cae,[Sae,...t.map(i=>"#define "+i)])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniformValue("uMinWidth",t.minWidth),this.registerMarkUniformValue("uMinHeight",t.minHeight),this.registerMarkUniformValue("uMinOpacity",t.minOpacity),this.registerMarkUniformValue("uCornerRadiusTopRight",t.cornerRadiusTopRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomRight",t.cornerRadiusBottomRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusTopLeft",t.cornerRadiusTopLeft??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomLeft",t.cornerRadiusBottomLeft??t.cornerRadius??0)}updateGraphicsData(){const t=this.unitView.getCollector(),i=t.getItemCount(),s=new kae({encoders:this.encoders,attributes:this.getAttributes(),numItems:i});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>Yh(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{pL(i,this.vertexArrayInfo,i.TRIANGLE_STRIP,o,s)},t)}findDatumAt(t,i){t=js(t);const s=this.unitView.getCollector().facetBatches.get(t);if(!s)return;const o=this.encoders,r=o.x.scale.type;if(Ua(r)){const a=o.x.accessor;return s.find(l=>i==a(l))}else{const a=o.x.accessor,l=o.x2.accessor;return s.find(c=>i>=a(c)&&i`const child${e} = children[${e}];`).join(` -`)+`return function propagate(datum) {${V_(this.children.length).map(e=>`child${e}.handle(datum);`).join(` +`,nl=1,cu=2,qR=4,Oae={};class pn{get behavior(){return 0}constructor(){this.children=[],this.parent=void 0,this.completed=!1}reset(){this.completed=!1;for(const e of this.children)e.reset()}initialize(){}_updatePropagator(){this._propagate=Function("children",H_(this.children.length).map(e=>`const child${e} = children[${e}];`).join(` +`)+`return function propagate(datum) {${H_(this.children.length).map(e=>`child${e}.handle(datum);`).join(` `)}}`)(this.children)}setParent(e){this.parent=e}addChild(e){if(e.parent)throw new Error("Cannot add the child! It already has a parent.");return this.children.push(e),e.setParent(this),this._updatePropagator(),this}adopt(e){e.parent&&e.parent.removeChild(e),this.addChild(e)}adoptChildrenOf(e){for(const t of e.children)this.adopt(t)}insertAsParent(e){if(this.isRoot())throw new Error("Cannot insert a new parent for a root node!");e.parent=this.parent,this.parent.children[this.parent.children.indexOf(this)]=e,this.parent._updatePropagator(),this.parent=void 0,e.addChild(this)}removeChild(e){const t=this.children.indexOf(e);if(t>-1)this.children.splice(t,1),e.parent=void 0,this._updatePropagator();else throw new Error("Trying to remove an unknown child node!")}excise(){if(this.isRoot())throw new Error("Cannot excise root node!");if(this.isTerminal())this.parent.removeChild(this);else if(this.children.length==1){const e=this.children[0];e.setParent(this.parent),this.parent.children[this.parent.children.indexOf(this)]=e,this.parent._updatePropagator(),this.setParent(void 0),this.children.length=0}else throw new Error("Cannot excise a node that has multiple children!")}isRoot(){return!this.parent}isBranching(){return this.children.length>1}isTerminal(){return this.children.length==0}visit(e){e(this);for(const t of this.children)t.visit(e);e.afterChildren&&e.afterChildren(this)}subtreeToString(e=0){const t=this.children.map(i=>i.subtreeToString(e+1)).join("");return`${" ".repeat(e*2)}* ${this.constructor.name}${("identifier"in this&&this.identifier?": "+this.identifier:"")??""} -${t}`}getGlobalObject(){return this.parent?this.parent.getGlobalObject():_ae}handle(e){this._propagate(e)}complete(){this.completed=!0;for(const e of this.children)e.complete()}beginBatch(e){for(const t of this.children)t.beginBatch(e)}_propagate(e){}}function cz(n){return n.type=="file"}function bae(n){return n.type=="facet"}class dz extends pn{constructor(e){super(),this.k=e.size||500,this.reset()}reset(){super.reset(),this.reservoir=[],this.W=void 0,this.ingester=this._initialIngester}_initialIngester(e){this.reservoir.push(e),this.reservoir.length==this.k&&(this.W=Math.exp(Math.log(Math.random())/this.k),this.i=this.k,this.next=this.i,this.ingester=this._finalIngester,this._setNextStop())}_finalIngester(e){++this.i==this.next&&(this.reservoir[Math.floor(Math.random()*this.k)]=e,this.W*=Math.exp(Math.log(Math.random())/this.k),this._setNextStop())}_setNextStop(){this.next+=Math.floor(Math.log(Math.random())/Math.log(1-this.W))+1}handle(e){this.ingester(e)}complete(){for(const e of this.reservoir)this._propagate(e);super.complete()}}function vae(n,e,t){const i=new dz({type:"sample",size:n});for(const s of e)i.handle(t(s));return i.complete(),i.reservoir}const wae={};class yae extends n1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,color:"#4c78a8",filled:!0,opacity:1,size:100,semanticScore:0,shape:"circle",strokeWidth:2,fillGradientStrength:0,dx:0,dy:0,angle:0,sampleFacetPadding:.1,semanticZoomFraction:.02}))}getAttributes(){return["inwardStroke","uniqueId","facetIndex","x","y","size","semanticScore","shape","strokeWidth","gradientStrength","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getDefaultEncoding(){return{...super.getDefaultEncoding(),...wae}}fixEncoding(e){return az(e,this.properties.filled),lz(e,this.properties.filled),delete e.color,delete e.opacity,e}initializeData(){super.initializeData();const e=this.unitView.getAccessor("semanticScore");e&&(this.sampledSemanticScores=Float32Array.from(vae(1e4,this.unitView.getCollector().getData(),e)),this.sampledSemanticScores.sort((t,i)=>t-i))}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(gae,pae,[mae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;Hp(this.markUniformInfo,{uInwardStroke:!!e.inwardStroke,uGradientStrength:+e.fillGradientStrength,uMaxRelativePointDiameter:1-2*e.sampleFacetPadding})}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Zre({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}_getGeometricScaleFactor(){const e=Math.pow(2,this.properties.geometricZoomBound||0);return Math.pow(Math.min(1,this.unitView.getZoomLevel()/e),1/3)}_getMaxPointSize(){const e=this.encoders.size;return e.constant?e(null):e.scale.range().reduce((t,i)=>Math.max(t,i))}getSemanticThreshold(){if(this.sampledSemanticScores){const e=Math.max(0,1-this.properties.semanticZoomFraction*this.unitView.getZoomLevel());if(e<=0)return-1/0;if(e>=1)return 1/0;{const t=this.sampledSemanticScores;return fW(t,e)}}else return-1}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{Hp(this.markUniformInfo,{uMaxPointSize:this._getMaxPointSize(),uScaleFactor:this._getGeometricScaleFactor(),uSemanticThreshold:this.getSemanticThreshold()}),this.markUniformsAltered=!0}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>Zh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>{s&&dL(t,this.vertexArrayInfo,t.POINTS,s,i)},e)}}const Cae=`// Line caps +${t}`}getGlobalObject(){return this.parent?this.parent.getGlobalObject():Oae}handle(e){this._propagate(e)}complete(){this.completed=!0;for(const e of this.children)e.complete()}beginBatch(e){for(const t of this.children)t.beginBatch(e)}_propagate(e){}}function Sz(n){return n.type=="file"}function Fae(n){return n.type=="facet"}class xz extends pn{constructor(e){super(),this.k=e.size||500,this.reset()}reset(){super.reset(),this.reservoir=[],this.W=void 0,this.ingester=this._initialIngester}_initialIngester(e){this.reservoir.push(e),this.reservoir.length==this.k&&(this.W=Math.exp(Math.log(Math.random())/this.k),this.i=this.k,this.next=this.i,this.ingester=this._finalIngester,this._setNextStop())}_finalIngester(e){++this.i==this.next&&(this.reservoir[Math.floor(Math.random()*this.k)]=e,this.W*=Math.exp(Math.log(Math.random())/this.k),this._setNextStop())}_setNextStop(){this.next+=Math.floor(Math.log(Math.random())/Math.log(1-this.W))+1}handle(e){this.ingester(e)}complete(){for(const e of this.reservoir)this._propagate(e);super.complete()}}function Bae(n,e,t){const i=new xz({type:"sample",size:n});for(const s of e)i.handle(t(s));return i.complete(),i.reservoir}const Wae={};class Vae extends l1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,color:"#4c78a8",filled:!0,opacity:1,size:100,semanticScore:0,shape:"circle",strokeWidth:2,fillGradientStrength:0,dx:0,dy:0,angle:0,sampleFacetPadding:.1,semanticZoomFraction:.02}))}getAttributes(){return["inwardStroke","uniqueId","facetIndex","x","y","size","semanticScore","shape","strokeWidth","gradientStrength","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getDefaultEncoding(){return{...super.getDefaultEncoding(),...Wae}}fixEncoding(e){return yz(e,this.properties.filled),Cz(e,this.properties.filled),delete e.color,delete e.opacity,e}initializeData(){super.initializeData();const e=this.unitView.getAccessor("semanticScore");e&&(this.sampledSemanticScores=Float32Array.from(Bae(1e4,this.unitView.getCollector().getData(),e)),this.sampledSemanticScores.sort((t,i)=>t-i))}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(Mae,Rae,[Pae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;$p(this.markUniformInfo,{uInwardStroke:!!e.inwardStroke,uGradientStrength:+e.fillGradientStrength,uMaxRelativePointDiameter:1-2*e.sampleFacetPadding})}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Iae({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}_getGeometricScaleFactor(){const e=Math.pow(2,this.properties.geometricZoomBound||0);return Math.pow(Math.min(1,this.unitView.getZoomLevel()/e),1/3)}_getMaxPointSize(){const e=this.encoders.size;return e.constant?e(null):e.scale.range().reduce((t,i)=>Math.max(t,i))}getSemanticThreshold(){if(this.sampledSemanticScores){const e=Math.max(0,1-this.properties.semanticZoomFraction*this.unitView.getZoomLevel());if(e<=0)return-1/0;if(e>=1)return 1/0;{const t=this.sampledSemanticScores;return DW(t,e)}}else return-1}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{$p(this.markUniformInfo,{uMaxPointSize:this._getMaxPointSize(),uScaleFactor:this._getGeometricScaleFactor(),uSemanticThreshold:this.getSemanticThreshold()}),this.markUniformsAltered=!0}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>Yh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>{s&&pL(t,this.vertexArrayInfo,t.POINTS,s,i)},e)}}const Hae=`// Line caps const int BUTT = 0; const int SQUARE = 1; const int ROUND = 2; @@ -1891,7 +1897,7 @@ void main(void) { setupPicking(); } -`,Sae=`// Line ending +`,zae=`// Line ending const int BUTT = 0; const int SQUARE = 1; const int ROUND = 2; @@ -1940,34 +1946,17 @@ void main(void) { fragColor = vPickingColor; } } -`,xae=`uniform Mark { +`,$ae=`layout(std140) uniform Mark { /** Minimum rule length in pixels */ uniform mediump float uMinLength; uniform mediump float uDashTextureSize; uniform lowp int uStrokeCap; uniform mediump float uStrokeDashOffset; -}; -`;class Lae extends n1{constructor(e){super(e),this.dashTextureSize=0,Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x2:void 0,y2:void 0,size:1,color:"black",opacity:1,minLength:0,strokeDash:null,strokeDashOffset:0,strokeCap:"butt"}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){if(!(e.x&&e.y&&e.x2&&e.y2))if(e.x&&e.x2&&!e.y)e.y={value:.5},e.y2=e.y;else if(e.y&&e.y2&&!e.x)e.x={value:.5},e.x2=e.x;else if(e.x&&!e.y)e.y={value:0},e.y2={value:1},e.x2=e.x;else if(e.y&&!e.x)e.x={value:0},e.x2={value:1},e.y2=e.y;else if(e.x&&e.y&&e.y2)e.x2=e.x;else if(e.y&&e.x&&e.x2)e.y2=e.y;else if(e.y&&e.x)if(!e.x2&&_o(e.y)&&e.y.type=="quantitative")e.x2=e.x,e.y2={datum:0};else if(!e.y2&&_o(e.x)&&e.x.type=="quantitative")e.y2=e.y,e.x2={datum:0};else throw new Error("A bug!");else throw new Error("Invalid x and y encodings for rule mark: "+JSON.stringify(e));return e}async initializeGraphics(){if(await super.initializeGraphics(),this.properties.strokeDash){const e=this.gl,t=Dae(this.properties.strokeDash);this.dashTexture=ob(e,{mag:e.NEAREST,min:e.NEAREST,internalFormat:e.R8,format:e.RED,src:t,height:1}),this.dashTextureSize=t.length}this.createAndLinkShaders(Cae,Sae,[xae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniform("uMinLength",e.minLength),this.registerMarkUniform("uStrokeCap",e.strokeCap??"butt",t=>["butt","square","round"].indexOf(t)),Hp(this.markUniformInfo,{uDashTextureSize:+this.dashTextureSize}),this.markUniformsAltered=!0}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Yre({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this.dashTexture&&t.push(()=>nh(this.programInfo,{uDashTexture:this.dashTexture})),t.push(()=>Zh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>dL(t,this.vertexArrayInfo,t.TRIANGLE_STRIP,s,i),e)}}function Dae(n){if(n.length==0||n.length%2||n.findIndex(o=>Math.round(o)!=o||o<1||o>1e3)>=0)throw new Error("Invalid stroke dash pattern: "+JSON.stringify(n));const e=n.reduce((o,r)=>o+r),t=new Uint8Array(e);let i=!0,s=0;for(let o of n){for(;o;)t[s++]=i&&255||0,o--;i=!i}return t}const kae=`uniform Mark { - uniform float uArcHeightFactor; - /** Make very small arcs visible */ - uniform float uMinArcHeight; - - /** The minimum stroke width in pixels when rendering into the picking buffer */ - uniform float uMinPickingSize; - - uniform int uShape; - uniform int uOrient; - uniform bool uClampApex; - - // In pixels - uniform float uMaxChordLength; - // In pixels - uniform vec2 uArcFadingDistance; +#pragma markUniforms }; - -in vec2 strip; +`;class Uae extends l1{constructor(e){super(e),this.dashTextureSize=0,Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x2:void 0,y2:void 0,size:1,color:"black",opacity:1,minLength:0,strokeDash:null,strokeDashOffset:0,strokeCap:"butt"}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){if(!(e.x&&e.y&&e.x2&&e.y2))if(e.x&&e.x2&&!e.y)e.y={value:.5},e.y2=e.y;else if(e.y&&e.y2&&!e.x)e.x={value:.5},e.x2=e.x;else if(e.x&&!e.y)e.y={value:0},e.y2={value:1},e.x2=e.x;else if(e.y&&!e.x)e.x={value:0},e.x2={value:1},e.y2=e.y;else if(e.x&&e.y&&e.y2)e.x2=e.x;else if(e.y&&e.x&&e.x2)e.y2=e.y;else if(e.y&&e.x)if(!e.x2&&Bo(e.y)&&e.y.type=="quantitative")e.x2=e.x,e.y2={datum:0};else if(!e.y2&&Bo(e.x)&&e.x.type=="quantitative")e.y2=e.y,e.x2={datum:0};else throw new Error("A bug!");else throw new Error("Invalid x and y encodings for rule mark: "+JSON.stringify(e));return e}async initializeGraphics(){if(await super.initializeGraphics(),this.properties.strokeDash){const e=this.gl,t=jae(this.properties.strokeDash);this.dashTexture=ob(e,{mag:e.NEAREST,min:e.NEAREST,internalFormat:e.R8,format:e.RED,src:t,height:1}),this.dashTextureSize=t.length}this.createAndLinkShaders(Hae,zae,[$ae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uMinLength",e.minLength),this.registerMarkUniformValue("uStrokeCap",e.strokeCap??"butt",t=>["butt","square","round"].indexOf(t)),$p(this.markUniformInfo,{uDashTextureSize:+this.dashTextureSize}),this.markUniformsAltered=!0}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Eae({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this.dashTexture&&t.push(()=>Yg(this.programInfo,{uDashTexture:this.dashTexture})),t.push(()=>Yh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>pL(t,this.vertexArrayInfo,t.TRIANGLE_STRIP,s,i),e)}}function jae(n){if(n.length==0||n.length%2||n.findIndex(o=>Math.round(o)!=o||o<1||o>1e3)>=0)throw new Error("Invalid stroke dash pattern: "+JSON.stringify(n));const e=n.reduce((o,r)=>o+r),t=new Uint8Array(e);let i=!0,s=0;for(let o of n){for(;o;)t[s++]=i&&255||0,o--;i=!i}return t}const qae=`in vec2 strip; out vec4 vColor; @@ -2160,7 +2149,7 @@ void main(void) { setupPicking(); } -`,Eae=`in vec4 vColor; +`,Gae=`in vec4 vColor; in float vSize; in float vNormalLengthInPixels; @@ -2178,7 +2167,27 @@ void main(void) { fragColor = vPickingColor; } } -`,Iae=["arc","dome","diagonal","line"],Aae=["vertical","horizontal"];class Tae extends n1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,arcHeightFactor:1,minArcHeight:1.5,minPickingSize:3,clampApex:!1,maxChordLength:5e4,arcFadingDistance:!1,linkShape:"arc",orient:"vertical"})),this._baseInstanceExt=this.gl.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","height","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x2||(_o(e.x)?e.x2={datum:0}:e.x2=e.x),e.y2||(_o(e.y)?e.y2={datum:0}:e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(kae,Eae)}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniform("uArcFadingDistance",e.arcFadingDistance,t=>t||[0,0]),this.registerMarkUniform("uArcHeightFactor",e.arcHeightFactor),this.registerMarkUniform("uMinArcHeight",e.minArcHeight),this.registerMarkUniform("uMinPickingSize",e.minPickingSize),this.registerMarkUniform("uShape",e.linkShape,t=>Iae.indexOf(t)),this.registerMarkUniform("uOrient",e.orient,t=>Aae.indexOf(t)),this.registerMarkUniform("uClampApex",e.clampApex,t=>!!t),this.registerMarkUniform("uMaxChordLength",e.maxChordLength)}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Xre({encoders:this.encoders,attributes:this.getAttributes(),numItems:t});i.addBatches(e.facetBatches);const s=i.toArrays();s.arrays.strip={data:Nae(this.properties.segments),numComponents:2},this.rangeMap.migrateEntries(s.rangeMap),this.arrays=Object.fromEntries(Object.entries(s.arrays).map(([o,r])=>[o,{...r,data:void 0}])),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this._baseInstanceExt?t.push(()=>Zh(this.gl,this.programInfo,this.vertexArrayInfo)):t.push(()=>this.gl.bindVertexArray(null)),t}render(e){const t=this.gl,i=(this.properties.segments+1)*2;return this._baseInstanceExt?this.createRenderCallback((s,o)=>{this._baseInstanceExt.drawArraysInstancedBaseInstanceWEBGL(t.TRIANGLE_STRIP,0,i,o,s)},e):this.createRenderCallback((s,o)=>{for(const r of Object.entries(this.bufferInfo.attribs)){const[a,l]=r;l.buffer&&l.numComponents&&l.divisor&&(l.offset=s*this.arrays[a].numComponents*4)}Zh(t,this.programInfo,this.bufferInfo),t.drawArraysInstanced(t.TRIANGLE_STRIP,0,i,o)},e)}}function Nae(n){let e=0;const t=[];for(;e<=n;e++)t.push(e/n,.5),t.push(e/n,-.5);return new Float32Array(t)}const Mae=`in mediump vec2 vertexCoord; +`,Kae=`layout(std140) uniform Mark { + uniform float uArcHeightFactor; + + /** Make very small arcs visible */ + uniform float uMinArcHeight; + + /** The minimum stroke width in pixels when rendering into the picking buffer */ + uniform float uMinPickingSize; + + uniform int uShape; + uniform int uOrient; + uniform bool uClampApex; + + // In pixels + uniform float uMaxChordLength; + // In pixels + uniform vec2 uArcFadingDistance; + +#pragma markUniforms +}; +`,Yae=["arc","dome","diagonal","line"],Zae=["vertical","horizontal"];class Xae extends l1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,arcHeightFactor:1,minArcHeight:1.5,minPickingSize:3,clampApex:!1,maxChordLength:5e4,arcFadingDistance:!1,linkShape:"arc",orient:"vertical"})),this._baseInstanceExt=this.gl.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","height","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x2||(Bo(e.x)?e.x2={datum:0}:e.x2=e.x),e.y2||(Bo(e.y)?e.y2={datum:0}:e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(qae,Gae,[Kae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uArcFadingDistance",e.arcFadingDistance,t=>t||[0,0]),this.registerMarkUniformValue("uArcHeightFactor",e.arcHeightFactor),this.registerMarkUniformValue("uMinArcHeight",e.minArcHeight),this.registerMarkUniformValue("uMinPickingSize",e.minPickingSize),this.registerMarkUniformValue("uShape",e.linkShape,t=>Yae.indexOf(t)),this.registerMarkUniformValue("uOrient",e.orient,t=>Zae.indexOf(t)),this.registerMarkUniformValue("uClampApex",e.clampApex,t=>!!t),this.registerMarkUniformValue("uMaxChordLength",e.maxChordLength)}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getItemCount(),i=new Aae({encoders:this.encoders,attributes:this.getAttributes(),numItems:t});i.addBatches(e.facetBatches);const s=i.toArrays();s.arrays.strip={data:Qae(this.properties.segments),numComponents:2},this.rangeMap.migrateEntries(s.rangeMap),this.arrays=Object.fromEntries(Object.entries(s.arrays).map(([o,r])=>[o,{...r,data:void 0}])),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this._baseInstanceExt?t.push(()=>Yh(this.gl,this.programInfo,this.vertexArrayInfo)):t.push(()=>this.gl.bindVertexArray(null)),t}render(e){const t=this.gl,i=(this.properties.segments+1)*2;return this._baseInstanceExt?this.createRenderCallback((s,o)=>{this._baseInstanceExt.drawArraysInstancedBaseInstanceWEBGL(t.TRIANGLE_STRIP,0,i,o,s)},e):this.createRenderCallback((s,o)=>{for(const r of Object.entries(this.bufferInfo.attribs)){const[a,l]=r;l.buffer&&l.numComponents&&l.divisor&&(l.offset=s*this.arrays[a].numComponents*4)}Yh(t,this.programInfo,this.bufferInfo),t.drawArraysInstanced(t.TRIANGLE_STRIP,0,i,o)},e)}}function Qae(n){let e=0;const t=[];for(;e<=n;e++)t.push(e/n,.5),t.push(e/n,-.5);return new Float32Array(t)}const Jae=`in mediump vec2 vertexCoord; in lowp vec2 textureCoord; // Width of the text (all letters) @@ -2400,7 +2409,7 @@ void main(void) { setupPicking(); } -`,Rae=`uniform sampler2D uTexture; +`,ele=`uniform sampler2D uTexture; in vec2 vTexCoord; in float vEdgeFadeOpacity; @@ -2439,7 +2448,7 @@ void main() { fragColor = vPickingColor; } } -`,Pae=`uniform Mark { +`,tle=`layout(std140) uniform Mark { uniform mediump float uSdfNumerator; uniform mediump vec2 uD; // dx & dy @@ -2458,8 +2467,10 @@ void main() { uniform bool uFlushX; uniform mediump float uPaddingY; uniform bool uFlushY; + +#pragma markUniforms }; -`,Oae={left:-1,center:0,right:1},Fae={top:-1,middle:0,bottom:1,alphabetic:1};class Bae extends n1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0})),this.font=this.properties.font?e.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):e.context.fontManager.getDefaultFont()}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(e){for(const t of Lm)this.properties.fitToBand&&YE(e,t);return e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(Mae,Rae,[Pae])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniform("uSdfNumerator",{expr:"devicePixelRatio"},t=>{let i=.35;return this.properties.logoLetters&&(i/=2),this.font.metrics.common.base/(t/i)}),Hp(this.markUniformInfo,{uPaddingX:e.paddingX,uPaddingY:e.paddingY,uFlushX:!!e.flushX,uFlushY:!!e.flushY,uAlign:[Oae[e.align],Fae[e.baseline]],uD:[e.dx,-e.dy],uLogoLetter:!!e.logoLetters,uSqueeze:!!e.squeeze,uViewportEdgeFadeWidth:[e.viewportEdgeFadeWidthTop,e.viewportEdgeFadeWidthRight,e.viewportEdgeFadeWidthBottom,e.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[e.viewportEdgeFadeDistanceTop,e.viewportEdgeFadeDistanceRight,e.viewportEdgeFadeDistanceBottom,e.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getData(),i=this.encoding,s=this.encoders.text.accessor||this.encoders.text;let o=0;const r="format"in i.text?cs(i.text.format):c=>c;for(const c of t){const d=r(s(c)),u=Di(d)?d:d===null?"":""+d;o+=u&&u.length||0}const a=new Qre({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(o,this.properties.minBufferSize||0)});a.addBatches(e.facetBatches);const l=a.toArrays();this.rangeMap.migrateEntries(l.rangeMap),this.updateBufferInfo(l)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{nh(this.programInfo,{uTexture:this.font.texture})}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>Zh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>dL(t,this.vertexArrayInfo,t.TRIANGLES,s,i),e)}}function CO(n,e,{spacing:t,devicePixelRatio:i,offset:s,reverse:o}={}){t=t||0,s=s||0;let r=0,a=0;for(const g of n)r+=lw(g.px)+(vk(g)?0:t),a+=lw(g.grow);r-=t;const l=Math.max(0,e-r),c=i!==void 0?g=>Math.round(g*i)/i:g=>g,d=[],u=[],h=g=>{const p=d.length;if(!p)return;const _=(g?t:0)*(o?-1:1);f-=_;for(let v=0;v0);const _=lw(p.px)+(a?lw(p.grow)/a*l:0);o&&(f-=_),u.push({location:c(f),size:c(_)}),o?f-=t:f+=_+t}}return f+=o?t:-t,h(!1),u}function Wae(n){let e=0,t=0;for(const i of n)e=Math.max(e,i.px??0),t=Math.max(t,i.grow??0);return{px:e,grow:t}}var yv,QE;const p3=class p3{constructor(e,t){et(this,yv);this.width=e,this.height=t}addPadding(e){return tt(this,yv,QE).call(this,e.width,e.height)}subtractPadding(e){return tt(this,yv,QE).call(this,-e.width,-e.height)}};yv=new WeakSet,QE=function(e,t){return new p3({px:(this.width.px??0)+e,grow:this.width.grow},{px:(this.height.px??0)+t,grow:this.height.grow})};let Pd=p3;const n_=Object.freeze({px:0,grow:0}),SO=new Pd(n_,n_);function vk(n){return!n.px&&!n.grow}function lw(n){return n||0}function Vae(n){return n&&(Xs(n.px)||Xs(n.grow))}function uz(n){if(hz(n))throw new Error("parseSizeDef does not accept step-based sizes.");if(Vae(n))return n;if(Xs(n))return{px:n,grow:0};if(n==="container")return{px:0,grow:1};if(!n)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${n}`)}class Cs{constructor(e,t,i,s){this.top=e||0,this.right=t||0,this.bottom=i||0,this.left=s||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(e){return e<=0?this:new Cs(this.top+e,this.right+e,this.bottom+e,this.left+e)}add(e){return new Cs(this.top+e.top,this.right+e.right,this.bottom+e.bottom,this.left+e.left)}subtract(e){return new Cs(this.top-e.top,this.right-e.right,this.bottom-e.bottom,this.left-e.left)}union(e){return new Cs(Math.max(this.top,e.top),Math.max(this.right,e.right),Math.max(this.bottom,e.bottom),Math.max(this.left,e.left))}getHorizontal(){return new Cs(0,this.right,0,this.left)}getVertical(){return new Cs(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(e){return typeof e=="number"?this.createUniformPadding(e):e?this.createFromRecord(e):JE}static createFromRecord(e){return new Cs(e.top,e.right,e.bottom,e.left)}static zero(){return JE}static createUniformPadding(e){return new Cs(e,e,e,e)}}const JE=Cs.createUniformPadding(0);Object.freeze(JE);const Hae=/^([A-Za-z]+:)?\/\//;function zae(n,e){if(e&&Hae.test(e))return e;const t=n();return t&&e?t.endsWith("/")?t+e:t+"/"+e:t??e}const $ae="VISIT_SKIP",s_="VISIT_STOP",xO=n=>n;var wp,Cv,Sv,gh,k0,xv,eI,hB;let Uae=(hB=class{constructor(e,t,i,s,o,r={}){et(this,gh);et(this,xv);et(this,wp,{});et(this,Cv,{});et(this,Sv,{});Dn(this,"opacityFunction",xO);Dn(this,"coords");if(!e)throw new Error("View spec must be defined!");this.context=t,this.layoutParent=i,this.dataParent=s,this.name=e.name||o,this.spec=e,this.resolutions={scale:{},axis:{}},nz(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...r},this.needsAxes={x:!1,y:!1}}getPadding(){return this._cache("size/padding",()=>Cs.createFromConfig(this.spec.padding))}getOverhang(){return Cs.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Pd(tt(this,gh,k0).call(this,"width"),tt(this,gh,k0).call(this,"height")):SO)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return SO;const e=this.getSize();return new Pd(tt(this,gh,k0).call(this,"viewportWidth")??e.width,tt(this,gh,k0).call(this,"viewportHeight")??e.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(e=>e.isConfiguredVisible())}getEffectiveOpacity(){var e;return this.opacityFunction(((e=this.layoutParent)==null?void 0:e.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(e=>e.name).reverse().join("/")}getLayoutAncestors(){return tt(this,xv,eI).call(this,"layoutParent")}getDataAncestors(){return tt(this,xv,eI).call(this,"dataParent")}handleBroadcast(e){for(const t of ve(this,wp)[e.type]||[])t(e)}_addBroadcastHandler(e,t){let i=ve(this,wp)[e];i||(i=[],ve(this,wp)[e]=i),i.push(t)}handleInteractionEvent(e,t,i){const s=i?ve(this,Cv):ve(this,Sv);for(const o of s[t.type]||[])o(e,t)}addInteractionEventListener(e,t,i){const s=i?ve(this,Cv):ve(this,Sv);let o=s[e];o||(o=[],s[e]=o),o.push(t)}visit(e){try{const t=e(this);if(e.postOrder&&e.postOrder(this),t!==s_)return t}catch(t){throw t.view=this,t}}getDescendants(){const e=[];return this.visit(t=>{e.push(t)}),e}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===xO)&&(this.opacityFunction=qae(this))}onBeforeRender(){}render(e,t,i={}){this.coords=i.clipRect?t.intersect(i.clipRect):t}getEncoding(){const e=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},t=this.spec.encoding||{},i={...e,...t};for(const[s,o]of Object.entries(i))o===null&&delete i[s];return i}getFacetAccessor(e){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(e){var i;const t=this.getEncoding().sample;return wf(t)?[t.field]:(i=this.layoutParent)==null?void 0:i.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(e){const t=Yh(e);return this.getDataAncestors().map(i=>i.resolutions.scale[t]).find(i=>i)}getAxisResolution(e){const t=Yh(e);return this.getDataAncestors().map(i=>i.resolutions.axis[t]).find(i=>i)}getConfiguredResolution(e,t){var i,s;return(s=(i=this.spec.resolve)==null?void 0:i[t])==null?void 0:s[e]}getConfiguredOrDefaultResolution(e,t){return this.getConfiguredResolution(e,t)??this.getConfiguredResolution("default",t)??this.getDefaultResolution(e,t)}getDefaultResolution(e,t){return"independent"}getBaseUrl(){return zae(()=>{var e;return(e=this.dataParent)==null?void 0:e.getBaseUrl()},this.spec.baseUrl)}isPickingSupported(){return!0}getTitleText(){const e=this.spec.title;if(e)return Di(e)?e:e.text}_cache(e,t){return zp(this,e,t)}_invalidateCacheByPrefix(e,t="self"){switch(t){case"self":Ly(this,e);break;case"ancestors":for(const i of this.getLayoutAncestors())Ly(i,e);break;case"progeny":this.visit(i=>Ly(i,e));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(e){}},wp=new WeakMap,Cv=new WeakMap,Sv=new WeakMap,gh=new WeakSet,k0=function(e){var s;let t=this.spec[e];const i=e=="viewportWidth"||e=="viewportHeight";if(hz(t)){if(i)throw new Dh(`Cannot use step-based size with "${e}"!`,this);const o=t.step,r=(s=this.getScaleResolution(e=="width"?"x":"y"))==null?void 0:s.getScale();if(r){let a=0;if(Ua(r.type))a=r.domain().length;else if(["locus","index"].includes(r.type)){const c=r.domain();a=zv(c)-c[0]}else throw new Dh(`Cannot use step-based size with "${r.type}" scale!`,this);const l=r;return a=dR(a,l.paddingInner(),l.paddingOuter()),{px:a*o,grow:0}}else throw new Dh("Cannot use 'step' size with missing scale!",this)}else return(t&&uz(t))??(i?void 0:{px:0,grow:1})},xv=new WeakSet,eI=function(e){const t=[];let i=this;do t.push(i),i=i[e];while(i);return t},hB);function jae(n){return"unitsPerPixel"in n}function qae(n){const e=n.spec.opacity;if(e!==void 0){if(Xs(e))return t=>t*e;if(jae(e)){const t=o=>{var a;const r=(a=n.getScaleResolution(o))==null?void 0:a.getScale();if(["linear","index","locus"].includes(r==null?void 0:r.type))return r},i=e.channel?t(e.channel):t("x")??t("y");if(!i)throw new Dh("Cannot find a resolved quantitative scale for dynamic opacity!",n);const s=iR().domain(e.unitsPerPixel).range(e.values).clamp(!0);return o=>{const a=pC(i.domain())/1e3;return s(a)*o}}else if(rz(e)){const t=n.context.paramBroker.createExpression(e.expr);return i=>t(null)*i}}return t=>t}const hz=n=>!!(n!=null&&n.step);class Xh extends Uae{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(e,t){throw new Error("Not implemented")}visit(e){let t;try{t=e(this)}catch(i){throw i.view=this,i}if(t===s_)return t;if(t!==$ae){e.beforeChildren&&e.beforeChildren(this);for(const i of this){const s=i.visit(e);if(s===s_)return s}e.afterChildren&&e.afterChildren(this),e.postOrder&&e.postOrder(this)}}findDescendantByPath(e){for(const t of this)if(t.name===e[0]){if(e.length==1)return t;if(t instanceof Xh)return t.findDescendantByPath(e.slice(1))}}findChildByName(e){for(const t of this)if(t.name===e)return t}findDescendantByName(e){let t;return this.visit(i=>{if(i.name==e)return t=i,s_}),t}getDefaultResolution(e,t){return"shared"}}const LO=1;function OR(){let n=[0,1],e=[0,1],t=1,i=1,s=0,o=0,r=.5,a=0;const c=d=>(d+r-n[0])/t*i+e[0];return c.invert=d=>(d-e[0])/i*t+n[0]-r,c.domain=function(d){if(arguments.length){n=qX(d),t=n[1]-n[0];const u=n[0]===0&&n[0]===0;if(ti/t,c.bandwidth=()=>c.step(),c.ticks=d=>{const u=c.align(),h=c.numberingOffset();return _C(n[0]-u+h,n[1]-u+h,Math.min(d,Math.ceil(t))).filter(Number.isInteger).map(f=>f-a)},c.tickFormat=(d,u)=>{if(u)throw new Error("Index scale's tickFormat does not support a specifier!");const f=Uh(n[0],n[1],Math.min(d,Math.ceil(t)))<1e5?cs(","):cs(".3s");return g=>f(g+a)},c.copy=()=>OR().domain(n).range(e).paddingInner(s).paddingOuter(o).numberingOffset(a),c}function Gae(){const n=OR().numberingOffset(1);let e;n.genome=function(i){return arguments.length?(e=i,n):e},n.ticks=i=>{if(!e)return[];const s=n.domain(),o=n.numberingOffset(),[r,a]=[Math.max(s[0],0),Math.min(s[1],e.totalSize-1)].map(d=>e.toChromosome(d)),l=Math.max(1,Uh(s[0],s[1],i)),c=[];for(let d=r.index;d<=a.index;d++){const u=e.chromosomes[d],h=Math.max(u.continuousStart+l,s[0]-(s[0]-u.continuousStart)%l),f=Math.min(u.continuousEnd-l/4,s[1]+1);for(let g=h;g<=f;g+=l){const p=g-o;p>=s[0]&&p{if(!e)return;if(s)throw new Error("Locus scale's tickFormat does not support a specifier!");const o=n.domain(),r=o[1]-o[0],a=n.numberingOffset(),c=Uh(o[0],o[1],Math.min(i,Math.ceil(r)))<1e6?cs(","):cs(".3s"),d=u=>u-e.toChromosome(u).continuousStart;return u=>c(d(u)+a)};const t=n.copy;return n.copy=()=>t().genome(e),n}function Kae(n){return n.type=="locus"}function PC(n,e,t){if(t=t||[],n.some(r=>r===null)){if(n.every(r=>r===null))return null;throw console.warn(n),new Error("Cannot merge objects with nulls!")}const i={},s=(r,a)=>r===a||Zf(r)&&Zf(a)||Zf(r)&&a===!0||r===!0&&Lo(a),o=r=>{for(let a in r){const l=r[a];if(!t.includes(a)&&l!==void 0)if(i[a]!==void 0&&!s(i[a],l))console.warn(`Conflicting property ${a} of ${e}: (${JSON.stringify(i[a])} and ${JSON.stringify(r[a])}). Using ${JSON.stringify(i[a])}.`);else{const c=i[a];if(Zf(c))Zf(l)&&(i[a]=PC([c,l],a));else if(Zf(l)){if(!(c===!0||c===void 0))throw new Error("Bug in merge! Target is: "+c);i[a]=PC([{},l],a)}else i[a]=l}}};for(const r of n)o(r);return i}function Zf(n){return Lo(n)&&!Array.isArray(n)}/*! +`,ile={left:-1,center:0,right:1},nle={top:-1,middle:0,bottom:1,alphabetic:1};class sle extends l1{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0})),this.font=this.properties.font?e.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):e.context.fontManager.getDefaultFont()}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(e){for(const t of Im)this.properties.fitToBand&&iI(e,t);return e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(Jae,ele,[tle])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uSdfNumerator",{expr:"devicePixelRatio"},t=>{let i=.35;return this.properties.logoLetters&&(i/=2),this.font.metrics.common.base/(t/i)}),$p(this.markUniformInfo,{uPaddingX:e.paddingX,uPaddingY:e.paddingY,uFlushX:!!e.flushX,uFlushY:!!e.flushY,uAlign:[ile[e.align],nle[e.baseline]],uD:[e.dx,-e.dy],uLogoLetter:!!e.logoLetters,uSqueeze:!!e.squeeze,uViewportEdgeFadeWidth:[e.viewportEdgeFadeWidthTop,e.viewportEdgeFadeWidthRight,e.viewportEdgeFadeWidthBottom,e.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[e.viewportEdgeFadeDistanceTop,e.viewportEdgeFadeDistanceRight,e.viewportEdgeFadeDistanceBottom,e.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const e=this.unitView.getCollector(),t=e.getData(),i=this.encoding,s=this.encoders.text.accessor||this.encoders.text;let o=0;const r="format"in i.text?ls(i.text.format):c=>c;for(const c of t){const d=r(s(c)),u=Ei(d)?d:d===null?"":""+d;o+=u&&u.length||0}const a=new Tae({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(o,this.properties.minBufferSize||0)});a.addBatches(e.facetBatches);const l=a.toArrays();this.rangeMap.migrateEntries(l.rangeMap),this.updateBufferInfo(l)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{Yg(this.programInfo,{uTexture:this.font.texture})}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>Yh(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>pL(t,this.vertexArrayInfo,t.TRIANGLES,s,i),e)}}function PO(n,e,{spacing:t,devicePixelRatio:i,offset:s,reverse:o}={}){t=t||0,s=s||0;let r=0,a=0;for(const g of n)r+=pw(g.px)+(Lk(g)?0:t),a+=pw(g.grow);r-=t;const l=Math.max(0,e-r),c=i!==void 0?g=>Math.round(g*i)/i:g=>g,d=[],u=[],h=g=>{const p=d.length;if(!p)return;const _=(g?t:0)*(o?-1:1);f-=_;for(let v=0;v0);const _=pw(p.px)+(a?pw(p.grow)/a*l:0);o&&(f-=_),u.push({location:c(f),size:c(_)}),o?f-=t:f+=_+t}}return f+=o?t:-t,h(!1),u}function ole(n){let e=0,t=0;for(const i of n)e=Math.max(e,i.px??0),t=Math.max(t,i.grow??0);return{px:e,grow:t}}var Sv,oI;const D3=class D3{constructor(e,t){Fe(this,Sv);this.width=e,this.height=t}addPadding(e){return Be(this,Sv,oI).call(this,e.width,e.height)}subtractPadding(e){return Be(this,Sv,oI).call(this,-e.width,-e.height)}};Sv=new WeakSet,oI=function(e,t){return new D3({px:(this.width.px??0)+e,grow:this.width.grow},{px:(this.height.px??0)+t,grow:this.height.grow})};let Vd=D3;const o_=Object.freeze({px:0,grow:0}),OO=new Vd(o_,o_);function Lk(n){return!n.px&&!n.grow}function pw(n){return n||0}function rle(n){return n&&(Xs(n.px)||Xs(n.grow))}function Lz(n){if(Dz(n))throw new Error("parseSizeDef does not accept step-based sizes.");if(rle(n))return n;if(Xs(n))return{px:n,grow:0};if(n==="container")return{px:0,grow:1};if(!n)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${n}`)}class ys{constructor(e,t,i,s){this.top=e||0,this.right=t||0,this.bottom=i||0,this.left=s||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(e){return e<=0?this:new ys(this.top+e,this.right+e,this.bottom+e,this.left+e)}add(e){return new ys(this.top+e.top,this.right+e.right,this.bottom+e.bottom,this.left+e.left)}subtract(e){return new ys(this.top-e.top,this.right-e.right,this.bottom-e.bottom,this.left-e.left)}union(e){return new ys(Math.max(this.top,e.top),Math.max(this.right,e.right),Math.max(this.bottom,e.bottom),Math.max(this.left,e.left))}getHorizontal(){return new ys(0,this.right,0,this.left)}getVertical(){return new ys(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(e){return typeof e=="number"?this.createUniformPadding(e):e?this.createFromRecord(e):rI}static createFromRecord(e){return new ys(e.top,e.right,e.bottom,e.left)}static zero(){return rI}static createUniformPadding(e){return new ys(e,e,e,e)}}const rI=ys.createUniformPadding(0);Object.freeze(rI);const ale=/^([A-Za-z]+:)?\/\//;function lle(n,e){if(e&&ale.test(e))return e;const t=n();return t&&e?t.endsWith("/")?t+e:t+"/"+e:t??e}const cle="VISIT_SKIP",r_="VISIT_STOP",FO=n=>n;var yp,xv,Lv,bh,I0,Dv,aI,LB;let dle=(LB=class{constructor(e,t,i,s,o,r={}){Fe(this,bh);Fe(this,Dv);Fe(this,yp,{});Fe(this,xv,{});Fe(this,Lv,{});Dn(this,"opacityFunction",FO);Dn(this,"coords");if(!e)throw new Error("View spec must be defined!");this.context=t,this.layoutParent=i,this.dataParent=s,this.name=e.name||o,this.spec=e,this.resolutions={scale:{},axis:{}},hz(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...r},this.needsAxes={x:!1,y:!1}}getPadding(){return this._cache("size/padding",()=>ys.createFromConfig(this.spec.padding))}getOverhang(){return ys.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Vd(Be(this,bh,I0).call(this,"width"),Be(this,bh,I0).call(this,"height")):OO)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return OO;const e=this.getSize();return new Vd(Be(this,bh,I0).call(this,"viewportWidth")??e.width,Be(this,bh,I0).call(this,"viewportHeight")??e.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(e=>e.isConfiguredVisible())}getEffectiveOpacity(){var e;return this.opacityFunction(((e=this.layoutParent)==null?void 0:e.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(e=>e.name).reverse().join("/")}getLayoutAncestors(){return Be(this,Dv,aI).call(this,"layoutParent")}getDataAncestors(){return Be(this,Dv,aI).call(this,"dataParent")}handleBroadcast(e){for(const t of me(this,yp)[e.type]||[])t(e)}_addBroadcastHandler(e,t){let i=me(this,yp)[e];i||(i=[],me(this,yp)[e]=i),i.push(t)}handleInteractionEvent(e,t,i){const s=i?me(this,xv):me(this,Lv);for(const o of s[t.type]||[])o(e,t)}addInteractionEventListener(e,t,i){const s=i?me(this,xv):me(this,Lv);let o=s[e];o||(o=[],s[e]=o),o.push(t)}visit(e){try{const t=e(this);if(e.postOrder&&e.postOrder(this),t!==r_)return t}catch(t){throw t.view=this,t}}getDescendants(){const e=[];return this.visit(t=>{e.push(t)}),e}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===FO)&&(this.opacityFunction=hle(this))}onBeforeRender(){}render(e,t,i={}){this.coords=i.clipRect?t.intersect(i.clipRect):t}getEncoding(){const e=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},t=this.spec.encoding||{},i={...e,...t};for(const[s,o]of Object.entries(i))o===null&&delete i[s];return i}getFacetAccessor(e){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(e){var i;const t=this.getEncoding().sample;return wf(t)?[t.field]:(i=this.layoutParent)==null?void 0:i.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(e){const t=Zh(e);return this.getDataAncestors().map(i=>i.resolutions.scale[t]).find(i=>i)}getAxisResolution(e){const t=Zh(e);return this.getDataAncestors().map(i=>i.resolutions.axis[t]).find(i=>i)}getConfiguredResolution(e,t){var i,s;return(s=(i=this.spec.resolve)==null?void 0:i[t])==null?void 0:s[e]}getConfiguredOrDefaultResolution(e,t){return this.getConfiguredResolution(e,t)??this.getConfiguredResolution("default",t)??this.getDefaultResolution(e,t)}getDefaultResolution(e,t){return"independent"}getBaseUrl(){return lle(()=>{var e;return(e=this.dataParent)==null?void 0:e.getBaseUrl()},this.spec.baseUrl)}isPickingSupported(){return!0}getTitleText(){const e=this.spec.title;if(e)return Ei(e)?e:e.text}_cache(e,t){return _L(this,e,t)}_invalidateCacheByPrefix(e,t="self"){switch(t){case"self":Ny(this,e);break;case"ancestors":for(const i of this.getLayoutAncestors())Ny(i,e);break;case"progeny":this.visit(i=>Ny(i,e));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(e){}},yp=new WeakMap,xv=new WeakMap,Lv=new WeakMap,bh=new WeakSet,I0=function(e){var s;let t=this.spec[e];const i=e=="viewportWidth"||e=="viewportHeight";if(Dz(t)){if(i)throw new kh(`Cannot use step-based size with "${e}"!`,this);const o=t.step,r=(s=this.getScaleResolution(e=="width"?"x":"y"))==null?void 0:s.scale;if(r){let a=0;if(Ua(r.type))a=r.domain().length;else if(["locus","index"].includes(r.type)){const c=r.domain();a=Yv(c)-c[0]}else throw new kh(`Cannot use step-based size with "${r.type}" scale!`,this);const l=r;return a=wR(a,l.paddingInner(),l.paddingOuter()),{px:a*o,grow:0}}else throw new kh("Cannot use 'step' size with missing scale!",this)}else return(t&&Lz(t))??(i?void 0:{px:0,grow:1})},Dv=new WeakSet,aI=function(e){const t=[];let i=this;do t.push(i),i=i[e];while(i);return t},LB);function ule(n){return"unitsPerPixel"in n}function hle(n){const e=n.spec.opacity;if(e!==void 0){if(Xs(e))return t=>t*e;if(ule(e)){const t=o=>{var a;const r=(a=n.getScaleResolution(o))==null?void 0:a.scale;if(["linear","index","locus"].includes(r==null?void 0:r.type))return r},i=e.channel?t(e.channel):t("x")??t("y");if(!i)throw new kh("Cannot find a resolved quantitative scale for dynamic opacity!",n);const s=hR().domain(e.unitsPerPixel).range(e.values).clamp(!0);return o=>{const a=CC(i.domain())/1e3;return s(a)*o}}else if(Kl(e)){const t=n.context.paramBroker.createExpression(e.expr);return i=>t(null)*i}}return t=>t}const Dz=n=>!!(n!=null&&n.step);class Xh extends dle{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(e,t){throw new Error("Not implemented")}visit(e){let t;try{t=e(this)}catch(i){throw i.view=this,i}if(t===r_)return t;if(t!==cle){e.beforeChildren&&e.beforeChildren(this);for(const i of this){const s=i.visit(e);if(s===r_)return s}e.afterChildren&&e.afterChildren(this),e.postOrder&&e.postOrder(this)}}findDescendantByPath(e){for(const t of this)if(t.name===e[0]){if(e.length==1)return t;if(t instanceof Xh)return t.findDescendantByPath(e.slice(1))}}findChildByName(e){for(const t of this)if(t.name===e)return t}findDescendantByName(e){let t;return this.visit(i=>{if(i.name==e)return t=i,r_}),t}getDefaultResolution(e,t){return"shared"}}const BO=1;function GR(){let n=[0,1],e=[0,1],t=1,i=1,s=0,o=0,r=.5,a=0;const c=d=>(d+r-n[0])/t*i+e[0];return c.invert=d=>(d-e[0])/i*t+n[0]-r,c.domain=function(d){if(arguments.length){n=cQ(d),t=n[1]-n[0];const u=n[0]===0&&n[0]===0;if(ti/t,c.bandwidth=()=>c.step(),c.ticks=d=>{const u=c.align(),h=c.numberingOffset();return xC(n[0]-u+h,n[1]-u+h,Math.min(d,Math.ceil(t))).filter(Number.isInteger).map(f=>f-a)},c.tickFormat=(d,u)=>{if(u)throw new Error("Index scale's tickFormat does not support a specifier!");const f=Td(n[0],n[1],Math.min(d,Math.ceil(t)))<1e5?ls(","):ls(".3s");return g=>f(g+a)},c.copy=()=>GR().domain(n).range(e).paddingInner(s).paddingOuter(o).numberingOffset(a),c}function fle(){const n=GR().numberingOffset(1);let e;n.genome=function(i){return arguments.length?(e=i,n):e},n.ticks=i=>{if(!e)return[];const s=n.domain(),o=n.numberingOffset(),[r,a]=[Math.max(s[0],0),Math.min(s[1],e.totalSize-1)].map(d=>e.toChromosome(d)),l=Math.max(1,Td(s[0],s[1],i)),c=[];for(let d=r.index;d<=a.index;d++){const u=e.chromosomes[d],h=Math.max(u.continuousStart+l,s[0]-(s[0]-u.continuousStart)%l),f=Math.min(u.continuousEnd-l/4,s[1]+1);for(let g=h;g<=f;g+=l){const p=g-o;p>=s[0]&&p{if(!e)return;if(s)throw new Error("Locus scale's tickFormat does not support a specifier!");const o=n.domain(),r=o[1]-o[0],a=n.numberingOffset(),c=Td(o[0],o[1],Math.min(i,Math.ceil(r)))<1e6?ls(","):ls(".3s"),d=u=>u-e.toChromosome(u).continuousStart;return u=>c(d(u)+a)};const t=n.copy;return n.copy=()=>t().genome(e),n}function gle(n){return n.type=="locus"}function VC(n,e,t){if(t=t||[],n.some(r=>r===null)){if(n.every(r=>r===null))return null;throw console.warn(n),new Error("Cannot merge objects with nulls!")}const i={},s=(r,a)=>r===a||Zf(r)&&Zf(a)||Zf(r)&&a===!0||r===!0&&xo(a),o=r=>{for(let a in r){const l=r[a];if(!t.includes(a)&&l!==void 0)if(i[a]!==void 0&&!s(i[a],l))console.warn(`Conflicting property ${a} of ${e}: (${JSON.stringify(i[a])} and ${JSON.stringify(r[a])}). Using ${JSON.stringify(i[a])}.`);else{const c=i[a];if(Zf(c))Zf(l)&&(i[a]=VC([c,l],a));else if(Zf(l)){if(!(c===!0||c===void 0))throw new Error("Bug in merge! Target is: "+c);i[a]=VC([{},l],a)}else i[a]=l}}};for(const r of n)o(r);return i}function Zf(n){return xo(n)&&!Array.isArray(n)}/*! * Adapted from vega-encode: * https://github.com/vega/vega/blob/master/packages/vega-encode/src/ticks.js * @@ -2467,7 +2478,7 @@ void main() { * All rights reserved. * * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE - */function fz(n,e,t){return Xs(e)&&t!=null&&(e=Math.min(e,~~(pC(n.domain())/t)||1)),Lo(e)&&(e.step,e=e.interval),e}function gz(n,e,t){var i=n.range(),s=Math.floor(i[0]),o=Math.ceil(Yr(i));if(s>o&&(i=o,o=s,s=i),e=e.filter(function(a){return a=n(a),s<=a&&a<=o}),t>0&&e.length>1){for(var r=[e[0],Yr(e)];e.length>t&&e.length>=3;)e=e.filter(function(a,l){return!(l%2)});e.length<3&&(e=r)}return e}function Yae(n,e){return n.bins?gz(n,Zae(n.bins,e)):n.ticks?n.ticks(e):n.domain()}function Zae(n,e){var t=n.length,i=~~(t/(e||t));return i<2?n.slice():n.filter(function(s,o){return!(o%i)})}function Xae(n,e,t){var i=n.tickFormat?n.tickFormat(e,t):t?cs(t):String;if(HV(n.type)){var s=Jae(t);i=n.bins?s:Qae(i,s)}return i}function Qae(n,e){return function(t){return n(t)?e(t):""}}function Jae(n){var e=Ed(n||",");if(e.precision==null){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1;break}return ele(cs(e),cs(".1f")(1)[1])}else return cs(e)}function ele(n,e){return function(t){var i=n(t),s=i.indexOf(e),o,r;if(s<0)return i;for(o=tle(i,s),r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function tle(n,e){var t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}/*! + */function kz(n,e,t){return Xs(e)&&t!=null&&(e=Math.min(e,~~(CC(n.domain())/t)||1)),xo(e)&&(e.step,e=e.interval),e}function Ez(n,e,t){var i=n.range(),s=Math.floor(i[0]),o=Math.ceil(Xr(i));if(s>o&&(i=o,o=s,s=i),e=e.filter(function(a){return a=n(a),s<=a&&a<=o}),t>0&&e.length>1){for(var r=[e[0],Xr(e)];e.length>t&&e.length>=3;)e=e.filter(function(a,l){return!(l%2)});e.length<3&&(e=r)}return e}function ple(n,e){return n.bins?Ez(n,mle(n.bins,e)):n.ticks?n.ticks(e):n.domain()}function mle(n,e){var t=n.length,i=~~(t/(e||t));return i<2?n.slice():n.filter(function(s,o){return!(o%i)})}function _le(n,e,t){var i=n.tickFormat?n.tickFormat(e,t):t?ls(t):String;if(eH(n.type)){var s=vle(t);i=n.bins?s:ble(i,s)}return i}function ble(n,e){return function(t){return n(t)?e(t):""}}function vle(n){var e=Nd(n||",");if(e.precision==null){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1;break}return wle(ls(e),ls(".1f")(1)[1])}else return ls(e)}function wle(n,e){return function(t){var i=n(t),s=i.indexOf(e),o,r;if(s<0)return i;for(o=yle(i,s),r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function yle(n,e){var t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}/*! * Adapted from vega-encode: * https://github.com/vega/vega/blob/master/packages/vega-encode/src/Scale.js * @@ -2475,11 +2486,11 @@ void main() { * All rights reserved. * * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE - */const ile="locus",nle="index";var sle=5;function ole(n){const e=n.type;return!n.bins&&(e===Bp||e===Yv||e===Zv)}function pz(n){return rs(n)&&![Va,nle,ile].includes(n)}function mz(n){return n||{warn:(e,...t)=>console.warn(e,...t)}}var rle=mC(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function _z(n,e,t){t=mz(t);for(const i in n)if(!rle[i]){if(i==="padding"&&pz(e.type))continue;Co(e[i])?e[i](n[i]):t.warn("Unsupported scale property: "+i)}gle(e,n,fle(e,n,dle(e,n,t)))}function ale(n,e){const t=lle(n),i=Qt(t);if(!i)throw new Error("Unknown scale type: "+t);const s=i();return!n.domain&&rs(s.type)&&(n.domain=[0,0]),_z(n,s,e),s}function lle(n){var e=n.type,t="",i;return e===Va?Va+"-"+Bp:(cle(n)&&(i=n.rawDomain?n.rawDomain.length:n.domain?n.domain.length+ +(n.domainMid!=null):0,t=i===2?Va+"-":i===3?xm+"-":""),(t+e||Bp).toLowerCase())}function cle(n){const e=n.type;return rs(e)&&e!==MV&&e!==RV&&(n.scheme||n.range&&n.range.length&&n.range.every(Di))}function dle(n,e,t){if(!n.domain)return 0;t=mz(t);var i=ule(n,e.domainRaw,t);if(i>-1)return i;var s=e.domain,o=n.type,r=e.zero||e.zero===void 0&&ole(n),a,l;return s?(pz(o)&&e.padding&&s[0]!==Yr(s)&&(s=hle(o,s,e.range,e.padding,e.exponent,e.constant)),(r||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(s=s.slice()).length-1||1,r&&(s[0]>0&&(s[0]=0),s[a]<0&&(s[a]=0)),e.domainMin!=null&&(s[0]=e.domainMin),e.domainMax!=null&&(s[a]=e.domainMax),e.domainMid!=null&&(l=e.domainMid,(ls[a])&&t.warn("Scale domainMid exceeds domain min or max.",l),s.splice(a,0,l))),n.domain(bz(o,s,t)),o===uR&&n.unknown(e.domainImplicit?xE:void 0),e.nice&&n.nice&&n.nice(e.nice!==!0&&fz(n,e.nice)||null),s.length):0}function ule(n,e,t){return e?(n.domain(bz(n.type,e,t)),e.length):-1}function hle(n,e,t,i,s,o){var r=Math.abs(Yr(t)-t[0]),a=r/(r-2*i),l=n===Nd?iW(e,null,a):n===Zv?pE(e,null,a,.5):n===Yv?pE(e,null,a,s||1):n===Kx?mX(e,null,a,o||1):tW(e,null,a);return e=e.slice(),e[0]=l[0],e[e.length-1]=l[1],e}function bz(n,e,t){if(HV(n)){var i=Math.abs(e.reduce(function(s,o){return s+(o<0?-1:o>0?1:0)},0));i!==e.length&&t.warn("Log scale domain includes zero: "+Tx(e))}return e}function fle(n,e,t){let i=e.bins;if(i&&!Eo(i)){const s=(i.start==null||i.stop==null)&&n.domain(),o=i.start==null?s[0]:i.start,r=i.stop==null?Yr(s):i.stop,a=i.step;a||qi("Scale bins parameter missing step property."),i=V_(o,r+a,a)}return i?n.bins=i:n.bins&&delete n.bins,n.type===hR&&(i?!e.domain&&!e.domainRaw&&(n.domain(i),t=i.length):n.bins=n.domain()),t}function gle(n,e,t){var i=n.type,s=e.round||!1,o=e.range;if(e.rangeStep!=null)o=ple(i,e,t);else if(e.scheme&&(o=mle(i,e,t),Co(o))){if(n.interpolator)return n.interpolator(o);qi(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&Yx(i))return n.interpolator(Zx(tI(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&n.interpolate?n.interpolate(zV(e.interpolate,e.interpolateGamma)):Co(n.round)?n.round(s):Co(n.rangeRound)&&n.interpolate(s?Gv:Jd),o&&n.range(tI(o,e.reverse))}function ple(n,e,t){n!==FV&&n!==PE&&qi("Only band and point scales support rangeStep.");var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,s=n===PE?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*dR(t,s,i)]}function mle(n,e,t){var i=e.schemeExtent,s,o;return Eo(e.scheme)?o=Zx(e.scheme,e.interpolate,e.interpolateGamma):(s=e.scheme.toLowerCase(),o=gR(s),o||qi(`Unrecognized scheme name: ${e.scheme}`)),t=n===OV?t+1:n===hR?t-1:n===RE||n===PV?+e.schemeCount||sle:t,Yx(n)?DO(o,i,e.reverse):Co(o)?Tie(DO(o,i),t):n===uR?o:o.slice(0,t)}function DO(n,e,t){return Co(n)&&(e||t)?Aie(n,tI(e||[0,1],t)):n}function tI(n,e){return e?n.slice().reverse():n}const kO=cs(",d");function _le(n,e){return n.chrom+":"+kO(Math.floor(n.pos+1))+"-"+(n.chrom!=e.chrom?e.chrom+":":"")+kO(Math.ceil(e.pos))}const ble="https://genomespy.app/data/genomes/";class vle{constructor(e){if(this.config=e,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(e){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:e+"/"+this.config.baseUrl:this.baseUrl=ble;try{this.setChromSizes(wle(await Ox({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(t){throw new Error(`Could not load chrom sizes: ${t.message}`)}}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith("chr"))}setChromSizes(e){let t=0;this.startByIndex=[0];for(let i=0;ithis.totalSize)return;e=Math.floor(e);const t=Dd(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){const t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return _le(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const t=this.toChromosomal(e[0]+.5),i=this.toChromosomal(e[1]-.5);return i.pos+=1,[t,i]}toContinuousInterval(e){var s;let[t,i]=e;return i||(i=t),[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(i.chrom,i.pos??((s=this.chromosomesByName.get(i.chrom))==null?void 0:s.size))]}toDiscreteChromosomeIntervals(e){const t=e[0],i=e[1],s=[];if(t.chrom===i.chrom)s.push({chrom:t.chrom,startPos:t.pos,endPos:i.pos});else{const o=this.chromosomes.findIndex(a=>a.name===t.chrom),r=this.chromosomes.findIndex(a=>a.name===i.chrom);s.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[o].size});for(let a=o+1;aa===void 0)){const a=this.getChromosome(i);return a?[a.continuousStart,a.continuousEnd]:void 0}const s=t[3]||i,o=parseInt(t[2].replace(/,/g,"")),r=t[4]!==void 0?parseInt(t[4].replace(/,/g,"")):o;return[this.toContinuous(i,o-1),this.toContinuous(s,r)]}}}function wle(n){return PX(n).filter(e=>/^chr[0-9A-Z]+$/.test(e[0])).map(([e,t])=>({name:e,size:parseInt(t)}))}function vz(n){return Lo(n)&&"chrom"in n}function yle(n){return n.every(vz)}class s1 extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof s1&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const t of e)this.extend(t);return this}extendAllWithAccessor(e,t){for(const i of e)this.extend(t(i));return this}}class wk extends s1{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?ethis[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class wz extends s1{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class yz extends wz{constructor(){super(),this.type="nominal"}}class Cle extends s1{constructor(e){super();let t=0;for(let i=1;ithis.push(i))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const EO={quantitative:wk,index:wk,locus:wk,nominal:yz,ordinal:wz};function IO(n,e){if(n=="quantitative"&&Sle(e)){const t=new Cle(e);return t.type=n,t}else if(EO[n]){const t=new EO[n];return t.type=n,e&&t.extendAll(e),t}throw new Error("Unknown type: "+n)}function Sle(n){return n&&n.length>0&&n.length!=2&&n.every(e=>typeof e=="number")}function xle(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}function Lle(n,e,t){return n*Math.pow(e/n,t)}Qt("index",OR,["continuous"]);Qt("locus",Gae,["continuous"]);Qt("null",Xx,[]);const AO="quantitative",Cz="ordinal",Sz="nominal",xz="locus",Dle="index";var Ll,yp,es,va,Lc,bx,Lz,Cp,Dy,Dl,Nu,Lv,iI,vx,Dz,fM,Ele,Dv,nI;class kle{constructor(e){et(this,va);et(this,bx);et(this,Cp);et(this,Dl);et(this,Lv);et(this,vx);et(this,fM);et(this,Dv);et(this,Ll,void 0);et(this,yp,new Set);et(this,es,void 0);this.channel=e,this.members=[],this.type=null,this.name=void 0}addEventListener(e,t){if(e!="domain")throw new Error("Unsupported event type: "+e);ve(this,yp).add(t)}removeEventListener(e,t){if(e!="domain")throw new Error("Unsupported event type: "+e);ve(this,yp).delete(t)}pushUnitView(e,t){var r;const i=OE(e,t),s=i.type,o=(r=i==null?void 0:i.scale)==null?void 0:r.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=s;else if(s!==this.type&&!i_(t))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${s}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:e,channel:t})}isExplicitDomain(){return!!this.getConfiguredDomain()}isDomainInitialized(){const e=ve(this,es);if(!e)return!1;const t=e.domain();return rs(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0}getScaleProps(){return zp(this,"scaleProps",()=>{const e=tt(this,bx,Lz).call(this);if(e===null||e.type=="null")return{type:"null"};const t={...tt(this,vx,Dz).call(this,this.type),...e};t.type||(t.type=Ile(this.channel,this.type));const i=tt(this,Cp,Dy).call(this);return i&&i.length>0?t.domain=i:Ua(t.type)&&(t.domain=new yz),!t.domain&&t.domainMid!==void 0&&(t.domain=[t.domainMin??0,t.domainMax??1]),this.channel=="y"&&Ua(t.type)&&t.reverse==null&&(t.reverse=!0),t.range&&t.scheme&&delete t.scheme,!("zoom"in t)&&["index","locus"].includes(t.type)&&(t.zoom=!0),Ale(t,this.channel),t})}getConfiguredDomain(){return tt(this,Dv,nI).call(this,e=>i_(e.channel)?void 0:e.view.getConfiguredDomain(e.channel))}getDataDomain(){return tt(this,Dv,nI).call(this,e=>i_(e.channel)?void 0:e.view.extractDataDomain(e.channel))}reconfigure(){if(ve(this,es)&&ve(this,es).type!="null"){const e=this.isDomainInitialized(),t=ve(this,es).domain();iz(this,"scaleProps");const i=this.getScaleProps();if(_z(i,ve(this,es)),rs(ve(this,es).type)&&Ei(this,Ll,tt(this,Lv,iI).call(this)),!e){tt(this,va,Lc).call(this);return}const s=ve(this,es).domain();CC(s,t)||(this.isZoomable()?ve(this,es).domain(t):tt(this,Dl,Nu).call(this)?(ve(this,es).domain(t),this.zoomTo(s,500)):tt(this,va,Lc).call(this))}}getScale(){if(ve(this,es))return ve(this,es);const e=this.getScaleProps(),t=ale(e);return Ei(this,es,t),Kae(t)&&t.genome(this.getGenome()),rs(t.type)&&Ei(this,Ll,tt(this,Lv,iI).call(this)),t}getDomain(){return this.getScale().domain()}getComplexDomain(){var e;return((e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return tt(this,Dl,Nu).call(this)&&CC(tt(this,Cp,Dy).call(this),this.getDomain())}isZoomable(){return tt(this,Dl,Nu).call(this)&&!!this.getScaleProps().zoom}zoom(e,t,i){if(!tt(this,Dl,Nu).call(this))return!1;const s=this.getScale(),o=s.domain();let r=[...o],a=s.invert(t);switch(this.getScaleProps().reverse&&(i=-i),"align"in s&&(a+=s.align()),s.type){case"linear":case"index":case"locus":r=fX(r,i||0),r=tW(r,a,e);break;case"log":r=gX(r,i||0),r=iW(r,a,e);break;case"pow":case"sqrt":{const l=s;r=pX(r,i||0,l.exponent()),r=pE(r,a,e,l.exponent());break}default:throw new Error("Zooming is not implemented for: "+s.type)}return ve(this,Ll)&&(r=_X(r,ve(this,Ll)[0],ve(this,Ll)[1])),[0,1].some(l=>r[l]!=o[l])?(s.domain(r),tt(this,va,Lc).call(this),!0):!1}async zoomTo(e,t=!1){var a;if(Wv(t)&&(t=t?700:0),!tt(this,Dl,Nu).call(this))throw new Error("Not a zoomable scale!");const i=this.fromComplexInterval(e),s=(a=this.members[0])==null?void 0:a.view.context.animator,o=this.getScale(),r=o.domain();if(t>0&&r.length==2){const l=r[1]-r[0],c=r[0]+l/2,d=i[1]-i[0],u=i[0]+d/2;await s.transition({duration:t,easingFunction:xle,onUpdate:h=>{const f=Lle(l,d,h),g=(l-f)/(l-d),p=g*u+(1-g)*c;o.domain([p-f/2,p+f/2]),tt(this,va,Lc).call(this)}}),o.domain(i),tt(this,va,Lc).call(this)}else o.domain(i),s==null||s.requestRender(),tt(this,va,Lc).call(this)}resetZoom(){if(!tt(this,Dl,Nu).call(this))throw new Error("Not a zoomable scale!");const e=this.getDomain(),t=tt(this,Cp,Dy).call(this);return[0,1].some(i=>t[i]!=e[i])?(ve(this,es).domain(t),tt(this,va,Lc).call(this),!0):!1}getZoomLevel(){return this.isZoomable()?pC(ve(this,Ll))/pC(this.getScale().domain()):1}getGenome(){var t;if(this.type!=="locus")return;const e=(t=this.members[0].view.context.genomeStore)==null?void 0:t.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const t=this.getScale();if("invert"in t){const i=t.invert(e);return this.toComplex(i)}else throw new Error("The scale does not support inverting!")}toComplex(e){const t=this.getGenome();return t?t.toChromosomal(e):e}fromComplex(e){return vz(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&yle(e)?this.getGenome().toContinuousInterval(e):e}}Ll=new WeakMap,yp=new WeakMap,es=new WeakMap,va=new WeakSet,Lc=function(){for(const e of ve(this,yp).values())e({type:"domain",scaleResolution:this})},bx=new WeakSet,Lz=function(){return zp(this,"mergedScaleProps",()=>{const e=this.members.map(t=>OE(t.view,t.channel).scale).filter(t=>t!==void 0);return PC(e,"scale",["domain"])})},Cp=new WeakSet,Dy=function(){return this.getConfiguredDomain()??(this.type==xz?this.getGenome().getExtent():this.getDataDomain())},Dl=new WeakSet,Nu=function(){const e=this.getScale().type;return rs(e)},Lv=new WeakSet,iI=function(){const e=this.getScaleProps(),t=e.zoom;if(Tle(t)&&Eo(t.extent))return this.fromComplexInterval(t.extent);if(t)return e.type=="locus"?this.getGenome().getExtent():ve(this,es).domain()},vx=new WeakSet,Dz=function(e){const t=this.channel,i={};return this.isExplicitDomain()&&(i.zero=!1),ib(t)?i.nice=!this.isExplicitDomain():xh(t)?i.scheme=e==Sz?"tableau10":e==Cz?"blues":"viridis":Jx(t)?i.range=t=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:t=="size"?i.range=[0,400]:t=="angle"&&(i.range=[0,360]),i},fM=new WeakSet,Ele=function(){return this.members.map(e=>e.view.getPathString()).join(", ")},Dv=new WeakSet,nI=function(e){const t=this.members.filter(i=>!i.view.getLayoutAncestors().some(s=>!s.options.contributesToScaleDomain)).map(e).filter(i=>!!i);if(t.length)return t.reduce((i,s)=>i.extendAll(s))};function Ile(n,e){if(e==Dle||e==xz){if(qV(n))return e;throw new Error(`${n} does not support ${e} data type. Only positional channels do.`)}const t={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},s=["sample"].includes(n)?"null":t[n]?t[n][[Sz,Cz,AO].indexOf(e)]:e==AO?"linear":"ordinal";if(s===void 0)throw new Error(`Channel "${n}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return s}function Ale(n,e){ib(e)&&n.type!=="ordinal"&&(n.range=[0,1]),e=="opacity"&&rs(n.type)&&(n.clamp=!0)}function Tle(n){return Lo(n)}function sI(n){const e=new Set;function t(i){for(const s of Object.values(i.resolutions.scale))e.add(s)}for(const i of qs(n)){i.visit(t);for(const s of i.getDataAncestors()){if(!s.options.contributesToScaleDomain)break;t(s)}}e.forEach(i=>i.reconfigure())}function yk(...n){for(const e of n)if(e!==void 0)return e}class Nle{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=zv(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}pushUnitView(e,t){const i=e.getScaleResolution(this.channel);if(!i)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&i!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:e,channel:t})}getAxisProps(){return zp(this,"axisProps",()=>{const e=this.members.map(t=>{const i=t.view.mark.encoding[t.channel];return"axis"in i&&i.axis});return e.length>0&&e.some(t=>t===null)?null:PC(e.filter(t=>t!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var a;const r=OE(o.view,o.channel);if(!Zr(r))return{member:o,explicitTitle:yk("axis"in r?(a=r.axis)==null?void 0:a.title:void 0,r.title),implicitTitle:yk(wf(r)?r.field:void 0,Qx(r)?r.expr:void 0)}},t=this.members.map(e),i=t.filter(o=>{var r;if(i_(o.member.channel)&&!o.explicitTitle){const a=Yh(o.member.channel);return((r=t.find(l=>l.member.view==o.member.view&&l.member.channel==a))==null?void 0:r.explicitTitle)===void 0}return!0}),s=new Set(i.map(o=>yk(o.explicitTitle,o.implicitTitle)).filter(Di));return s.size?[...s].join(", "):null}}const Mle={point:yae,rect:fae,rule:Lae,link:Tae,text:Bae};class Oo extends Xh{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e;const a=Mle[this.getMarkType()];if(a)this.mark=new a(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),this.needsAxes={x:!0,y:!0}}render(e,t,i={}){super.render(e,t,i),this.isConfiguredVisible()&&(e.pushView(this,t),e.renderMark(this.mark,i),e.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(e){e||(this.resolve("scale"),this.resolve("axis"));const t=this.mark.encoding;for(const[i,s]of Object.entries(t)){if(!_o(s))continue;const o=Yh(s.resolutionChannel??i);if(!Lh(o)||e=="axis"&&!ib(o))continue;let r=this;for(;(r.getConfiguredOrDefaultResolution(o,e)=="forced"||r.dataParent instanceof Xh&&["shared","excluded","forced"].includes(r.dataParent.getConfiguredOrDefaultResolution(o,e)))&&r.getConfiguredOrDefaultResolution(o,e)!="excluded";)r=r.dataParent;e=="axis"&&ib(i)&&qV(o)?(r.resolutions[e][o]||(r.resolutions[e][o]=new Nle(o)),r.resolutions[e][o].pushUnitView(this,i)):e=="scale"&&Lh(i)&&(r.resolutions[e][o]||(r.resolutions[e][o]=new kle(o)),r.resolutions[e][o].pushUnitView(this,i))}}getAccessor(e){return this._cache("accessor/"+e,()=>{const t=this.mark.encoding;if(t&&t[e])return this.context.accessorFactory.createAccessor(t[e])})}getFacetAccessor(e){const t=this.getAccessor("sample");return t||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(e){if(i_(e))throw new Error(`getDomain(${e}), must only be called for primary channels!`);const t=this.mark.encoding[e];if(!_o(t))throw new Error("The channel has no scale, cannot get domain!");return t}getConfiguredDomain(e){const t=this._validateDomainQuery(e),i=t&&t.scale&&t.scale.domain;if(i){const s=this.getScaleResolution(t.resolutionChannel??e);return IO(t.type??"nominal",s.fromComplexInterval(i))}}extractDataDomain(e){const i=this._validateDomainQuery(e).type??"nominal",s=a=>{let l;const c=this.mark.encoding[a];if(c){const d=this.context.accessorFactory.createAccessor(c);if(d)if(l=IO(i),d.constant)l.extend(d({}));else{const u=this.getCollector();u!=null&&u.completed&&u.visitData(h=>l.extend(d(h)))}}return l};let o=s(e);const r=pR[e];if(r){const a=s(r);a&&o.extendAll(a)}return o}getZoomLevel(){const e=t=>{var i;return((i=this.getScaleResolution(t))==null?void 0:i.getZoomLevel())??1};return Lm.map(e).reduce((t,i)=>t*i,1)}propagateInteractionEvent(e){this.handleInteractionEvent(void 0,e,!0),e.target=this,!e.stopped&&this.handleInteractionEvent(void 0,e,!1)}getDefaultResolution(e,t){return e=="x"?"shared":"independent"}}function*FR(n,e=[]){for(const[t,i]of n.entries())if(i instanceof Map)for(const s of FR(i,[...e,t]))yield s;else yield[[...e,t],i]}class kz extends pn{get behavior(){return PR}constructor(e){super(),this.params=e??{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new kd([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(e){this._data.push(e)}beginBatch(e){bae(e)&&(this._data=[],this.facetBatches.set(qs(e.facetId),this._data))}complete(){var s,o;const e=(s=this.params)==null?void 0:s.sort,t=e?nW(e.field,e.order):void 0,i=r=>{t&&r.sort(t)};if((o=this.params.groupby)!=null&&o.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const r=this.params.groupby.map(l=>yi(l)),a=r.length>1?Mx(this._data,...r):Rle(this._data,r[0]);this.facetBatches.clear();for(const[l,c]of FR(a))this.facetBatches.set(l,c)}for(const r of this.facetBatches.values())i(r);if(this.children.length)for(const[r,a]of this.facetBatches.entries()){if(r){const l={type:"facet",facetId:r};for(const c of this.children)c.beginBatch(l)}for(const l of a)this._propagate(l)}super.complete();for(const r of this.observers)r(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const e=this.facetBatches;return{[Symbol.iterator]:function*(){for(const i of e.values())for(let s=0;s0;){const s=i-1>>1,o=this.values[s];if(t>=o)break;this.ids[i]=this.ids[s],this.values[i]=o,i=s}this.ids[i]=e,this.values[i]=t}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const t=this.ids[0]=this.ids[this.length],i=this.values[0]=this.values[this.length],s=this.length>>1;let o=0;for(;o=i)break;this.ids[o]=l,this.values[o]=c,o=r}this.ids[o]=t,this.values[o]=i}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class Ple extends pn{get behavior(){return nl}constructor(e){super(),this.params=e,this.startAccessor=yi(e.start),this.endAccessor=yi(e.end),this.chromAccessor=e.chrom?yi(e.chrom):t=>{},this.weightAccessor=e.weight?yi(e.weight):t=>1,this.as={coverage:e.as||"coverage",start:e.asStart||e.start,end:e.asEnd||e.end,chrom:e.asChrom||e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([t,i])=>i).map(([t,i])=>`${JSON.stringify(i)}: ${t}`).join(", ")+"};"),this.ends=new OC}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,t=this.as.end,i=this.as.chrom,s=this.startAccessor,o=this.endAccessor,r=this.chromAccessor,a=this.weightAccessor;let l,c,d,u=0,h;const f=this.ends;f.clear();const g=(_,v,b)=>{if(_==v)return;let w=!1;l&&(l[e]===b?(l[t]=v,w=!0):l[e]!=0&&this._propagate(l)),w||(l=this.createSegment(_,v,b,d))},p=()=>{let _=0;for(;(_=f.peekValue())!==void 0;)g(h,_,u),h=_,u-=f.pop();h=void 0,l&&(this._propagate(l),l=void 0)};this.handle=_=>{const v=s(_);let b=0;for(;(b=f.peekValue())!==void 0&&b{p(),super.complete()},this.beginBatch=_=>{p(),c=void 0,super.beginBatch(_)}}}function Ole(n,e,t=0,i=n.length){const s=new OC,o=i-t;let r;for(r=0;r=s.peekValue()&&(s.push(r,c),s.pop())}const a=[];let l;for(;(l=s.pop())!==void 0;)a.push(t+l);return a.reverse()}class Fle{constructor(e,t=-1/0,i=1/0){this.maxSize=e,this.lowerLimit=t,this.upperLimit=i;const s=this.maxSize*2+1;this.lowerLimits=new Float64Array(s),this.upperLimits=new Float64Array(s),this.lowerChildren=new Int32Array(s),this.upperChildren=new Int32Array(s),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,t,i=0){if(e>=this.lowerLimits[i]&&t<=this.upperLimits[i]){const s=this.lowerChildren[i];if(s){const o=this._findSlot(e,t,s);return o>=0?o:this._findSlot(e,t,this.upperChildren[i])}else return i}else return-1}reserve(e,t){if(t-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const i=this._findSlot(e,t);if(i<0)return!1;const s=this.n++,o=this.n++;return this.lowerLimits[s]=this.lowerLimits[i],this.upperLimits[s]=e,this.lowerLimits[o]=t,this.upperLimits[o]=this.upperLimits[i],this.lowerChildren[i]=s,this.upperChildren[i]=o,!0}}class Ble extends pn{get behavior(){return PR}constructor(e,t){if(super(),this.params=e,this._data=[],this.channel=e.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=yi(this.params.pos),this.posBisector=Nx(this.posAccessor),this.scoreAccessor=yi(this.params.score),this.widthAccessor=yi(this.params.width),this.laneAccessor=this.params.lane?yi(this.params.lane):s=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=t.getScaleResolution(this.channel);const i=()=>this._filterAndPropagate();this.schedule=()=>t.context.animator.requestTransition(i),this.resolution.addEventListener("domain",s=>this.schedule()),t._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((t,i)=>e(t)-e(i)),this._scores=this._data.map(this.scoreAccessor);for(const t of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(t,new Fle(200));this.schedule(),super.complete()}_filterAndPropagate(){var r;super.reset();const e=this.resolution.getScale(),t=(r=this.resolution.members[0].view.coords)==null?void 0:r[this.channel=="x"?"width":"height"];if(!t)return;for(const a of this.reservationMaps.values())a.reset();const i=e.domain(),s=70,o=Ole(this._scores,s,this.posBisector.left(this._data,i[0]),this.posBisector.right(this._data,i[1]));for(const a of o){const l=this._data[a],c=e(this.posAccessor(l))*t,d=this.widthAccessor(l)/2+this.padding;this.reservationMaps.get(this.laneAccessor(l)).reserve(c-d,c+d)&&this._propagate(l)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class Wle extends pn{constructor(e){super(),this.params=e,this.predicate=void 0}initialize(){this.predicate=Hx(this.params.expr,this.getGlobalObject())}handle(e){this.predicate(e)&&this._propagate(e)}}class Vle extends pn{get behavior(){return nl}constructor(e){super();const t=e.index;if(e.fields){const i=qs(e.fields).map(o=>yi(o)),s=qs(e.as||e.fields);if(i.length!==s.length)throw new Error(`Lengths of "fields" (${i.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{const r=i.map((l,c)=>l(o)??[]),a=r[0].length;for(let l=0;l{for(let s=0;s{let a=i(r),l=a,c=!0;const d=t(r);for(const u of zle(d)){if(c)l=a+u;else{a=l+u;const h=Object.assign({},r);h[s]=l,h[o]=a,this._propagate(h)}c=!c}}}}class Ule extends pn{get behavior(){return nl}constructor(e){super();const t=qs(e.field).map(o=>yi(o)),i=qs(e.separator),s=qs(e.as||e.field);if(t.length!==i.length||t.length!==s.length)throw new Error(`Lengths of "separator" (${i.length}), "fields" (${t.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{if(t.some(l=>!l(o)))return;const r=t.map((l,c)=>l(o).split(i[c]));jle(r,o);const a=r[0].length;for(let l=0;li.length);if(!t.every(i=>i==t[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class qle extends pn{get behavior(){return su}constructor(e){super(),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=Hx(this.params.expr,this.getGlobalObject())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class Ez extends pn{get behavior(){return su}constructor(e,t){super();const i=e.channel??"x";if(!["x","y"].includes(i))throw new Error("Invalid channel: "+i);const s=t.getScaleResolution(i).getGenome();if(!s)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=yi(e.chrom),r=qs(e.pos).map(g=>yi(g)),a=qs(e.as);if(r.length!=a.length)throw new Error('The number of "pos" and "as" elements must be equal!');const l=qs(e.offset);let c;if(l.length==0)c=new Array(r.length).fill(0);else if(l.length==1)c=new Array(r.length).fill(l[0]);else if(l.length==r.length)c=l;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const d=new Function("datum","chromOffset","posAccessors",a.map((g,p)=>`datum[${JSON.stringify(g)}] = chromOffset + +posAccessors[${p}](datum) - ${c[p]};`).join(` -`));let u,h=0;const f=g=>{if(g!==u){if(h=s.cumulativeChromPositions.get(g),h===void 0)throw new Error("Unknown chromosome/contig: "+g);u=g}return h};this.handle=g=>{d(g,f(o(g)),r),this._propagate(g)}}}const Gle=["Lato-Regular.png"],Kle=[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],Yle={face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},Zle={lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},Xle=[],Iz={pages:Gle,chars:Kle,info:Yle,common:Zle,kernings:Xle};class Qle extends pn{get behavior(){return su}constructor(e){super();const t=GE(Iz),i=yi(e.field),s=e.as,o=e.fontSize;this.handle=r=>{const a=i(r);a!==void 0?r[s]=t.measureWidth(a,o):r[s]=0,this._propagate(r)}}}const Jle=65536;class ece extends pn{get behavior(){return su}constructor(e){super(),this.params=e}reset(){super.reset(),this.initialize()}initialize(){const e=this.params,t=e.as||"lane",i=Xs(e.spacing)?e.spacing:1,s=yi(e.start),o=yi(e.end);if(!e.preference!=!e.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(e.preference){const r=new Float64Array(Jle),a=yi(e.preference),l=e.preferredOrder;let c=1/0;this.handle=d=>{const u=s(d);u=0&&r[h]=r.length)throw new Error("Out of lanes!")}r[f]=o(d)+i,d[t]=f,this._propagate(d)}}else{const r=new OC,a=new OC;let l=-1/0,c=0;this.handle=d=>{const u=s(d);for(;r.length&&(r.peekValue()<=u||uyi(s)),i=e.as?e.as:t.map(rX);this.handle=s=>{const o={};for(let r=0;r{const r=s(o);if(Di(r)){const a=r.match(t);if(a){if(a.length-1!=i.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let l=0;lnew RegExp(h)),i=qs(e.asValue);if(t.length!=i.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const s=e.skipRegex?new RegExp(e.skipRegex):void 0,o=e.asKey||"sample";let r,a,l;const c=h=>{var _;const f=Object.keys(h);for(const v of t)if(!f.some(b=>v.test(b)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const g=new Map;for(const[v,b]of t.entries())for(const w of f){const y=(_=b.exec(w))==null?void 0:_[1];if(y!==void 0){let S=g.get(y);S||(S=[],g.set(y,S)),S[v]=w}}r=[...g.entries()],a=f.filter(v=>!t.some(b=>b.test(v))&&!(s&&s.test(v)));const p=[...a.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(o)+": sampleId",...i.map((v,b)=>JSON.stringify(v)+`: datum[attrs[${b}]]`)];l=new Function("datum","sampleId","attrs",`return { + */const Cle="locus",Sle="index";var xle=5;function Lle(n){const e=n.type;return!n.bins&&(e===Vp||e===i1||e===n1)}function Iz(n){return rs(n)&&![Va,Sle,Cle].includes(n)}function Az(n){return n||{warn:(e,...t)=>console.warn(e,...t)}}var Dle=SC(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function Tz(n,e,t){t=Az(t);for(const i in n)if(!Dle[i]){if(i==="padding"&&Iz(e.type))continue;yo(e[i])?e[i](n[i]):t.warn("Unsupported scale property: "+i)}Rle(e,n,Mle(e,n,Ale(e,n,t)))}function kle(n,e){const t=Ele(n),i=Jt(t);if(!i)throw new Error("Unknown scale type: "+t);const s=i();return!n.domain&&rs(s.type)&&(n.domain=[0,0]),Tz(n,s,e),s}function Ele(n){var e=n.type,t="",i;return e===Va?Va+"-"+Vp:(Ile(n)&&(i=n.rawDomain?n.rawDomain.length:n.domain?n.domain.length+ +(n.domainMid!=null):0,t=i===2?Va+"-":i===3?Dm+"-":""),(t+e||Vp).toLowerCase())}function Ile(n){const e=n.type;return rs(e)&&e!==qV&&e!==GV&&(n.scheme||n.range&&n.range.length&&n.range.every(Ei))}function Ale(n,e,t){if(!n.domain)return 0;t=Az(t);var i=Tle(n,e.domainRaw,t);if(i>-1)return i;var s=e.domain,o=n.type,r=e.zero||e.zero===void 0&&Lle(n),a,l;return s?(Iz(o)&&e.padding&&s[0]!==Xr(s)&&(s=Nle(o,s,e.range,e.padding,e.exponent,e.constant)),(r||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(s=s.slice()).length-1||1,r&&(s[0]>0&&(s[0]=0),s[a]<0&&(s[a]=0)),e.domainMin!=null&&(s[0]=e.domainMin),e.domainMax!=null&&(s[a]=e.domainMax),e.domainMid!=null&&(l=e.domainMid,(ls[a])&&t.warn("Scale domainMid exceeds domain min or max.",l),s.splice(a,0,l))),n.domain(Nz(o,s,t)),o===yR&&n.unknown(e.domainImplicit?TE:void 0),e.nice&&n.nice&&n.nice(e.nice!==!0&&kz(n,e.nice)||null),s.length):0}function Tle(n,e,t){return e?(n.domain(Nz(n.type,e,t)),e.length):-1}function Nle(n,e,t,i,s,o){var r=Math.abs(Xr(t)-t[0]),a=r/(r-2*i),l=n===Od?pW(e,null,a):n===n1?yE(e,null,a,.5):n===i1?yE(e,null,a,s||1):n===tL?MX(e,null,a,o||1):gW(e,null,a);return e=e.slice(),e[0]=l[0],e[e.length-1]=l[1],e}function Nz(n,e,t){if(eH(n)){var i=Math.abs(e.reduce(function(s,o){return s+(o<0?-1:o>0?1:0)},0));i!==e.length&&t.warn("Log scale domain includes zero: "+Bx(e))}return e}function Mle(n,e,t){let i=e.bins;if(i&&!Zs(i)){const s=(i.start==null||i.stop==null)&&n.domain(),o=i.start==null?s[0]:i.start,r=i.stop==null?Xr(s):i.stop,a=i.step;a||qi("Scale bins parameter missing step property."),i=H_(o,r+a,a)}return i?n.bins=i:n.bins&&delete n.bins,n.type===CR&&(i?!e.domain&&!e.domainRaw&&(n.domain(i),t=i.length):n.bins=n.domain()),t}function Rle(n,e,t){var i=n.type,s=e.round||!1,o=e.range;if(e.rangeStep!=null)o=Ple(i,e,t);else if(e.scheme&&(o=Ole(i,e,t),yo(o))){if(n.interpolator)return n.interpolator(o);qi(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&iL(i))return n.interpolator(nL(lI(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&n.interpolate?n.interpolate(tH(e.interpolate,e.interpolateGamma)):yo(n.round)?n.round(s):yo(n.rangeRound)&&n.interpolate(s?e1:su),o&&n.range(lI(o,e.reverse))}function Ple(n,e,t){n!==ZV&&n!==zE&&qi("Only band and point scales support rangeStep.");var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,s=n===zE?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*wR(t,s,i)]}function Ole(n,e,t){var i=e.schemeExtent,s,o;return Zs(e.scheme)?o=nL(e.scheme,e.interpolate,e.interpolateGamma):(s=e.scheme.toLowerCase(),o=xR(s),o||qi(`Unrecognized scheme name: ${e.scheme}`)),t=n===YV?t+1:n===CR?t-1:n===HE||n===KV?+e.schemeCount||xle:t,iL(n)?WO(o,i,e.reverse):yo(o)?Kie(WO(o,i),t):n===yR?o:o.slice(0,t)}function WO(n,e,t){return yo(n)&&(e||t)?Gie(n,lI(e||[0,1],t)):n}function lI(n,e){return e?n.slice().reverse():n}const VO=ls(",d");function Fle(n,e){return n.chrom+":"+VO(Math.floor(n.pos+1))+"-"+(n.chrom!=e.chrom?e.chrom+":":"")+VO(Math.ceil(e.pos))}const Ble="https://genomespy.app/data/genomes/";class Wle{constructor(e){if(this.config=e,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(e){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:e+"/"+this.config.baseUrl:this.baseUrl=Ble;try{this.setChromSizes(Vle(await $x({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(t){throw new Error(`Could not load chrom sizes: ${t.message}`)}}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith("chr"))}setChromSizes(e){let t=0;this.startByIndex=[0];for(let i=0;ithis.totalSize)return;e=Math.floor(e);const t=Id(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){const t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return Fle(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const t=this.toChromosomal(e[0]+.5),i=this.toChromosomal(e[1]-.5);return i.pos+=1,[t,i]}toContinuousInterval(e){var s;let[t,i]=e;return i||(i=t),[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(i.chrom,i.pos??((s=this.chromosomesByName.get(i.chrom))==null?void 0:s.size))]}toDiscreteChromosomeIntervals(e){const t=e[0],i=e[1],s=[];if(t.chrom===i.chrom)s.push({chrom:t.chrom,startPos:t.pos,endPos:i.pos});else{const o=this.chromosomes.findIndex(a=>a.name===t.chrom),r=this.chromosomes.findIndex(a=>a.name===i.chrom);s.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[o].size});for(let a=o+1;aa===void 0)){const a=this.getChromosome(i);return a?[a.continuousStart,a.continuousEnd]:void 0}const s=t[3]||i,o=parseInt(t[2].replace(/,/g,"")),r=t[4]!==void 0?parseInt(t[4].replace(/,/g,"")):o;return[this.toContinuous(i,o-1),this.toContinuous(s,r)]}}}function Vle(n){return QX(n).filter(e=>/^chr[0-9A-Z]+$/.test(e[0])).map(([e,t])=>({name:e,size:parseInt(t)}))}function Mz(n){return xo(n)&&"chrom"in n}function Hle(n){return n.every(Mz)}class u1 extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof u1&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const t of e)this.extend(t);return this}extendAllWithAccessor(e,t){for(const i of e)this.extend(t(i));return this}}class Dk extends u1{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?ethis[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class Rz extends u1{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class Pz extends Rz{constructor(){super(),this.type="nominal"}}class zle extends u1{constructor(e){super();let t=0;for(let i=1;ithis.push(i))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const HO={quantitative:Dk,index:Dk,locus:Dk,nominal:Pz,ordinal:Rz};function zO(n,e){if(n=="quantitative"&&$le(e)){const t=new zle(e);return t.type=n,t}else if(HO[n]){const t=new HO[n];return t.type=n,e&&t.extendAll(e),t}throw new Error("Unknown type: "+n)}function $le(n){return n&&n.length>0&&n.length!=2&&n.every(e=>typeof e=="number")}function Ule(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}function jle(n,e,t){return n*Math.pow(e/n,t)}Jt("index",GR,["continuous"]);Jt("locus",fle,["continuous"]);Jt("null",sL,[]);const $O="quantitative",Oz="ordinal",Fz="nominal",Bz="locus",qle="index";var kl,Cp,Ao,kv,Cx,Wz,Br,ml,Ev,cI,Sx,Vz,xx,Hz,Iv,dI,Av,uI,Sp,My,El,Fu,Tv,hI,Lx,zz,SM,Kle,Nv,fI;class Gle{constructor(e){Fe(this,Cx);Fe(this,Br);Fe(this,Ev);Fe(this,Sx);Fe(this,xx);Fe(this,Iv);Fe(this,Av);Fe(this,Sp);Fe(this,El);Fe(this,Tv);Fe(this,Lx);Fe(this,SM);Fe(this,Nv);Fe(this,kl,void 0);Fe(this,Cp,{domain:new Set,range:new Set});Fe(this,Ao,void 0);Fe(this,kv,new Set);this.channel=e,this.members=[],this.type=null,this.name=void 0}addEventListener(e,t){me(this,Cp)[e].add(t)}removeEventListener(e,t){me(this,Cp)[e].delete(t)}pushUnitView(e,t){var r;const i=eI(e,t),s=i.type,o=(r=i==null?void 0:i.scale)==null?void 0:r.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=s;else if(s!==this.type&&!s_(t))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${s}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:e,channel:t})}getConfiguredDomain(){return Be(this,Nv,fI).call(this,e=>s_(e.channel)?void 0:e.view.getConfiguredDomain(e.channel))}getDataDomain(){return Be(this,Nv,fI).call(this,e=>s_(e.channel)?void 0:e.view.extractDataDomain(e.channel))}reconfigure(){const e=me(this,Ao);if(!e||e.type=="null")return;const t=Be(this,Sx,Vz).call(this),i=e.domain(),s=Be(this,Iv,dI).call(this);if(Tz({...s,range:void 0},e),e.props=s,Be(this,Av,uI).call(this),rs(e.type)&&_i(this,kl,Be(this,Tv,hI).call(this)),!t){Be(this,Br,ml).call(this,"domain");return}const o=e.domain();EE(o,i)||(this.isZoomable()?e.domain(i):Be(this,El,Fu).call(this)?(e.domain(i),this.zoomTo(o,500)):Be(this,Br,ml).call(this,"domain"))}get scale(){if(me(this,Ao))return me(this,Ao);const e=Be(this,Iv,dI).call(this),t=kle({...e,range:void 0});t.props=e,_i(this,Ao,t),Be(this,Av,uI).call(this),gle(t)&&t.genome(this.getGenome()),rs(t.type)&&_i(this,kl,Be(this,Tv,hI).call(this));const i=t.range;if(i){const s=()=>Be(this,Br,ml).call(this,"range");t.range=function(o){if(arguments.length)i(o),s();else return i()},s()}return t}getDomain(){return this.scale.domain()}getComplexDomain(){var e;return((e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return Be(this,El,Fu).call(this)&&EE(Be(this,Sp,My).call(this),this.getDomain())}isZoomable(){return Be(this,El,Fu).call(this)&&!!this.scale.props.zoom}zoom(e,t,i){if(!Be(this,El,Fu).call(this))return!1;const s=this.scale,o=s.domain();let r=[...o],a=s.invert(t);switch(s.props.reverse&&(i=-i),"align"in s&&(a+=s.align()),s.type){case"linear":case"index":case"locus":r=AX(r,i||0),r=gW(r,a,e);break;case"log":r=TX(r,i||0),r=pW(r,a,e);break;case"pow":case"sqrt":{const l=s;r=NX(r,i||0,l.exponent()),r=yE(r,a,e,l.exponent());break}default:throw new Error("Zooming is not implemented for: "+s.type)}return me(this,kl)&&(r=RX(r,me(this,kl)[0],me(this,kl)[1])),[0,1].some(l=>r[l]!=o[l])?(s.domain(r),Be(this,Br,ml).call(this,"domain"),!0):!1}async zoomTo(e,t=!1){var a;if(qv(t)&&(t=t?700:0),!Be(this,El,Fu).call(this))throw new Error("Not a zoomable scale!");const i=this.fromComplexInterval(e),s=(a=this.members[0])==null?void 0:a.view.context.animator,o=this.scale,r=o.domain();if(t>0&&r.length==2){const l=r[1]-r[0],c=r[0]+l/2,d=i[1]-i[0],u=i[0]+d/2;await s.transition({duration:t,easingFunction:Ule,onUpdate:h=>{const f=jle(l,d,h),g=(l-f)/(l-d),p=g*u+(1-g)*c;o.domain([p-f/2,p+f/2]),Be(this,Br,ml).call(this,"domain")}}),o.domain(i),Be(this,Br,ml).call(this,"domain")}else o.domain(i),s==null||s.requestRender(),Be(this,Br,ml).call(this,"domain")}resetZoom(){if(!Be(this,El,Fu).call(this))throw new Error("Not a zoomable scale!");const e=this.getDomain(),t=Be(this,Sp,My).call(this);return[0,1].some(i=>t[i]!=e[i])?(me(this,Ao).domain(t),Be(this,Br,ml).call(this,"domain"),!0):!1}getZoomLevel(){return this.isZoomable()?CC(me(this,kl))/CC(this.scale.domain()):1}getGenome(){var t;if(this.type!=="locus")return;const e=(t=this.members[0].view.context.genomeStore)==null?void 0:t.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const t=this.scale;if("invert"in t){const i=t.invert(e);return this.toComplex(i)}else throw new Error("The scale does not support inverting!")}toComplex(e){const t=this.getGenome();return t?t.toChromosomal(e):e}fromComplex(e){return Mz(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&Hle(e)?this.getGenome().toContinuousInterval(e):e}}kl=new WeakMap,Cp=new WeakMap,Ao=new WeakMap,kv=new WeakMap,Cx=new WeakSet,Wz=function(){return this.members[0].view.context},Br=new WeakSet,ml=function(e){for(const t of me(this,Cp)[e].values())t({type:e,scaleResolution:this})},Ev=new WeakSet,cI=function(){return!!this.getConfiguredDomain()},Sx=new WeakSet,Vz=function(){const e=me(this,Ao);if(!e)return!1;const t=e.domain();return rs(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0},xx=new WeakSet,Hz=function(){const e=this.members.map(t=>eI(t.view,t.channel).scale).filter(t=>t!==void 0);return VC(e,"scale",["domain"])},Iv=new WeakSet,dI=function(){const e=Be(this,xx,Hz).call(this);if(e===null||e.type=="null")return{type:"null"};const t={...Be(this,Lx,zz).call(this,this.type),...e};t.type||(t.type=Yle(this.channel,this.type));const i=Be(this,Sp,My).call(this);return i&&i.length>0?t.domain=i:Ua(t.type)&&(t.domain=new Pz),!t.domain&&t.domainMid!==void 0&&(t.domain=[t.domainMin??0,t.domainMax??1]),this.channel=="y"&&Ua(t.type)&&t.reverse==null&&(t.reverse=!0),t.range&&t.scheme&&delete t.scheme,!("zoom"in t)&&["index","locus"].includes(t.type)&&(t.zoom=!0),Zle(t,this.channel),t},Av=new WeakSet,uI=function(){const e=me(this,Ao).props,t=e.range;if(me(this,kv).forEach(s=>s.invalidate()),!t||!Zs(t))return;const i=(s,o)=>o?s.slice().reverse():s;if(t.some(Kl)){let s;const o=()=>{me(this,Ao).range(i(s.map(r=>r()),e.reverse))};s=t.map(r=>{if(Kl(r)){const a=me(this,Cx,Wz).paramBroker.createExpression(r.expr);return a.addListener(o),me(this,kv).add(a),()=>a(null)}else return()=>r}),o()}else me(this,Ao).range(i(t,e.reverse))},Sp=new WeakSet,My=function(){return this.getConfiguredDomain()??(this.type==Bz?this.getGenome().getExtent():this.getDataDomain())},El=new WeakSet,Fu=function(){const e=this.scale.type;return rs(e)},Tv=new WeakSet,hI=function(){const e=this.scale.props,t=e.zoom;if(Xle(t)&&Zs(t.extent))return this.fromComplexInterval(t.extent);if(t)return e.type=="locus"?this.getGenome().getExtent():me(this,Ao).domain()},Lx=new WeakSet,zz=function(e){const t=this.channel,i={};return Be(this,Ev,cI).call(this)&&(i.zero=!1),ab(t)?i.nice=!Be(this,Ev,cI).call(this):Wd(t)?i.scheme=e==Fz?"tableau10":e==Oz?"blues":"viridis":wL(t)?i.range=t=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:t=="size"?i.range=[0,400]:t=="angle"&&(i.range=[0,360]),i},SM=new WeakSet,Kle=function(){return this.members.map(e=>e.view.getPathString()).join(", ")},Nv=new WeakSet,fI=function(e){const t=this.members.filter(i=>!i.view.getLayoutAncestors().some(s=>!s.options.contributesToScaleDomain)).map(e).filter(i=>!!i);if(t.length)return t.reduce((i,s)=>i.extendAll(s))};function Yle(n,e){if(e==qle||e==Bz){if(mz(n))return e;throw new Error(`${n} does not support ${e} data type. Only positional channels do.`)}const t={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},s=["sample"].includes(n)?"null":t[n]?t[n][[Fz,Oz,$O].indexOf(e)]:e==$O?"linear":"ordinal";if(s===void 0)throw new Error(`Channel "${n}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return s}function Zle(n,e){ab(e)&&n.type!=="ordinal"&&(n.range=[0,1]),e=="opacity"&&rs(n.type)&&(n.clamp=!0)}function Xle(n){return xo(n)}function gI(n){const e=new Set;function t(i){for(const s of Object.values(i.resolutions.scale))e.add(s)}for(const i of js(n)){i.visit(t);for(const s of i.getDataAncestors()){if(!s.options.contributesToScaleDomain)break;t(s)}}e.forEach(i=>i.reconfigure())}function kk(...n){for(const e of n)if(e!==void 0)return e}class Qle{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=Yv(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}pushUnitView(e,t){const i=e.getScaleResolution(this.channel);if(!i)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&i!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:e,channel:t})}getAxisProps(){return _L(this,"axisProps",()=>{const e=this.members.map(t=>{const i=t.view.mark.encoding[t.channel];return"axis"in i&&i.axis});return e.length>0&&e.some(t=>t===null)?null:VC(e.filter(t=>t!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var a;const r=eI(o.view,o.channel);if(!pr(r))return{member:o,explicitTitle:kk("axis"in r?(a=r.axis)==null?void 0:a.title:void 0,r.title),implicitTitle:kk(wf(r)?r.field:void 0,vL(r)?r.expr:void 0)}},t=this.members.map(e),i=t.filter(o=>{var r;if(s_(o.member.channel)&&!o.explicitTitle){const a=Zh(o.member.channel);return((r=t.find(l=>l.member.view==o.member.view&&l.member.channel==a))==null?void 0:r.explicitTitle)===void 0}return!0}),s=new Set(i.map(o=>kk(o.explicitTitle,o.implicitTitle)).filter(Ei));return s.size?[...s].join(", "):null}}const Jle={point:Vae,rect:Nae,rule:Uae,link:Xae,text:sle};class Po extends Xh{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e;const a=Jle[this.getMarkType()];if(a)this.mark=new a(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),this.needsAxes={x:!0,y:!0}}render(e,t,i={}){super.render(e,t,i),this.isConfiguredVisible()&&(e.pushView(this,t),e.renderMark(this.mark,i),e.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(e){e||(this.resolve("scale"),this.resolve("axis"));const t=this.mark.encoding;for(const[i,s]of Object.entries(t)){if(!Bo(s))continue;const o=Zh(s.resolutionChannel??i);if(!Up(o)||e=="axis"&&!ab(o))continue;let r=this;for(;(r.getConfiguredOrDefaultResolution(o,e)=="forced"||r.dataParent instanceof Xh&&["shared","excluded","forced"].includes(r.dataParent.getConfiguredOrDefaultResolution(o,e)))&&r.getConfiguredOrDefaultResolution(o,e)!="excluded";)r=r.dataParent;if(e=="axis"&&ab(i)&&mz(o))r.resolutions[e][o]||(r.resolutions[e][o]=new Qle(o)),r.resolutions[e][o].pushUnitView(this,i);else if(e=="scale"&&Up(i)){if(!r.resolutions[e][o]){const a=new Gle(o);r.resolutions[e][o]=a,a.addEventListener("range",l=>{var c;(c=this.context.glHelper)==null||c.createRangeTexture(l.scaleResolution,!0)})}r.resolutions[e][o].pushUnitView(this,i)}}}getAccessor(e){return this._cache("accessor/"+e,()=>{const t=this.mark.encoding;if(t&&t[e])return this.context.accessorFactory.createAccessor(t[e])})}getFacetAccessor(e){const t=this.getAccessor("sample");return t||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(e){if(s_(e))throw new Error(`getDomain(${e}), must only be called for primary channels!`);const t=this.mark.encoding[e];if(!Bo(t))throw new Error("The channel has no scale, cannot get domain!");return t}getConfiguredDomain(e){const t=this._validateDomainQuery(e),i=t&&t.scale&&t.scale.domain;if(i){const s=this.getScaleResolution(t.resolutionChannel??e);return zO(t.type??"nominal",s.fromComplexInterval(i))}}extractDataDomain(e){const i=this._validateDomainQuery(e).type??"nominal",s=a=>{let l;const c=this.mark.encoding[a];if(c){const d=this.context.accessorFactory.createAccessor(c);if(d)if(l=zO(i),d.constant)l.extend(d({}));else{const u=this.getCollector();u!=null&&u.completed&&u.visitData(h=>l.extend(d(h)))}}return l};let o=s(e);const r=jR[e];if(r){const a=s(r);a&&o.extendAll(a)}return o}getZoomLevel(){const e=t=>{var i;return((i=this.getScaleResolution(t))==null?void 0:i.getZoomLevel())??1};return Im.map(e).reduce((t,i)=>t*i,1)}propagateInteractionEvent(e){this.handleInteractionEvent(void 0,e,!0),e.target=this,!e.stopped&&this.handleInteractionEvent(void 0,e,!1)}getDefaultResolution(e,t){return e=="x"?"shared":"independent"}}function*KR(n,e=[]){for(const[t,i]of n.entries())if(i instanceof Map)for(const s of KR(i,[...e,t]))yield s;else yield[[...e,t],i]}class $z extends pn{get behavior(){return qR}constructor(e){super(),this.params=e??{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new Ad([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(e){this._data.push(e)}beginBatch(e){Fae(e)&&(this._data=[],this.facetBatches.set(js(e.facetId),this._data))}complete(){var s,o;const e=(s=this.params)==null?void 0:s.sort,t=e?mW(e.field,e.order):void 0,i=r=>{t&&r.sort(t)};if((o=this.params.groupby)!=null&&o.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const r=this.params.groupby.map(l=>Si(l)),a=r.length>1?Vx(this._data,...r):ece(this._data,r[0]);this.facetBatches.clear();for(const[l,c]of KR(a))this.facetBatches.set(l,c)}for(const r of this.facetBatches.values())i(r);if(this.children.length)for(const[r,a]of this.facetBatches.entries()){if(r){const l={type:"facet",facetId:r};for(const c of this.children)c.beginBatch(l)}for(const l of a)this._propagate(l)}super.complete();for(const r of this.observers)r(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const e=this.facetBatches;return{[Symbol.iterator]:function*(){for(const i of e.values())for(let s=0;s0;){const s=i-1>>1,o=this.values[s];if(t>=o)break;this.ids[i]=this.ids[s],this.values[i]=o,i=s}this.ids[i]=e,this.values[i]=t}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const t=this.ids[0]=this.ids[this.length],i=this.values[0]=this.values[this.length],s=this.length>>1;let o=0;for(;o=i)break;this.ids[o]=l,this.values[o]=c,o=r}this.ids[o]=t,this.values[o]=i}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class tce extends pn{get behavior(){return nl}constructor(e){super(),this.params=e,this.startAccessor=Si(e.start),this.endAccessor=Si(e.end),this.chromAccessor=e.chrom?Si(e.chrom):t=>{},this.weightAccessor=e.weight?Si(e.weight):t=>1,this.as={coverage:e.as||"coverage",start:e.asStart||e.start,end:e.asEnd||e.end,chrom:e.asChrom||e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([t,i])=>i).map(([t,i])=>`${JSON.stringify(i)}: ${t}`).join(", ")+"};"),this.ends=new HC}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,t=this.as.end,i=this.as.chrom,s=this.startAccessor,o=this.endAccessor,r=this.chromAccessor,a=this.weightAccessor;let l,c,d,u=0,h;const f=this.ends;f.clear();const g=(_,v,b)=>{if(_==v)return;let w=!1;l&&(l[e]===b?(l[t]=v,w=!0):l[e]!=0&&this._propagate(l)),w||(l=this.createSegment(_,v,b,d))},p=()=>{let _=0;for(;(_=f.peekValue())!==void 0;)g(h,_,u),h=_,u-=f.pop();h=void 0,l&&(this._propagate(l),l=void 0)};this.handle=_=>{const v=s(_);let b=0;for(;(b=f.peekValue())!==void 0&&b{p(),super.complete()},this.beginBatch=_=>{p(),c=void 0,super.beginBatch(_)}}}function ice(n,e,t=0,i=n.length){const s=new HC,o=i-t;let r;for(r=0;r=s.peekValue()&&(s.push(r,c),s.pop())}const a=[];let l;for(;(l=s.pop())!==void 0;)a.push(t+l);return a.reverse()}class nce{constructor(e,t=-1/0,i=1/0){this.maxSize=e,this.lowerLimit=t,this.upperLimit=i;const s=this.maxSize*2+1;this.lowerLimits=new Float64Array(s),this.upperLimits=new Float64Array(s),this.lowerChildren=new Int32Array(s),this.upperChildren=new Int32Array(s),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,t,i=0){if(e>=this.lowerLimits[i]&&t<=this.upperLimits[i]){const s=this.lowerChildren[i];if(s){const o=this._findSlot(e,t,s);return o>=0?o:this._findSlot(e,t,this.upperChildren[i])}else return i}else return-1}reserve(e,t){if(t-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const i=this._findSlot(e,t);if(i<0)return!1;const s=this.n++,o=this.n++;return this.lowerLimits[s]=this.lowerLimits[i],this.upperLimits[s]=e,this.lowerLimits[o]=t,this.upperLimits[o]=this.upperLimits[i],this.lowerChildren[i]=s,this.upperChildren[i]=o,!0}}class sce extends pn{get behavior(){return qR}constructor(e,t){if(super(),this.params=e,this._data=[],this.channel=e.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=Si(this.params.pos),this.posBisector=Wx(this.posAccessor),this.scoreAccessor=Si(this.params.score),this.widthAccessor=Si(this.params.width),this.laneAccessor=this.params.lane?Si(this.params.lane):s=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=t.getScaleResolution(this.channel);const i=()=>this._filterAndPropagate();this.schedule=()=>t.context.animator.requestTransition(i),this.resolution.addEventListener("domain",s=>this.schedule()),t._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((t,i)=>e(t)-e(i)),this._scores=this._data.map(this.scoreAccessor);for(const t of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(t,new nce(200));this.schedule(),super.complete()}_filterAndPropagate(){var r;super.reset();const e=this.resolution.scale,t=(r=this.resolution.members[0].view.coords)==null?void 0:r[this.channel=="x"?"width":"height"];if(!t)return;for(const a of this.reservationMaps.values())a.reset();const i=e.domain(),s=70,o=ice(this._scores,s,this.posBisector.left(this._data,i[0]),this.posBisector.right(this._data,i[1]));for(const a of o){const l=this._data[a],c=e(this.posAccessor(l))*t,d=this.widthAccessor(l)/2+this.padding;this.reservationMaps.get(this.laneAccessor(l)).reserve(c-d,c+d)&&this._propagate(l)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class oce extends pn{constructor(e){super(),this.params=e,this.predicate=void 0}initialize(){this.predicate=Kx(this.params.expr,this.getGlobalObject())}handle(e){this.predicate(e)&&this._propagate(e)}}class rce extends pn{get behavior(){return nl}constructor(e){super();const t=e.index;if(e.fields){const i=js(e.fields).map(o=>Si(o)),s=js(e.as||e.fields);if(i.length!==s.length)throw new Error(`Lengths of "fields" (${i.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{const r=i.map((l,c)=>l(o)??[]),a=r[0].length;for(let l=0;l{for(let s=0;s{let a=i(r),l=a,c=!0;const d=t(r);for(const u of lce(d)){if(c)l=a+u;else{a=l+u;const h=Object.assign({},r);h[s]=l,h[o]=a,this._propagate(h)}c=!c}}}}class dce extends pn{get behavior(){return nl}constructor(e){super();const t=js(e.field).map(o=>Si(o)),i=js(e.separator),s=js(e.as||e.field);if(t.length!==i.length||t.length!==s.length)throw new Error(`Lengths of "separator" (${i.length}), "fields" (${t.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{if(t.some(l=>!l(o)))return;const r=t.map((l,c)=>l(o).split(i[c]));uce(r,o);const a=r[0].length;for(let l=0;li.length);if(!t.every(i=>i==t[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class hce extends pn{get behavior(){return cu}constructor(e){super(),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=Kx(this.params.expr,this.getGlobalObject())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class Uz extends pn{get behavior(){return cu}constructor(e,t){super();const i=e.channel??"x";if(!["x","y"].includes(i))throw new Error("Invalid channel: "+i);const s=t.getScaleResolution(i).getGenome();if(!s)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=Si(e.chrom),r=js(e.pos).map(g=>Si(g)),a=js(e.as);if(r.length!=a.length)throw new Error('The number of "pos" and "as" elements must be equal!');const l=js(e.offset);let c;if(l.length==0)c=new Array(r.length).fill(0);else if(l.length==1)c=new Array(r.length).fill(l[0]);else if(l.length==r.length)c=l;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const d=new Function("datum","chromOffset","posAccessors",a.map((g,p)=>`datum[${JSON.stringify(g)}] = chromOffset + +posAccessors[${p}](datum) - ${c[p]};`).join(` +`));let u,h=0;const f=g=>{if(g!==u){if(h=s.cumulativeChromPositions.get(g),h===void 0)throw new Error("Unknown chromosome/contig: "+g);u=g}return h};this.handle=g=>{d(g,f(o(g)),r),this._propagate(g)}}}const fce=["Lato-Regular.png"],gce=[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],pce={face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},mce={lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},_ce=[],jz={pages:fce,chars:gce,info:pce,common:mce,kernings:_ce};class bce extends pn{get behavior(){return cu}constructor(e){super();const t=tI(jz),i=Si(e.field),s=e.as,o=e.fontSize;this.handle=r=>{const a=i(r);a!==void 0?r[s]=t.measureWidth(a,o):r[s]=0,this._propagate(r)}}}const vce=65536;class wce extends pn{get behavior(){return cu}constructor(e){super(),this.params=e}reset(){super.reset(),this.initialize()}initialize(){const e=this.params,t=e.as||"lane",i=Xs(e.spacing)?e.spacing:1,s=Si(e.start),o=Si(e.end);if(!e.preference!=!e.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(e.preference){const r=new Float64Array(vce),a=Si(e.preference),l=e.preferredOrder;let c=1/0;this.handle=d=>{const u=s(d);u=0&&r[h]=r.length)throw new Error("Out of lanes!")}r[f]=o(d)+i,d[t]=f,this._propagate(d)}}else{const r=new HC,a=new HC;let l=-1/0,c=0;this.handle=d=>{const u=s(d);for(;r.length&&(r.peekValue()<=u||uSi(s)),i=e.as?e.as:t.map(SX);this.handle=s=>{const o={};for(let r=0;r{const r=s(o);if(Ei(r)){const a=r.match(t);if(a){if(a.length-1!=i.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let l=0;lnew RegExp(h)),i=js(e.asValue);if(t.length!=i.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const s=e.skipRegex?new RegExp(e.skipRegex):void 0,o=e.asKey||"sample";let r,a,l;const c=h=>{var _;const f=Object.keys(h);for(const v of t)if(!f.some(b=>v.test(b)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const g=new Map;for(const[v,b]of t.entries())for(const w of f){const y=(_=b.exec(w))==null?void 0:_[1];if(y!==void 0){let S=g.get(y);S||(S=[],g.set(y,S)),S[v]=w}}r=[...g.entries()],a=f.filter(v=>!t.some(b=>b.test(v))&&!(s&&s.test(v)));const p=[...a.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(o)+": sampleId",...i.map((v,b)=>JSON.stringify(v)+`: datum[attrs[${b}]]`)];l=new Function("datum","sampleId","attrs",`return { `+p.join(`, `)+` -};`)},d=h=>{r||c(h);for(let f=0;f{c(h),d(h),this.handle=d};this.handle=u,this.beginBatch=h=>{cz(h)&&(this.handle=u),super.beginBatch(h)}}}class sce extends pn{get behavior(){return su}constructor(e){super(),this.params=e,this.buffer=[]}reset(){this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e.as||["y0","y1"],i=e.sort?nW(e.sort.field,e.sort.order):void 0,s=e.field?yi(e.field):()=>1,o=e.groupby.map(d=>yi(d)),r=ZX(this.buffer,d=>o.map(u=>u(d)).join()).map(d=>d[1]);let a=d=>!0;if(e.baseField){const d=yi(e.baseField);a=u=>d(u)!==null}let l,c;switch(e.offset){case"normalize":l=(d,u)=>d/u,c=(d,u)=>X1(d,u);break;case"center":l=(d,u)=>d-u/2,c=(d,u)=>X1(d,u);break;case"information":{const d=Math.log2(e.cardinality??4);l=(u,h)=>u/h,c=(u,h)=>{const g=X1(u,b=>+!a(b)),p=X1(u,h),_=p-g;let v=0;for(let b=0;bd,c=(d,u)=>1}for(const d of r){i&&d.sort(i);const u=c(d,s);let h=0;for(const f of d){const g=h+s(f);a(f)&&(f[t[0]]=l(h,u),f[t[1]]=l(g,u),this._propagate(f),h=g)}}super.complete()}}class oce extends pn{get behavior(){return nl}constructor(e){super();const t=yi(e.field??"sequence"),[i,s]=e.as??["pos","sequence"];this.handle=o=>{const r=Object.assign({},o,{[s]:"",[i]:0}),a=t(o);for(let l=0;lyi(o)),s=Mx(this.buffer,...i);for(const[o,r]of FR(s)){const a={count:r.length};for(let l=0;ltypeof n!="object"?uce:hce,uce=n=>({data:n}),hce=n=>n;function MO(n){return"url"in n}let o1=class extends pn{get identifier(){}handle(e){throw new Error("Source does not handle incoming data!")}async load(){}};function Mz(n){return"values"in n}class fce extends o1{constructor(e,t){var i;if(super(),this.params=e,typeof e.values=="string"&&!((i=e==null?void 0:e.format)!=null&&i.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}loadSynchronously(){const e=this.params.values;let t=[],i=s=>s;if(Array.isArray(e))e.length>0&&(t=e,i=Nz(e[0]));else if(typeof e=="object")t=[e];else if(typeof e=="string")t=jM(e,Tz(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}function gce(n){return"url"in n}class pce extends o1{constructor(e,t){super(),this.params=e,this.baseUrl=t==null?void 0:t.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}async load(){const e=this.params.url,t=Array.isArray(e)?e:[e],i=async o=>Ox({baseURL:this.baseUrl}).load(o).catch(r=>{throw new Error(`Cannot fetch: ${this.baseUrl}${o}: ${r.message}`)}),s=(o,r)=>{try{const a=jM(o,Tz(this.params));this.beginBatch({type:"file",url:r});for(const l of a)this._propagate(l)}catch(a){throw new Error(`Cannot parse: ${r}: ${a.message}`)}};this.reset(),await Promise.all(t.map(o=>i(o).then(s))),this.complete()}}function mce(n){return"sequence"in n}class _ce extends o1{constructor(e,t){if(super(),this.sequence=e.sequence,!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}loadSynchronously(){const e=this.sequence.as||"data",t=this.sequence.step||1,i=this.sequence.stop;this.reset(),this.beginBatch({type:"file"});for(let s=this.sequence.start;s{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",s),this.view.context.addBroadcastListener("layoutComputed",s)}getAxisLength(){const t=this.scaleResolution.members.map(i=>{var s;return(s=i.view.coords)==null?void 0:s[this.channel==="x"?"width":"height"]}).filter(i=>i>0);return t.length?t.reduce((i,s)=>Math.min(i,s),1e4):0}get genome(){return this.scaleResolution.getGenome()}async onDomainChanged(t,i){}setLoadingStatus(t){this.view.context.setDataLoadingStatus(this.view,t)}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(t){this.reset(),this.beginBatch({type:"file"});for(const i of t)for(const s of i)this._propagate(s);this.complete(),sI(this.view),this.requestRender()}}class bce extends BR{constructor(t,i){const s={axis:{},...t};super(i,s.channel);Dn(this,"ticks",[]);this.params=t}async onDomainChanged(){const t=this.scaleResolution.getScale(),i=this.params.axis,s=this.getAxisLength(),o=c=>25+60*jW(100,700,c),r=Xs(i.tickCount)?i.tickCount:Math.round(s/o(s)),a=fz(t,r,i.tickMinStep),l=i.values?gz(t,i.values,a):Yae(t,a);if(!CC(l,this.ticks)){this.ticks=l;const c=Xae(t,r,i.format);this.publishData([l.map(d=>({value:d,label:c(d)}))])}}}class vce extends BR{constructor(e,t){super(t,e.channel)}async load(){this.publishData([this.genome.chromosomes])}}const wce="modulepreload",yce=function(n,e){return new URL(n,e).href},RO={},Gs=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=yce(o,i),o in RO)return;RO[o]=!0;const r=o.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(!!i)for(let d=s.length-1;d>=0;d--){const u=s[d];if(u.href===o&&(!r||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":wce,r||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),r)return new Promise((d,u)=>{c.addEventListener("load",d),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})};function r1(n,e){return!e||/^(data:|([A-Za-z]+:)?\/\/)/.test(n)||n.startsWith("/")?n:(e.endsWith("/")||(e+="/"),e+n)}function FC(n,e,t=!0){let i,s=r=>{};return function(...a){return new Promise((l,c)=>{const d=()=>{clearTimeout(i),s=u=>{},l(n(...a))};t&&s("debounced"),clearTimeout(i),s=c,i=window.setTimeout(d,e)})}}var Sp,kv;class a1 extends BR{constructor(){super(...arguments);et(this,Sp,new AbortController);et(this,kv,[0,0]);Dn(this,"params")}setupDebouncing(t){t.debounce>0&&(t.debounceMode=="domain"?this.onDomainChanged=FC(this.onDomainChanged.bind(this),t.debounce,!1):t.debounceMode=="window"&&(this.loadInterval=FC(this.loadInterval.bind(this),t.debounce,!1)))}async onDomainChanged(t){var o;const i=((o=this.params)==null?void 0:o.windowSize)??-1;if(t[1]-t[0]>i)return;const s=this.quantizeInterval(t,i);this.checkAndUpdateLastInterval(s)&&(await this.initializedPromise,this.loadInterval(s))}async loadInterval(t){}async discretizeAndLoad(t,i){ve(this,Sp).abort(),this.setLoadingStatus(!0),Ei(this,Sp,new AbortController);const s=ve(this,Sp).signal,o=this.genome.continuousToDiscreteChromosomeIntervals(t);try{const r=await Promise.all(o.map(async a=>i(a,s)));if(!s.aborted)return this.setLoadingStatus(!1),r}catch(r){if(!s.aborted)throw this.setLoadingStatus(!1),r}}quantizeInterval(t,i){return[Math.max(Math.floor(t[0]/i-1)*i,0),Math.min(Math.ceil(t[1]/i+1)*i,this.genome.totalSize)]}checkAndUpdateLastInterval(t){return CC(ve(this,kv),t)?!1:(Ei(this,kv,t),!0)}}Sp=new WeakMap,kv=new WeakMap;class Cce extends a1{constructor(e,t){const i={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...e};if(super(t,i.channel),this.params=i,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(s=>{Promise.all([Gs(()=>import("./index-X47Qq1Ab.js").then(o=>o.i),__vite__mapDeps([0,1]),import.meta.url),Gs(()=>import("./index-lKx8UKfw.js"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),Gs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:o},{IndexedFasta:r},{RemoteFile:a}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=c=>new a(r1(c,this.view.getBaseUrl()));this.fasta=new r({fasta:l(this.params.url),fai:l(this.params.indexUrl??this.params.url+".fai")}),s()})})}async loadInterval(e){const t=await this.discretizeAndLoad(e,async(i,s)=>this.fasta.getSequence(i.chrom,i.startPos,i.endPos,{signal:s}).then(o=>({chrom:i.chrom,start:i.startPos,sequence:o})));t&&this.publishData([t])}}var xp,Lp;class Sce extends a1{constructor(t,i){const s={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...t};super(i,s.channel);et(this,xp,[]);et(this,Lp,void 0);if(this.params=s,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Gs(()=>import("./index-jFC45F8W.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Gs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BigWig:r},{RemoteFile:a}])=>{Ei(this,Lp,new r({filehandle:new a(r1(this.params.url,this.view.getBaseUrl()))})),ve(this,Lp).getHeader().then(l=>{Ei(this,xp,l.zoomLevels.map(c=>c.reductionLevel).reverse()),ve(this,xp).push(1),o()})})})}async onDomainChanged(t){await this.initializedPromise;const i=this.getAxisLength()||700,s=xce(t,i,ve(this,xp)),o=Math.max(s*i,5e3),r=this.quantizeInterval(t,o);this.checkAndUpdateLastInterval(r)&&this.loadInterval(r,s)}async loadInterval(t,i){const s=.5/i/this.params.pixelsPerBin,o=await this.discretizeAndLoad(t,(r,a)=>ve(this,Lp).getFeatures(r.chrom,r.startPos,r.endPos,{scale:s,signal:a}).then(l=>l.map(c=>({chrom:r.chrom,start:c.start,end:c.end,score:c.score}))));o&&this.publishData(o)}}xp=new WeakMap,Lp=new WeakMap;function xce(n,e,t){const i=(n[1]-n[0])/e;return t.find(s=>s{Promise.all([Gs(()=>import("./index-ksAmfmp1.js"),__vite__mapDeps([9,1]),import.meta.url),Gs(()=>import("./index-jFC45F8W.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Gs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([r,{BigBed:a},{RemoteFile:l}])=>{const c=r.default;this.bbi=new a({filehandle:new l(r1(this.params.url,this.view.getBaseUrl()))}),this.bbi.getHeader().then(async d=>{this.parser=new c({autoSql:d.autoSql});try{const u=Dce(this.parser);this.parseLine=(h,f)=>u(h,f.start,f.end,f.rest)}catch{this.parseLine=(h,f)=>this.parser.parseLine(`${h} ${f.start} ${f.end} ${f.rest}`)}o()})})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>this.bbi.getFeatures(s.chrom,s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>this.parseLine(s.chrom,a))));i&&this.publishData(i)}}function Dce(n){const e=n.autoSql.fields.filter(b=>b.type).slice(3);let t=0,i="",s=0,o={};const r=" ",a=r.charCodeAt(0),l="0".charCodeAt(0),c="-".charCodeAt(0);function d(){let b=i.indexOf(r,t);b<0&&(b=s);const w=i.substring(t,b);return t=b+1,w}function u(){let b=0,w=i.charCodeAt(t),y=1;w===c&&(y=-1,t++,w=i.charCodeAt(t));do{if(w===a){t++;break}b=b*10+w-l,w=i.charCodeAt(++t)}while(t`${JSON.stringify(b.name)}: ${b.isNumeric?"0":"emptyString"}`),f=new Function(` +};`)},d=h=>{r||c(h);for(let f=0;f{c(h),d(h),this.handle=d};this.handle=u,this.beginBatch=h=>{Sz(h)&&(this.handle=u),super.beginBatch(h)}}}class xce extends pn{get behavior(){return cu}constructor(e){super(),this.params=e,this.buffer=[]}reset(){this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e.as||["y0","y1"],i=e.sort?mW(e.sort.field,e.sort.order):void 0,s=e.field?Si(e.field):()=>1,o=e.groupby.map(d=>Si(d)),r=fQ(this.buffer,d=>o.map(u=>u(d)).join()).map(d=>d[1]);let a=d=>!0;if(e.baseField){const d=Si(e.baseField);a=u=>d(u)!==null}let l,c;switch(e.offset){case"normalize":l=(d,u)=>d/u,c=(d,u)=>sw(d,u);break;case"center":l=(d,u)=>d-u/2,c=(d,u)=>sw(d,u);break;case"information":{const d=Math.log2(e.cardinality??4);l=(u,h)=>u/h,c=(u,h)=>{const g=sw(u,b=>+!a(b)),p=sw(u,h),_=p-g;let v=0;for(let b=0;bd,c=(d,u)=>1}for(const d of r){i&&d.sort(i);const u=c(d,s);let h=0;for(const f of d){const g=h+s(f);a(f)&&(f[t[0]]=l(h,u),f[t[1]]=l(g,u),this._propagate(f),h=g)}}super.complete()}}class Lce extends pn{get behavior(){return nl}constructor(e){super();const t=Si(e.field??"sequence"),[i,s]=e.as??["pos","sequence"];this.handle=o=>{const r=Object.assign({},o,{[s]:"",[i]:0}),a=t(o);for(let l=0;lSi(o)),s=Vx(this.buffer,...i);for(const[o,r]of KR(s)){const a={count:r.length};for(let l=0;ltypeof n!="object"?Tce:Nce,Tce=n=>({data:n}),Nce=n=>n;function qO(n){return"url"in n}let h1=class extends pn{get identifier(){}handle(e){throw new Error("Source does not handle incoming data!")}async load(){}};function Yz(n){return"values"in n}class Mce extends h1{constructor(e,t){var i;if(super(),this.params=e,typeof e.values=="string"&&!((i=e==null?void 0:e.format)!=null&&i.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}loadSynchronously(){const e=this.params.values;let t=[],i=s=>s;if(Array.isArray(e))e.length>0&&(t=e,i=Kz(e[0]));else if(typeof e=="object")t=[e];else if(typeof e=="string")t=tR(e,Gz(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}function Rce(n){return"url"in n}class Pce extends h1{constructor(e,t){super(),this.params=e,this.baseUrl=t==null?void 0:t.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}async load(){const e=this.params.url,t=Array.isArray(e)?e:[e],i=async o=>$x({baseURL:this.baseUrl}).load(o).catch(r=>{throw new Error(`Cannot fetch: ${this.baseUrl}${o}: ${r.message}`)}),s=(o,r)=>{try{const a=tR(o,Gz(this.params));this.beginBatch({type:"file",url:r});for(const l of a)this._propagate(l)}catch(a){throw new Error(`Cannot parse: ${r}: ${a.message}`)}};this.reset(),await Promise.all(t.map(o=>i(o).then(s))),this.complete()}}function Oce(n){return"sequence"in n}class Fce extends h1{constructor(e,t){if(super(),this.sequence=e.sequence,!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}loadSynchronously(){const e=this.sequence.as||"data",t=this.sequence.step||1,i=this.sequence.stop;this.reset(),this.beginBatch({type:"file"});for(let s=this.sequence.start;s{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",s),this.view.context.addBroadcastListener("layoutComputed",s)}getAxisLength(){const t=this.scaleResolution.members.map(i=>{var s;return(s=i.view.coords)==null?void 0:s[this.channel==="x"?"width":"height"]}).filter(i=>i>0);return t.length?t.reduce((i,s)=>Math.min(i,s),1e4):0}get genome(){return this.scaleResolution.getGenome()}onDomainChanged(t,i){}setLoadingStatus(t){this.view.context.setDataLoadingStatus(this.view,t)}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(t){this.reset(),this.beginBatch({type:"file"});for(const i of t)for(const s of i)this._propagate(s);this.complete(),gI(this.view),this.requestRender()}}class Bce extends YR{constructor(t,i){const s={axis:{},...t};super(i,s.channel);Dn(this,"ticks",[]);this.params=t}onDomainChanged(){const t=this.scaleResolution.scale,i=this.params.axis,s=this.getAxisLength(),o=c=>25+60*sV(100,700,c),r=Xs(i.tickCount)?i.tickCount:Math.round(s/o(s)),a=kz(t,r,i.tickMinStep),l=i.values?Ez(t,i.values,a):ple(t,a);if(!EE(l,this.ticks)){this.ticks=l;const c=_le(t,r,i.format);this.publishData([l.map(d=>({value:d,label:c(d)}))])}}}class Wce extends YR{constructor(e,t){super(t,e.channel)}async load(){this.publishData([this.genome.chromosomes])}}const Vce="modulepreload",Hce=function(n,e){return new URL(n,e).href},GO={},qs=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Hce(o,i),o in GO)return;GO[o]=!0;const r=o.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(!!i)for(let d=s.length-1;d>=0;d--){const u=s[d];if(u.href===o&&(!r||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":Vce,r||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),r)return new Promise((d,u)=>{c.addEventListener("load",d),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})};function f1(n,e){return!e||/^(data:|([A-Za-z]+:)?\/\/)/.test(n)||n.startsWith("/")?n:(e.endsWith("/")||(e+="/"),e+n)}function lb(n,e,t=!0){let i,s=r=>{};return function(...a){return new Promise((l,c)=>{const d=()=>{clearTimeout(i),s=u=>{},l(n(...a))};t&&s("debounced"),clearTimeout(i),s=c,i=window.setTimeout(d,e)})}}var xp,Mv,Rv;class g1 extends YR{constructor(){super(...arguments);Fe(this,xp,new AbortController);Fe(this,Mv,[0,0]);Fe(this,Rv,0);Dn(this,"params")}setupDebouncing(t){t.debounce>0&&(t.debounceMode=="domain"?this.onDomainChanged=lb(this.onDomainChanged.bind(this),t.debounce,!1):t.debounceMode=="window"&&(this.loadInterval=lb(this.loadInterval.bind(this),t.debounce,!1)))}onDomainChanged(t){var s;const i=((s=this.params)==null?void 0:s.windowSize)??-1;t[1]-t[0]>i||this.callIfWindowsChanged(t,i,async o=>{await this.initializedPromise,this.loadInterval(o)})}async loadInterval(t){}async discretizeAndLoad(t,i){me(this,xp).abort(),this.setLoadingStatus(!0),_i(this,xp,new AbortController);const s=me(this,xp).signal,o=this.genome.continuousToDiscreteChromosomeIntervals(t);try{const r=await Promise.all(o.map(async a=>i(a,s)));if(!s.aborted)return this.setLoadingStatus(!1),r}catch(r){if(!s.aborted)throw this.setLoadingStatus(!1),r}}callIfWindowsChanged(t,i,s){const o=[Math.max(Math.floor(t[0]/i)*i,0),Math.min(Math.ceil(t[1]/i)*i,this.genome.totalSize)],r=me(this,Mv);(i!==me(this,Rv)||o[0]r[1])&&(_i(this,Mv,o),_i(this,Rv,i),s(o))}}xp=new WeakMap,Mv=new WeakMap,Rv=new WeakMap;class zce extends g1{constructor(e,t){const i={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...e};if(super(t,i.channel),this.params=i,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(s=>{Promise.all([qs(()=>import("./index-X47Qq1Ab.js").then(o=>o.i),__vite__mapDeps([0,1]),import.meta.url),qs(()=>import("./index-lKx8UKfw.js"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),qs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:o},{IndexedFasta:r},{RemoteFile:a}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=c=>new a(f1(c,this.view.getBaseUrl()));this.fasta=new r({fasta:l(this.params.url),fai:l(this.params.indexUrl??this.params.url+".fai")}),s()})})}async loadInterval(e){const t=await this.discretizeAndLoad(e,async(i,s)=>this.fasta.getSequence(i.chrom,i.startPos,i.endPos,{signal:s}).then(o=>({chrom:i.chrom,start:i.startPos,sequence:o})));t&&this.publishData([t])}}var Lp,Dp;class $ce extends g1{constructor(t,i){const s={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...t};super(i,s.channel);Fe(this,Lp,[]);Fe(this,Dp,void 0);if(this.params=s,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([qs(()=>import("./index-jFC45F8W.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),qs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BigWig:r},{RemoteFile:a}])=>{_i(this,Dp,new r({filehandle:new a(f1(this.params.url,this.view.getBaseUrl()))})),me(this,Dp).getHeader().then(l=>{_i(this,Lp,l.zoomLevels.map(c=>c.reductionLevel).reverse()),me(this,Lp).push(1),o()})})})}async onDomainChanged(t){await this.initializedPromise;const i=this.getAxisLength()||700,s=Uce(t,i,me(this,Lp)),o=Math.max(s*i,5e3);this.callIfWindowsChanged(t,o,r=>this.loadInterval(r,s))}async loadInterval(t,i){const s=.5/i/this.params.pixelsPerBin,o=await this.discretizeAndLoad(t,(r,a)=>me(this,Dp).getFeatures(r.chrom,r.startPos,r.endPos,{scale:s,signal:a}).then(l=>l.map(c=>({chrom:r.chrom,start:c.start,end:c.end,score:c.score}))));o&&this.publishData(o)}}Lp=new WeakMap,Dp=new WeakMap;function Uce(n,e,t){const i=(n[1]-n[0])/e;return t.find(s=>s{Promise.all([qs(()=>import("./index-ksAmfmp1.js"),__vite__mapDeps([9,1]),import.meta.url),qs(()=>import("./index-jFC45F8W.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),qs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([r,{BigBed:a},{RemoteFile:l}])=>{const c=r.default;this.bbi=new a({filehandle:new l(f1(this.params.url,this.view.getBaseUrl()))}),this.bbi.getHeader().then(async d=>{this.parser=new c({autoSql:d.autoSql});try{const u=qce(this.parser);this.parseLine=(h,f)=>u(h,f.start,f.end,f.rest)}catch{this.parseLine=(h,f)=>this.parser.parseLine(`${h} ${f.start} ${f.end} ${f.rest}`)}o()})})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>this.bbi.getFeatures(s.chrom,s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>this.parseLine(s.chrom,a))));i&&this.publishData(i)}}function qce(n){const e=n.autoSql.fields.filter(b=>b.type).slice(3);let t=0,i="",s=0,o={};const r=" ",a=r.charCodeAt(0),l="0".charCodeAt(0),c="-".charCodeAt(0);function d(){let b=i.indexOf(r,t);b<0&&(b=s);const w=i.substring(t,b);return t=b+1,w}function u(){let b=0,w=i.charCodeAt(t),y=1;w===c&&(y=-1,t++,w=i.charCodeAt(t));do{if(w===a){t++;break}b=b*10+w-l,w=i.charCodeAt(++t)}while(t`${JSON.stringify(b.name)}: ${b.isNumeric?"0":"emptyString"}`),f=new Function(` const emptyString = ""; return function makeTemplate(chrom, chromStart, chromEnd) { return { @@ -2489,45 +2500,81 @@ void main() { ${h.join(`, `)} } - };`)(),g=e.map(b=>{const w=b.type,y=JSON.stringify(b.name);if(["ubyte","int","uint"].includes(w))return`d[${y}] = parseInt();`;if(b.isNumeric)return`d[${y}] = Number(parseString());`;if(["char","string","lstring"].includes(w))return`d[${y}] = parseString();`;throw new Error("Unsupported type: "+w)}),p=kce(g,50).map((b,w)=>Function("parseInt","parseString",`return function parseFieldChunk${w}(d) { + };`)(),g=e.map(b=>{const w=b.type,y=JSON.stringify(b.name);if(["ubyte","int","uint"].includes(w))return`d[${y}] = parseInt();`;if(b.isNumeric)return`d[${y}] = Number(parseString());`;if(["char","string","lstring"].includes(w))return`d[${y}] = parseString();`;throw new Error("Unsupported type: "+w)}),p=Gce(g,50).map((b,w)=>Function("parseInt","parseString",`return function parseFieldChunk${w}(d) { ${b.join(` `)} - }`)(u,d));function _(b){i=b,s=b.length,t=0}function v(b,w,y,S){_(S),o=f(b,w,y);for(const L of p)L(o);return o}return v}function kce(n,e){return Array.from({length:Math.ceil(n.length/e)},(t,i)=>n.slice(i*e,i*e+e))}var ph;class Ece extends a1{constructor(t,i){const s={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...t};super(i,s.channel);et(this,ph,void 0);Dn(this,"chrPrefixFixer",t=>t);if(this.params=s,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Gs(()=>import("./index-P-r8iX32.js"),__vite__mapDeps([10,4,0,1,3,6,8]),import.meta.url),Gs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BamFile:r},{RemoteFile:a}])=>{const l=c=>new a(r1(c,this.view.getBaseUrl()));Ei(this,ph,new r({bamFilehandle:l(this.params.url),baiFilehandle:l(this.params.indexUrl??this.params.url+".bai")})),ve(this,ph).getHeader().then(c=>{var h,f;const d=this.genome.hasChrPrefix(),u=(f=(h=ve(this,ph).indexToChr)==null?void 0:h[0])==null?void 0:f.refName.startsWith("chr");d&&!u?this.chrPrefixFixer=g=>g.replace("chr",""):!d&&u&&(this.chrPrefixFixer=g=>"chr"+g),o()})})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>ve(this,ph).getRecordsForRange(this.chrPrefixFixer(s.chrom),s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>({chrom:s.chrom,start:a.get("start"),end:a.get("end"),name:a.get("name"),MD:a.get("MD"),cigar:a.get("cigar"),mapq:a.get("mq"),strand:a.get("strand")===1?"+":"-"}))));i&&this.publishData(i)}}ph=new WeakMap;var Ev;class Ice extends a1{constructor(t,i){const s={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...t};super(i,s.channel);et(this,Ev,void 0);if(this.params=s,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Gs(()=>import("./index-X47Qq1Ab.js").then(r=>r.i),__vite__mapDeps([0,1]),import.meta.url),Gs(()=>import("./index-iJ7AaoXZ.js"),__vite__mapDeps([11,8,1,0,3,4]),import.meta.url),Gs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:r},{TabixIndexedFile:a},{RemoteFile:l}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=r));const c=d=>new l(r1(d,this.view.getBaseUrl()));Ei(this,Ev,new a({filehandle:c(this.params.url),tbiFilehandle:c(this.params.indexUrl??this.params.url+".tbi")})),o()})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>{const r=[];return await ve(this,Ev).getLines(s.chrom,s.startPos,s.endPos,{lineCallback:a=>{r.push(a)},signal:o}),this._parseFeatures(r)});i&&this.publishData(i)}_parseFeatures(t){return[]}}Ev=new WeakMap;var Iv;class Ace extends Ice{constructor(t,i){super(t,i);et(this,Iv,void 0);Gs(()=>import("./index-Q6MnDN88.js"),__vite__mapDeps([12,0,1,3]),import.meta.url).then(s=>{Ei(this,Iv,s.default)})}_parseFeatures(t){var s;return(s=ve(this,Iv))==null?void 0:s.parseStringSync(t.join(` -`),{parseSequences:!1})}}Iv=new WeakMap;function Tce(n,e){if(Mz(n))return new fce(n,e);if(gce(n))return new pce(n,e);if(mce(n))return new _ce(n,e);if(Nce(n))return Vce(n.lazy,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function Nce(n){return"lazy"in n}function Mce(n){return(n==null?void 0:n.type)=="axisTicks"}function Rce(n){return(n==null?void 0:n.type)=="axisGenome"}function Pce(n){return(n==null?void 0:n.type)=="indexedFasta"}function Oce(n){return(n==null?void 0:n.type)=="bigwig"}function Fce(n){return(n==null?void 0:n.type)=="bigbed"}function Bce(n){return(n==null?void 0:n.type)=="bam"}function Wce(n){return(n==null?void 0:n.type)=="gff3"}function Vce(n,e){if(Mce(n))return new bce(n,e);if(Rce(n))return new vce(n,e);if(Pce(n))return new Cce(n,e);if(Oce(n))return new Sce(n,e);if(Fce(n))return new Lce(n,e);if(Bce(n))return new Ece(n,e);if(Wce(n))return new Ace(n,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function Hce(n){const e=Object.keys(n).filter(i=>typeof i=="string"),t=new Function("source","return { "+e.map(i=>JSON.stringify(i)).map(i=>`${i}: source[${i}]`).join(`, -`)+" };");return t.properties=e,t}class BC extends pn{get behavior(){return nl}constructor(){super();const e=t=>{const i=Hce(t);this.handle=s=>this._propagate(i(s)),this.handle(t)};this.handle=e,this.beginBatch=t=>{cz(t)&&(this.handle=e),super.beginBatch(t)}}}function zce(n){return"name"in n}var Av;class Rz extends o1{constructor(t,i,s){super();et(this,Av,void 0);this.provider=s,this.params=t}get identifier(){return this.params.name}updateDynamicData(t){Ei(this,Av,t),this.loadSynchronously()}loadSynchronously(){const t=ve(this,Av)??this.provider(this.params.name)??[];let i=s=>s;if(Array.isArray(t))t.length>0&&(i=Nz(t[0]));else throw new Error(`Named data "${this.params.name}" is not an array!`);this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}Av=new WeakMap;class Pz{constructor(){this._dataSourcesByHost=new Map,this._collectorsByHost=new Map,this._observers=new Map}get dataSources(){return[...new Set(this._dataSourcesByHost.values()).values()]}get collectors(){return[...this._collectorsByHost.values()]}addObserver(e,t){let i=this._observers.get(t);i||(i=[],this._observers.set(t,i)),i.push(e)}_relayObserverCallback(e,t){const i=this._observers.get(t);if(i)for(const s of i)s(e)}addDataSource(e,t){this._dataSourcesByHost.set(t,e)}findDataSourceByKey(e){return this._dataSourcesByHost.get(e)}findNamedDataSource(e){let t,i=[];for(const[s,o]of this._dataSourcesByHost.entries())if(o instanceof Rz&&e==o.identifier){if(t&&t!==o)throw new Error(`Found multiple instances of named data: ${e}. Data flow optimization is broken (it's a bug).`);t=o,i.push(s)}if(t)return{dataSource:t,hosts:i}}addCollector(e,t){this._collectorsByHost.set(t,e),e.observers.push(i=>this._relayObserverCallback(i,t))}findCollectorByKey(e){return this._collectorsByHost.get(e)}initialize(){for(const e of this.dataSources)e.visit(t=>t.initialize())}}function $ce(n,e){const t=new Map,i=[];for(const s of n)t.set(s,{ref:s,children:[]});for(const s of t.values()){const o=t.get(e(s.ref));o?o.children.push(s):i.push(s)}return i}function Oz(n,e,t){var s,o;const i=(s=e.preOrder)==null?void 0:s.call(e,n);if(i)return i;for(const r of t(n)){const a=Oz(r,e,t);if(a==="stop")return a}return(o=e.postOrder)==null?void 0:o.call(e,n)}function Uce(n,e){return Oz(n,e,t=>t.children)}function jce(n,e){const t=[];let i;const s=e??new Pz,o=[];function r(u,h=()=>{}){if(!i)throw h()||new Error("Cannot append data flow node, no parent exist!");return i.addChild(u),i=u,u}function a(u,h){return r(u,()=>new Error(`Cannot append a transform because no (inherited) data are available! ${h?JSON.stringify(h):""}`))}function l(u,h){for(const f of u){let g;try{g=cce(f,h)}catch(p){throw console.warn(p),new Error(`Cannot initialize "${f.type}" transform: ${p}`)}g.behavior&su&&a(new BC),a(g)}}const c=u=>{if(t.push(i),u.spec.data){const h=zce(u.spec.data)?new Rz(u.spec.data,u,u.context.getNamedDataFromProvider):Tce(u.spec.data,u);i=h,s.addDataSource(h,u)}if(u.spec.transform&&l(u.spec.transform,u),u instanceof Oo){if(!i)throw new Error(`A unit view (${u.getPathString()}) has no (inherited) data source`);const h=qce(u);if(h){o.push(h.rewrite);for(const g of h.transforms)a(g)}u.mark.isPickingParticipant()&&(a(new BC),a(new Az({type:"identifier"})));const f=new kz({type:"collect",groupby:u.getFacetFields(),sort:Gce(u,h==null?void 0:h.rewrittenEncoding)});r(f),s.addCollector(f,u)}},d=$ce(n.getDescendants(),u=>u.dataParent);for(const u of d)Uce(u,{preOrder:h=>c(h.ref),postOrder:()=>{i=t.pop()}});return o.forEach(u=>u()),s}function qce(n){var o;const e=[],t={},i=[];for(const[r,a]of Object.entries(n.getEncoding())){const l=r;ib(l)&&jV(a)&&i.push({channel:l,chromPosDef:a})}const s=Mx(i,r=>Yh(r.channel),r=>r.chromPosDef.chrom);for(const[r,a]of s.entries())for(const[l,c]of a.entries()){const d=[],u=[],h=[];for(const{channel:f,chromPosDef:g}of c){const p=b=>b.replace(/[^A-Za-z0-9_]/g,""),_=["_linearized_",p(g.chrom),"_",p(g.pos)].join(""),v={...((o=n.spec.encoding)==null?void 0:o[f])??n.getEncoding()[f]??{},field:_};delete v.chrom,delete v.pos,!v.type&&g.type&&(v.type=g.type),t[f]=v,d.push(g.pos),h.push(g.offset??0),u.push(_)}e.push(new BC),e.push(new Ez({type:"linearizeGenomicCoordinate",channel:r,chrom:l,pos:d,offset:h,as:u},n))}return e.length?{transforms:e,rewrittenEncoding:t,rewrite:()=>{n.spec.encoding={...n.spec.encoding,...t},iz(n.mark,"encoding")}}:void 0}function Gce(n,e){var i;const t={...n.getEncoding(),...e}.x;if(_o(t)&&(i=n.getScaleResolution("x"))!=null&&i.isZoomable()){if(wf(t))return"buildIndex"in t&&t.buildIndex?{field:t.field}:null;if(!e1(t)){if(Qx(t))throw new Error("A zoomable x channel must be mapped to a field.")}}}function Fz(n,e=void 0){if(n.parent!==e)return!1;for(const t of n.children)if(!Fz(t,n))return!1;return!0}function oI(n,e=!1){if(n.behavior&PR&&(e=!0),n instanceof BC)if(e)e=!1;else{const t=n.children[0];n.excise(),t&&oI(t,e);return}n.behavior&nl&&(e=!1);for(let t=0,i=n.children.length;t1)}function Kce(n){const e=[...n._dataSourcesByHost.entries()],t=new Map;for(const i of e){const s=i[1];s.identifier&&!t.has(s.identifier)&&t.set(s.identifier,s)}n._dataSourcesByHost.clear();for(let[i,s]of e){const o=t.get(s.identifier);o&&(o.adoptChildrenOf(s),s=o),n.addDataSource(s,i)}}function Yce(n){if(oI(n),!Fz(n))throw new Error("Encountered a bug! There's a problem in the data flow structure.")}function Zce(n){for(const e of n.dataSources)Yce(e);Kce(n)}function Xce(n){const e=new Set;n.visit(t=>{for(const i of Object.values(t.resolutions.scale)){const s=i.name;if(s&&e.has(s))throw new Error(`The same scale name "${s}" occurs in multiple scale resolutions!`);e.add(s)}})}function Qce(n){for(const e of Lm){const t=n.getScaleResolution(e);t&&!t.name&&t.isZoomable()&&(t.name=`${e}_at_root`)}}async function Jce(n,e,t){var r;if(!n.import.url)throw new Error("Cannot import, not an import spec: "+JSON.stringify(n));const i=Ox({baseURL:e}),s=n.import.url,o=JSON.parse(await i.load(s).catch(a=>{throw new Error(`Could not load imported view spec: ${s} -Reason: ${a.message}`)}));if(t.isViewSpec(o))return o.baseUrl=(r=s.match(/^[^?#]*\//))==null?void 0:r[0],o;throw new Error(`The imported spec "${s}" is not a view spec: ${JSON.stringify(n)}`)}function ede(n){const e=n.getSize().addPadding(n.getOverhang()),t=i=>i.grow>0?void 0:i.px;return{width:t(e.width),height:t(e.height)}}function al(n){return()=>n}const Rr=class Rr{static create(e,t,i,s){return new Rr(al(e),al(t),al(i),al(s))}_offset(e,t){const i=this["_"+e];if(t===0)return i;switch(typeof t){case"number":return()=>i()+t;case"function":return()=>i()+t();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,t,i,s){this._x=e,this._y=t,this._width=i,this._height=s}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const t=i=>{const s=e[i];return typeof s=="number"?al(s):typeof s=="function"?s:this._passThrough(i)};return new Rr(t("x"),t("y"),t("width"),t("height"))}translate(e,t){return e===0&&t===0?this:new Rr(this._offset("x",e),this._offset("y",t),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,t=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new Rr(e.left?this._offset("x",-e.left*t):this._passThrough("x"),e.top?this._offset("y",-e.top*t):this._passThrough("y"),e.width?this._offset("width",e.width*t):this._passThrough("width"),e.height?this._offset("height",e.height*t):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e||e==null?this:new Rr(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}union(e){return this===e||e==null?this:new Rr(()=>Math.min(this.x,e.x),()=>Math.min(this.y,e.y),()=>Math.max(this.x2,e.x2)-Math.min(this.x,e.x),()=>Math.max(this.y2,e.y2)-Math.min(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new Rr(al(this.x),al(this.y),al(this.width),al(this.height))}containsPoint(e,t){return e>=this.x&&e=this.y&&t()=>{e&&r()},s=r=>()=>{e&&t&&r()},o=Mx(this.buffer.reverse(),r=>r.mark);for(const[r,a]of[...o.entries()].reverse()){if(!r.isReady())continue;this.batch.push(()=>{e=r.unitView.getEffectiveOpacity()>0}),this.batch.push(...r.prepareRender(this.globalOptions).map(c=>i(c)));let l;for(const c of a){const d=c.coords;d.equals(l)||this.batch.push(i(()=>{t=r.setViewport(d,c.clipRect)})),this.batch.push(s(c.callback)),l=c.coords}}}}class tde extends Bz{constructor(...e){super({}),this.contexts=e}pushView(e,t){for(const i of this.contexts)i.pushView(e,t)}popView(e){for(const t of this.contexts)t.popView(e)}renderMark(e,t){for(const i of this.contexts)i.renderMark(e,t)}}class ide{constructor(e,t){this.point=e,this.uiEvent=t,this.stopped=!1,this.target=void 0}stopPropagation(){this.stopped=!0}get type(){return this.uiEvent.type}}class nde{constructor(e,t){this.x=e,this.y=t}equals(e){return e?e===this||e.x===this.x&&e.y===this.y:!1}}const sde=n=>new Promise(e=>setTimeout(e,n));function ode(n){const e=n.requestAnimationFrame||window.requestAnimationFrame,t=n.signal,i=()=>new Promise((s,o)=>{if(t!=null&&t.aborted)return o("aborted");const r=performance.now(),a=r+(n.duration||1e3),l=typeof n.from=="number"?n.from:0,c=typeof n.to=="number"?n.to:1,d=n.easingFunction||(p=>p),u=p=>(p-r)/(a-r),h=p=>p*(c-l)+l,f=p=>Math.max(0,Math.min(1,p)),g=p=>{t!=null&&t.aborted?o("aborted"):(n.onUpdate(h(d(f(u(p))))),p=0&&this.transitions.splice(t,1)}requestRender(){this._renderRequested?this._warn&&console.warn("Render already requested!"):(this._renderRequested=!0,window.requestAnimationFrame(e=>{this._renderRequested=!1;const t=this.transitions;this.transitions=[];let i;for(;i=t.shift();)i(e);this._renderCallback(e)}))}transition(e){return ode({requestAnimationFrame:t=>this.requestTransition(t),...e})}}class ade{constructor(e){this.genomes=new Map,this.baseUrl=e}async initialize(e){const t=new vle(e);return this.genomes.set(t.name,t),Promise.all([...this.genomes.values()].map(i=>i.load(this.baseUrl)))}getGenome(e){if(!this.genomes.size)throw new Error("No genomes have been configured!");if(e){const t=this.genomes.get(e);if(!t)throw new Error(`No genome with the name ${e} has been configured!`);return t}else{if(this.genomes.size>1)throw new Error("Cannot pick a default genome! More than one have been configured!");return this.genomes.values().next().value}}}const lde=""+new URL("Lato-Regular-RGOEmfU9.png",import.meta.url).href,cde={thin:100,light:300,regular:400,normal:400,medium:500,bold:700,black:900};class dde{constructor(e){this._webGLHelper=e,this.fontRepository="https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/",this._fonts=new kd([],JSON.stringify),this._metadataPromises=new Map,this._fontPromises=new Map,this._promises=[],this._defaultFontEntry={metrics:GE(Iz),texture:e?this._createTextureNow(lde):void 0}}async waitUntilReady(){await Promise.all(this._promises)}getFont(e,t="normal",i="regular"){if(Di(i)&&(i=cde[i.toLowerCase()],!i))throw new Error("Unknown font weight: "+i);const s={family:e,style:t,weight:i};let o=this._fonts.get(s);return o||(o={metrics:void 0,texture:void 0},this._fonts.set(s,o),this._promises.push(this._loadFontEntry(o,s))),o}async _loadFontEntry(e,t){try{const i=await this._loadMetadata(t.family),s=hde(i,t),o=this.fontRepository+OO(t.family)+"/"+s.replace(/\.\w+/,""),r=this._createTexture(o+".png"),a=this._loadFont(o+".json");e.texture=await r,e.metrics=await a}catch(i){console.log("Cannot load font. Using default.",i),e.metrics=this._defaultFontEntry.metrics,e.texture=this._defaultFontEntry.texture}}_loadFont(e){let t=this._fontPromises.get(e);return t||(t=fetch(e).then(i=>{if(!i.ok)throw new Error("Could not load font: "+i.status);return i}).then(i=>i.json()).then(i=>GE(i)),this._fontPromises.set(e,t)),t}_loadMetadata(e){const t=OO(e);let i=this._metadataPromises.get(t);return i||(i=fetch(this.fontRepository+t+"/METADATA.pb").then(s=>{if(!s.ok)throw new Error("Could not load font metadata: "+s.status);return s}).then(s=>s.text()).then(s=>ude(s)).catch(s=>{console.warn(s)}),this._metadataPromises.set(t,i)),i}getDefaultFont(){return this._defaultFontEntry}_createTexture(e){const t=this._webGLHelper.gl;return new Promise((i,s)=>{ob(t,{src:e,min:t.LINEAR},(o,r,a)=>{o?s(o):i(r)})})}_createTextureNow(e){const t=this._webGLHelper.gl;let i;const s=new Promise((o,r)=>{i=ob(t,{src:e,min:t.LINEAR},(a,l,c)=>{a?r(a):o(l)})});return this._promises.push(s),i}}function OO(n){return n.toLowerCase().replaceAll(/[^\w]/g,"")}function ude(n){const e=n.split(` -`),t=[];let i;for(const s of e)if(s.startsWith("fonts {")&&(i={name:void 0,style:void 0,weight:void 0,filename:void 0,post_script_name:void 0,full_name:void 0,copyright:void 0}),s.startsWith("}")&&(t.push(i),i=void 0),i){let o=s.match(/^\s*([A-Za-z_]+):[ ]?"(.*)"$/);if(o){const r=o[1];i[r]=o[2]}if(o=s.match(/^\s*([A-Za-z_]+):[ ]?(\d+)$/),o){const r=o[1];i[r]=+o[2]}}return t}function hde(n,e){let t,i=Number.POSITIVE_INFINITY;for(const s of n)if(e.family.localeCompare(s.name,void 0,{sensitivity:"accent"})==0&&e.style==s.style){const o=Math.abs(e.weight-s.weight);o"))i={identifier:s.match(/>(\S+)/)[1],sequence:""},t.push(i);else if(i)i.sequence+=s.trim();else throw new Error("Invalid fasta file!");return t}class gde{constructor(e,t){this.animator=e,this.disabled=!!t,this.damping=.015,this.acceleration=.3,this.accelerationThreshold=100,this.lowerLimit=.5,this.loop=!1,this.momentum=0,this.timestamp=0,this.callback=null,this._transitionCallback=this.animate.bind(this),this.clear()}clear(){this.momentum=0,this.timestamp=null,this.loop=null,this.callback=null}cancel(){this.loop&&(this.animator.cancelTransition(this._transitionCallback),this.clear())}setMomentum(e,t){if(this.disabled){t(e);return}e*this.momentum<0?this.momentum=0:Math.abs(e)>this.accelerationThreshold?this.momentum=oW([this.momentum,e],this.acceleration):this.momentum=e,this.callback=t,this.loop||this.animate()}animate(e){this.callback(this.momentum);const t=e-this.timestamp||0;this.timestamp=e;const i=Math.abs(this.momentum);this.momentum=Math.sign(this.momentum)*Math.max(0,i-((i*this.damping)**1.5+.04)*t),Math.abs(this.momentum)>this.lowerLimit?(this.loop=!0,this.animator.requestTransition(this._transitionCallback)):this.clear()}}function pde(n){const e={},t=["string","number","boolean"],i=["wheelDelta","wheelDeltaX","wheelDeltaY"];for(const s in n){const o=s;!i.includes(s)&&t.includes(typeof n[o])&&(e[o]=n[o])}return e}const FO=new Map;async function mde(n,e,t){const i=n.symbol;let s=FO.get(i)??await vde(n.symbol);return s?(FO.set(i,s),Ti` + }`)(u,d));function _(b){i=b,s=b.length,t=0}function v(b,w,y,S){_(S),o=f(b,w,y);for(const L of p)L(o);return o}return v}function Gce(n,e){return Array.from({length:Math.ceil(n.length/e)},(t,i)=>n.slice(i*e,i*e+e))}var vh;class Kce extends g1{constructor(t,i){const s={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Fe(this,vh,void 0);Dn(this,"chrPrefixFixer",t=>t);if(this.params=s,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([qs(()=>import("./index-P-r8iX32.js"),__vite__mapDeps([10,4,0,1,3,6,8]),import.meta.url),qs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BamFile:r},{RemoteFile:a}])=>{const l=c=>new a(f1(c,this.view.getBaseUrl()));_i(this,vh,new r({bamFilehandle:l(this.params.url),baiFilehandle:l(this.params.indexUrl??this.params.url+".bai")})),me(this,vh).getHeader().then(c=>{var h,f;const d=this.genome.hasChrPrefix(),u=(f=(h=me(this,vh).indexToChr)==null?void 0:h[0])==null?void 0:f.refName.startsWith("chr");d&&!u?this.chrPrefixFixer=g=>g.replace("chr",""):!d&&u&&(this.chrPrefixFixer=g=>"chr"+g),o()})})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>me(this,vh).getRecordsForRange(this.chrPrefixFixer(s.chrom),s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>({chrom:s.chrom,start:a.get("start"),end:a.get("end"),name:a.get("name"),MD:a.get("MD"),cigar:a.get("cigar"),mapq:a.get("mq"),strand:a.get("strand")===1?"+":"-"}))));i&&this.publishData(i)}}vh=new WeakMap;var Pv;class Yce extends g1{constructor(t,i){const s={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Fe(this,Pv,void 0);if(this.params=s,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([qs(()=>import("./index-X47Qq1Ab.js").then(r=>r.i),__vite__mapDeps([0,1]),import.meta.url),qs(()=>import("./index-iJ7AaoXZ.js"),__vite__mapDeps([11,8,1,0,3,4]),import.meta.url),qs(()=>import("./index-q6UT6DYT.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:r},{TabixIndexedFile:a},{RemoteFile:l}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=r));const c=d=>new l(f1(d,this.view.getBaseUrl()));_i(this,Pv,new a({filehandle:c(this.params.url),tbiFilehandle:c(this.params.indexUrl??this.params.url+".tbi")})),o()})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>{const r=[];return await me(this,Pv).getLines(s.chrom,s.startPos,s.endPos,{lineCallback:a=>{r.push(a)},signal:o}),this._parseFeatures(r)});i&&this.publishData(i)}_parseFeatures(t){return[]}}Pv=new WeakMap;var Ov;class Zce extends Yce{constructor(t,i){super(t,i);Fe(this,Ov,void 0);qs(()=>import("./index-Q6MnDN88.js"),__vite__mapDeps([12,0,1,3]),import.meta.url).then(s=>{_i(this,Ov,s.default)})}_parseFeatures(t){var s;return(s=me(this,Ov))==null?void 0:s.parseStringSync(t.join(` +`),{parseSequences:!1})}}Ov=new WeakMap;function Xce(n,e){if(Yz(n))return new Mce(n,e);if(Rce(n))return new Pce(n,e);if(Oce(n))return new Fce(n,e);if(Qce(n))return rde(n.lazy,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function Qce(n){return"lazy"in n}function Jce(n){return(n==null?void 0:n.type)=="axisTicks"}function ede(n){return(n==null?void 0:n.type)=="axisGenome"}function tde(n){return(n==null?void 0:n.type)=="indexedFasta"}function ide(n){return(n==null?void 0:n.type)=="bigwig"}function nde(n){return(n==null?void 0:n.type)=="bigbed"}function sde(n){return(n==null?void 0:n.type)=="bam"}function ode(n){return(n==null?void 0:n.type)=="gff3"}function rde(n,e){if(Jce(n))return new Bce(n,e);if(ede(n))return new Wce(n,e);if(tde(n))return new zce(n,e);if(ide(n))return new $ce(n,e);if(nde(n))return new jce(n,e);if(sde(n))return new Kce(n,e);if(ode(n))return new Zce(n,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function ade(n){const e=Object.keys(n).filter(i=>typeof i=="string"),t=new Function("source","return { "+e.map(i=>JSON.stringify(i)).map(i=>`${i}: source[${i}]`).join(`, +`)+" };");return t.properties=e,t}class zC extends pn{get behavior(){return nl}constructor(){super();const e=t=>{const i=ade(t);this.handle=s=>this._propagate(i(s)),this.handle(t)};this.handle=e,this.beginBatch=t=>{Sz(t)&&(this.handle=e),super.beginBatch(t)}}}function lde(n){return"name"in n}var Fv;class Zz extends h1{constructor(t,i,s){super();Fe(this,Fv,void 0);this.provider=s,this.params=t}get identifier(){return this.params.name}updateDynamicData(t){_i(this,Fv,t),this.loadSynchronously()}loadSynchronously(){const t=me(this,Fv)??this.provider(this.params.name)??[];let i=s=>s;if(Array.isArray(t))t.length>0&&(i=Kz(t[0]));else throw new Error(`Named data "${this.params.name}" is not an array!`);this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}Fv=new WeakMap;class Xz{constructor(){this._dataSourcesByHost=new Map,this._collectorsByHost=new Map,this._observers=new Map}get dataSources(){return[...new Set(this._dataSourcesByHost.values()).values()]}get collectors(){return[...this._collectorsByHost.values()]}addObserver(e,t){let i=this._observers.get(t);i||(i=[],this._observers.set(t,i)),i.push(e)}_relayObserverCallback(e,t){const i=this._observers.get(t);if(i)for(const s of i)s(e)}addDataSource(e,t){this._dataSourcesByHost.set(t,e)}findDataSourceByKey(e){return this._dataSourcesByHost.get(e)}findNamedDataSource(e){let t,i=[];for(const[s,o]of this._dataSourcesByHost.entries())if(o instanceof Zz&&e==o.identifier){if(t&&t!==o)throw new Error(`Found multiple instances of named data: ${e}. Data flow optimization is broken (it's a bug).`);t=o,i.push(s)}if(t)return{dataSource:t,hosts:i}}addCollector(e,t){this._collectorsByHost.set(t,e),e.observers.push(i=>this._relayObserverCallback(i,t))}findCollectorByKey(e){return this._collectorsByHost.get(e)}initialize(){for(const e of this.dataSources)e.visit(t=>t.initialize())}}function cde(n,e){const t=new Map,i=[];for(const s of n)t.set(s,{ref:s,children:[]});for(const s of t.values()){const o=t.get(e(s.ref));o?o.children.push(s):i.push(s)}return i}function Qz(n,e,t){var s,o;const i=(s=e.preOrder)==null?void 0:s.call(e,n);if(i)return i;for(const r of t(n)){const a=Qz(r,e,t);if(a==="stop")return a}return(o=e.postOrder)==null?void 0:o.call(e,n)}function dde(n,e){return Qz(n,e,t=>t.children)}function ude(n,e){const t=[];let i;const s=e??new Xz,o=[];function r(u,h=()=>{}){if(!i)throw h()||new Error("Cannot append data flow node, no parent exist!");return i.addChild(u),i=u,u}function a(u,h){return r(u,()=>new Error(`Cannot append a transform because no (inherited) data are available! ${h?JSON.stringify(h):""}`))}function l(u,h){for(const f of u){let g;try{g=Ice(f,h)}catch(p){throw console.warn(p),new Error(`Cannot initialize "${f.type}" transform: ${p}`)}g.behavior&cu&&a(new zC),a(g)}}const c=u=>{if(t.push(i),u.spec.data){const h=lde(u.spec.data)?new Zz(u.spec.data,u,u.context.getNamedDataFromProvider):Xce(u.spec.data,u);i=h,s.addDataSource(h,u)}if(u.spec.transform&&l(u.spec.transform,u),u instanceof Po){if(!i)throw new Error(`A unit view (${u.getPathString()}) has no (inherited) data source`);const h=hde(u);if(h){o.push(h.rewrite);for(const g of h.transforms)a(g)}u.mark.isPickingParticipant()&&(a(new zC),a(new qz({type:"identifier"})));const f=new $z({type:"collect",groupby:u.getFacetFields(),sort:fde(u,h==null?void 0:h.rewrittenEncoding)});r(f),s.addCollector(f,u)}},d=cde(n.getDescendants(),u=>u.dataParent);for(const u of d)dde(u,{preOrder:h=>c(h.ref),postOrder:()=>{i=t.pop()}});return o.forEach(u=>u()),s}function hde(n){var o;const e=[],t={},i=[];for(const[r,a]of Object.entries(n.getEncoding())){const l=r;ab(l)&&pz(a)&&i.push({channel:l,chromPosDef:a})}const s=Vx(i,r=>Zh(r.channel),r=>r.chromPosDef.chrom);for(const[r,a]of s.entries())for(const[l,c]of a.entries()){const d=[],u=[],h=[];for(const{channel:f,chromPosDef:g}of c){const p=b=>b.replace(/[^A-Za-z0-9_]/g,""),_=["_linearized_",p(g.chrom),"_",p(g.pos)].join(""),v={...((o=n.spec.encoding)==null?void 0:o[f])??n.getEncoding()[f]??{},field:_};delete v.chrom,delete v.pos,!v.type&&g.type&&(v.type=g.type),t[f]=v,d.push(g.pos),h.push(g.offset??0),u.push(_)}e.push(new zC),e.push(new Uz({type:"linearizeGenomicCoordinate",channel:r,chrom:l,pos:d,offset:h,as:u},n))}return e.length?{transforms:e,rewrittenEncoding:t,rewrite:()=>{n.spec.encoding={...n.spec.encoding,...t},iae(n.mark,"encoding")}}:void 0}function fde(n,e){var i;const t={...n.getEncoding(),...e}.x;if(Bo(t)&&(i=n.getScaleResolution("x"))!=null&&i.isZoomable()){if(wf(t))return"buildIndex"in t&&t.buildIndex?{field:t.field}:null;if(!c1(t)){if(vL(t))throw new Error("A zoomable x channel must be mapped to a field.")}}}function Jz(n,e=void 0){if(n.parent!==e)return!1;for(const t of n.children)if(!Jz(t,n))return!1;return!0}function pI(n,e=!1){if(n.behavior&qR&&(e=!0),n instanceof zC)if(e)e=!1;else{const t=n.children[0];n.excise(),t&&pI(t,e);return}n.behavior&nl&&(e=!1);for(let t=0,i=n.children.length;t1)}function gde(n){const e=[...n._dataSourcesByHost.entries()],t=new Map;for(const i of e){const s=i[1];s.identifier&&!t.has(s.identifier)&&t.set(s.identifier,s)}n._dataSourcesByHost.clear();for(let[i,s]of e){const o=t.get(s.identifier);o&&(o.adoptChildrenOf(s),s=o),n.addDataSource(s,i)}}function pde(n){if(pI(n),!Jz(n))throw new Error("Encountered a bug! There's a problem in the data flow structure.")}function mde(n){for(const e of n.dataSources)pde(e);gde(n)}function _de(n){const e=new Set;n.visit(t=>{for(const i of Object.values(t.resolutions.scale)){const s=i.name;if(s&&e.has(s))throw new Error(`The same scale name "${s}" occurs in multiple scale resolutions!`);e.add(s)}})}function bde(n){for(const e of Im){const t=n.getScaleResolution(e);t&&!t.name&&t.isZoomable()&&(t.name=`${e}_at_root`)}}async function vde(n,e,t){var r;if(!n.import.url)throw new Error("Cannot import, not an import spec: "+JSON.stringify(n));const i=$x({baseURL:e}),s=n.import.url,o=JSON.parse(await i.load(s).catch(a=>{throw new Error(`Could not load imported view spec: ${s} +Reason: ${a.message}`)}));if(t.isViewSpec(o))return o.baseUrl=(r=s.match(/^[^?#]*\//))==null?void 0:r[0],o;throw new Error(`The imported spec "${s}" is not a view spec: ${JSON.stringify(n)}`)}function wde(n){const e=n.getSize().addPadding(n.getOverhang()),t=i=>i.grow>0?void 0:i.px;return{width:t(e.width),height:t(e.height)}}function al(n){return()=>n}const Pr=class Pr{static create(e,t,i,s){return new Pr(al(e),al(t),al(i),al(s))}_offset(e,t){const i=this["_"+e];if(t===0)return i;switch(typeof t){case"number":return()=>i()+t;case"function":return()=>i()+t();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,t,i,s){this._x=e,this._y=t,this._width=i,this._height=s}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const t=i=>{const s=e[i];return typeof s=="number"?al(s):typeof s=="function"?s:this._passThrough(i)};return new Pr(t("x"),t("y"),t("width"),t("height"))}translate(e,t){return e===0&&t===0?this:new Pr(this._offset("x",e),this._offset("y",t),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,t=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new Pr(e.left?this._offset("x",-e.left*t):this._passThrough("x"),e.top?this._offset("y",-e.top*t):this._passThrough("y"),e.width?this._offset("width",e.width*t):this._passThrough("width"),e.height?this._offset("height",e.height*t):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e||e==null?this:new Pr(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}union(e){return this===e||e==null?this:new Pr(()=>Math.min(this.x,e.x),()=>Math.min(this.y,e.y),()=>Math.max(this.x2,e.x2)-Math.min(this.x,e.x),()=>Math.max(this.y2,e.y2)-Math.min(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new Pr(al(this.x),al(this.y),al(this.width),al(this.height))}containsPoint(e,t){return e>=this.x&&e=this.y&&t()=>{e&&r()},s=r=>()=>{e&&t&&r()},o=Vx(this.buffer.reverse(),r=>r.mark);for(const[r,a]of[...o.entries()].reverse()){if(!r.isReady())continue;this.batch.push(()=>{e=r.unitView.getEffectiveOpacity()>0}),this.batch.push(...r.prepareRender(this.globalOptions).map(c=>i(c)));let l;for(const c of a){const d=c.coords;d.equals(l)||this.batch.push(i(()=>{t=r.setViewport(d,c.clipRect)})),this.batch.push(s(c.callback)),l=c.coords}}}}class yde extends e${constructor(...e){super({}),this.contexts=e}pushView(e,t){for(const i of this.contexts)i.pushView(e,t)}popView(e){for(const t of this.contexts)t.popView(e)}renderMark(e,t){for(const i of this.contexts)i.renderMark(e,t)}}class Cde{constructor(e,t){this.point=e,this.uiEvent=t,this.stopped=!1,this.target=void 0}stopPropagation(){this.stopped=!0}get type(){return this.uiEvent.type}}class Sde{constructor(e,t){this.x=e,this.y=t}equals(e){return e?e===this||e.x===this.x&&e.y===this.y:!1}}const xde=n=>new Promise(e=>setTimeout(e,n));function Lde(n){const e=n.requestAnimationFrame||window.requestAnimationFrame,t=n.signal,i=()=>new Promise((s,o)=>{if(t!=null&&t.aborted)return o("aborted");const r=performance.now(),a=r+(n.duration||1e3),l=typeof n.from=="number"?n.from:0,c=typeof n.to=="number"?n.to:1,d=n.easingFunction||(p=>p),u=p=>(p-r)/(a-r),h=p=>p*(c-l)+l,f=p=>Math.max(0,Math.min(1,p)),g=p=>{t!=null&&t.aborted?o("aborted"):(n.onUpdate(h(d(f(u(p))))),p=0&&this.transitions.splice(t,1)}requestRender(){this._renderRequested?this._warn&&console.warn("Render already requested!"):(this._renderRequested=!0,window.requestAnimationFrame(e=>{this._renderRequested=!1;const t=this.transitions;this.transitions=[];let i;for(;i=t.shift();)i(e);this._renderCallback(e)}))}transition(e){return Lde({requestAnimationFrame:t=>this.requestTransition(t),...e})}}class kde{constructor(e){this.genomes=new Map,this.baseUrl=e}async initialize(e){const t=new Wle(e);return this.genomes.set(t.name,t),Promise.all([...this.genomes.values()].map(i=>i.load(this.baseUrl)))}getGenome(e){if(!this.genomes.size)throw new Error("No genomes have been configured!");if(e){const t=this.genomes.get(e);if(!t)throw new Error(`No genome with the name ${e} has been configured!`);return t}else{if(this.genomes.size>1)throw new Error("Cannot pick a default genome! More than one have been configured!");return this.genomes.values().next().value}}}const Ede=""+new URL("Lato-Regular-RGOEmfU9.png",import.meta.url).href,Ide={thin:100,light:300,regular:400,normal:400,medium:500,bold:700,black:900};class Ade{constructor(e){this._webGLHelper=e,this.fontRepository="https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/",this._fonts=new Ad([],JSON.stringify),this._metadataPromises=new Map,this._fontPromises=new Map,this._promises=[],this._defaultFontEntry={metrics:tI(jz),texture:e?this._createTextureNow(Ede):void 0}}async waitUntilReady(){await Promise.all(this._promises)}getFont(e,t="normal",i="regular"){if(Ei(i)&&(i=Ide[i.toLowerCase()],!i))throw new Error("Unknown font weight: "+i);const s={family:e,style:t,weight:i};let o=this._fonts.get(s);return o||(o={metrics:void 0,texture:void 0},this._fonts.set(s,o),this._promises.push(this._loadFontEntry(o,s))),o}async _loadFontEntry(e,t){try{const i=await this._loadMetadata(t.family),s=Nde(i,t),o=this.fontRepository+YO(t.family)+"/"+s.replace(/\.\w+/,""),r=this._createTexture(o+".png"),a=this._loadFont(o+".json");e.texture=await r,e.metrics=await a}catch(i){console.log("Cannot load font. Using default.",i),e.metrics=this._defaultFontEntry.metrics,e.texture=this._defaultFontEntry.texture}}_loadFont(e){let t=this._fontPromises.get(e);return t||(t=fetch(e).then(i=>{if(!i.ok)throw new Error("Could not load font: "+i.status);return i}).then(i=>i.json()).then(i=>tI(i)),this._fontPromises.set(e,t)),t}_loadMetadata(e){const t=YO(e);let i=this._metadataPromises.get(t);return i||(i=fetch(this.fontRepository+t+"/METADATA.pb").then(s=>{if(!s.ok)throw new Error("Could not load font metadata: "+s.status);return s}).then(s=>s.text()).then(s=>Tde(s)).catch(s=>{console.warn(s)}),this._metadataPromises.set(t,i)),i}getDefaultFont(){return this._defaultFontEntry}_createTexture(e){const t=this._webGLHelper.gl;return new Promise((i,s)=>{ob(t,{src:e,min:t.LINEAR},(o,r,a)=>{o?s(o):i(r)})})}_createTextureNow(e){const t=this._webGLHelper.gl;let i;const s=new Promise((o,r)=>{i=ob(t,{src:e,min:t.LINEAR},(a,l,c)=>{a?r(a):o(l)})});return this._promises.push(s),i}}function YO(n){return n.toLowerCase().replaceAll(/[^\w]/g,"")}function Tde(n){const e=n.split(` +`),t=[];let i;for(const s of e)if(s.startsWith("fonts {")&&(i={name:void 0,style:void 0,weight:void 0,filename:void 0,post_script_name:void 0,full_name:void 0,copyright:void 0}),s.startsWith("}")&&(t.push(i),i=void 0),i){let o=s.match(/^\s*([A-Za-z_]+):[ ]?"(.*)"$/);if(o){const r=o[1];i[r]=o[2]}if(o=s.match(/^\s*([A-Za-z_]+):[ ]?(\d+)$/),o){const r=o[1];i[r]=+o[2]}}return t}function Nde(n,e){let t,i=Number.POSITIVE_INFINITY;for(const s of n)if(e.family.localeCompare(s.name,void 0,{sensitivity:"accent"})==0&&e.style==s.style){const o=Math.abs(e.weight-s.weight);o"))i={identifier:s.match(/>(\S+)/)[1],sequence:""},t.push(i);else if(i)i.sequence+=s.trim();else throw new Error("Invalid fasta file!");return t}class Rde{constructor(e,t){this.animator=e,this.disabled=!!t,this.damping=.015,this.acceleration=.3,this.accelerationThreshold=100,this.lowerLimit=.5,this.loop=!1,this.momentum=0,this.timestamp=0,this.callback=null,this._transitionCallback=this.animate.bind(this),this.clear()}clear(){this.momentum=0,this.timestamp=null,this.loop=null,this.callback=null}cancel(){this.loop&&(this.animator.cancelTransition(this._transitionCallback),this.clear())}setMomentum(e,t){if(this.disabled){t(e);return}e*this.momentum<0?this.momentum=0:Math.abs(e)>this.accelerationThreshold?this.momentum=bW([this.momentum,e],this.acceleration):this.momentum=e,this.callback=t,this.loop||this.animate()}animate(e){this.callback(this.momentum);const t=e-this.timestamp||0;this.timestamp=e;const i=Math.abs(this.momentum);this.momentum=Math.sign(this.momentum)*Math.max(0,i-((i*this.damping)**1.5+.04)*t),Math.abs(this.momentum)>this.lowerLimit?(this.loop=!0,this.animator.requestTransition(this._transitionCallback)):this.clear()}}function Pde(n){const e={},t=["string","number","boolean"],i=["wheelDelta","wheelDeltaX","wheelDeltaY"];for(const s in n){const o=s;!i.includes(s)&&t.includes(typeof n[o])&&(e[o]=n[o])}return e}const ZO=new Map;async function Ode(n,e,t){const i=n.symbol;let s=ZO.get(i)??await Wde(n.symbol);return s?(ZO.set(i,s),zt`
${s.name} ${s.description}

${s.summary}

Source: NCBI RefSeq Gene

- `):null}async function _de(n){console.log("Searching: "+n);const e={mode:"cors"},i=(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&term=${n}[GENE]&sort=relevance&retmode=json`,e).then(s=>s.json())).esearchresult.idlist[0];return i?(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id=${i}&retmode=json`,e).then(r=>r.json())).result[i]:null}const bde=FC(_de,500);function vde(n){return bde(n)}const wde=cs(".4~r"),yde=cs(".4~e");function Wz(n){return n==null?Ti` NA `:Di(n)?n.substring(0,30):Number.isInteger(n)?""+n:Xs(n)?Math.abs(n)>Math.pow(10,8)||Math.abs(n)[Wz(e),t{var d;for(const[u,h]of Object.entries(e.encoders))if((d=h==null?void 0:h.accessor)!=null&&d.fields.includes(l))switch(u){case"color":case"fill":case"stroke":return Ti` + `):null}async function Fde(n){console.log("Searching: "+n);const e={mode:"cors"},i=(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&term=${n}[GENE]&sort=relevance&retmode=json`,e).then(s=>s.json())).esearchresult.idlist[0];return i?(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id=${i}&retmode=json`,e).then(r=>r.json())).result[i]:null}const Bde=lb(Fde,500);function Wde(n){return Bde(n)}const Vde=ls(".4~r"),Hde=ls(".4~e");function t$(n){return n==null?zt` NA `:Ei(n)?n.substring(0,30):Number.isInteger(n)?""+n:Xs(n)?Math.abs(n)>Math.pow(10,8)||Math.abs(n)[t$(e),t{var d;for(const[u,h]of Object.entries(e.encoders))if((d=h==null?void 0:h.accessor)!=null&&d.fields.includes(l))switch(u){case"color":case"fill":case"stroke":return zt` - `}return""},s=Object.entries(n).filter(([l,c])=>!l.startsWith("_"));if(s.length===0)return;const o=Ti` + `}return""},s=Object.entries(n).filter(([l,c])=>!l.startsWith("_"));if(s.length===0)return;const o=zt` - ${s.map(([l,c])=>Ti` + ${s.map(([l,c])=>zt` - + `)}
${l}${Wz(c)} ${i(l,n)}${t$(c)} ${i(l,n)}
- `,r=e.unitView.getTitleText(),a=r?Ti` + `,r=e.unitView.getTitleText(),a=r?zt`
${r}
- `:"";return Ti`${a}${o}`}var kl;class l1 extends Xh{constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);et(this,kl,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){Ei(this,kl,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!uI(s)&&!dI(s))throw new Dh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return ve(this,kl).slice()}*[Symbol.iterator](){for(const t of ve(this,kl))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of ve(this,kl))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=ve(this,kl).length-1;i>=0;i--)if(ve(this,kl)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}kl=new WeakMap;class BO{constructor(e,t){this.n=e,this.maxCols=t??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],t=this.nCols,i=this.nRows;for(let s=0;s=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const Sde="chromosome_ticks_and_labels",xde={x:"width",y:"height"};function rI(n){return n=="x"?"y":"x"}const WC={x:["bottom","top"],y:["left","right"]},WR=Object.fromEntries(Object.entries(WC).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Od(n){return WR[n]}class Vz extends l1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?Dde:Hz,...Lde(t,e),...e};super(a?kde(l,t):zz(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return WR[this.axisProps.orient]=="x"?new Pd(t,e):new Pd(e,t)}getPerpendicularSize(){return VR(this.axisProps)}isPickingSupported(){return!1}}function VR(n){const e=Od(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const Hz={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function Lde(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function zz(n,e){const t={...n,extent:VR(n)},i=Od(t.orient),s=rI(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[xde[rI(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const Dde={...Hz,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function kde(n,e){const t={...n,extent:VR(n)},i=Od(t.orient),s=rI(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=zz({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:Sde,data:{lazy:{type:"axisGenome",channel:Od(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class Ede extends l1{constructor(e,t,i,s,o,r){const l={...t=="locus"?Ide:$z,...e};super(Mde(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const $z={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},Ide={...$z,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function Ade(n,e){const t=n,i=Od(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function Tde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function Nde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function Mde(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(Nde(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(Tde(t,e)),t.grid&&t.gridOpacity>0&&i.push(Ade(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Od(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const WO={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},Rde={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},Pde={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},Ode={start:0,middle:.5,end:1},Fde={start:"left",middle:"center",end:"right"};function Bde(n){if(!n)return;const e=Di(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":Rde,overlay:Pde}[e.style]??{},i={...WO,...t,...e};let s={},o={x:0,y:0};const r=Ode[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...WO,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??Fde[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}function Wde(n,e,t,i){if(n.type=="wheel"){n.uiEvent.preventDefault();const s=n.uiEvent,o=s.deltaMode?120:1;let{x:r,y:a}=n.point;if(i){const l=i.mark.encoders;l.x&&!l.x2&&!l.x.constantValue&&(r=+l.x(i.datum)*e.width+e.x),l.y&&!l.y2&&!l.y.constantValue&&(a=(1-+l.y(i.datum))*e.height+e.y)}Math.abs(s.deltaX){t({x:o.clientX,y:o.clientY,xDelta:l.clientX-o.clientX,yDelta:l.clientY-o.clientY,zDelta:0}),o=l},a=l=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a)};document.addEventListener("mouseup",a,!1),document.addEventListener("mousemove",r,!1)}}var Dp,kp,No,mh,Ep,El,Mu,wx,Uz,_h,E0,Tv,aI,Nv,lI,Mv,cI,yx,jz,Ip,ky,Cx,qz;class Vde extends Xh{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);et(this,El);et(this,wx);et(this,_h);et(this,Tv);et(this,Nv);et(this,Mv);et(this,yx);et(this,Ip);et(this,Cx);et(this,Dp,1/0);et(this,kp,10);et(this,No,[]);et(this,mh,{});et(this,Ep,0);this.spec=t,Ei(this,kp,t.spacing??10),Ei(this,Dp,a),Ei(this,No,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),ve(this,No).push(new HO(t,this,ve(this,Ep))),y3(this,Ep)._++}setChildren(t){Ei(this,No,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=ve(this,No).findIndex(o=>o.view==t);if(s>=0)ve(this,No)[s]=new HO(i,this,ve(this,Ep));else throw new Error("Not my child view!")}get children(){return ve(this,No).map(t=>t.view)}get childCount(){return ve(this,No).length}async createAxes(){const t=[];for(const i of Lm){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:WC[i][0],...o},a=new Vz(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),ve(this,mh)[i]=a}}}return Promise.all([...t,...ve(this,No).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of ve(this,No))yield*t.getChildren();for(const t of Object.values(ve(this,mh)))yield t}getOverhang(){return tt(this,yx,jz).call(this).union(tt(this,Ip,ky).call(this))}getSize(){return this._cache("size",()=>new Pd(tt(this,Nv,lI).call(this,"column"),tt(this,Nv,lI).call(this,"row")).addPadding(tt(this,Ip,ky).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(tt(this,Ip,ky).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=CO(tt(this,Tv,aI).call(this,"column"),i.width,o),a=CO(tt(this,Tv,aI).call(this,"row"),i.height,o),l=new BO(ve(this,El,Mu).length,ve(this,Dp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of ve(this,El,Mu).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:v}=u,[b,w]=l.getCellCoords(d),y=r[tt(this,Mv,cI).call(this,"column",b)],S=a[tt(this,Mv,cI).call(this,"row",w)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=y.location-D.left,O=S.location-D.top,R=(xt,It)=>(xt[It].grow?(It=="width"?y:S).size:xt[It].px)+D[It],P=R(L,"width"),M=R(L,"height"),$=R(x,"width"),Y=R(x,"height"),ne=u.scrollbars.horizontal,ce=u.scrollbars.vertical,ge=ne?()=>c(ne.viewportOffset):()=>0,se=ce?()=>c(ce.viewportOffset):()=>0,Se=new ql(()=>i.x+k,()=>i.y+O,()=>P,()=>M),Ie=h.isScrollable(),pe=Ie?new ql(()=>i.x+k-ge(),()=>i.y+O-se(),()=>$,()=>Y):Se;u.coords=Se;const ee=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ee,{...s,clipRect:void 0});for(const xt of Object.values(g))xt.render(t,Se,s);const Gt=Ude(h)||Ie;Gt&&h.render(t,pe,{...s,clipRect:ee}),_==null||_.render(t,ee,{...s,clipRect:void 0});for(const[xt,It]of Object.entries(f)){const je=xt=="left"||xt=="right"?"vertical":"horizontal",ei=u.scrollbars[je],De=ei?Se.modify(je=="vertical"?{y:()=>pe.y,height:Y}:{x:()=>pe.x,width:$}):Se,Be=VO(De,xt,It);let he=s.clipRect;ei&&(he=Be.intersect(he).intersect(ei?Se.modify(je=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),It.render(t,Be,{...s,clipRect:he})}for(const xt of Object.values(ve(this,mh))){const je=xt.axisProps.orient;(je=="left"&&b==0||je=="right"&&b==l.nCols-1||je=="top"&&w==0||je=="bottom"&&w==l.nRows-1)&&xt.render(t,VO(Se.shrink(u.view.getOverhang()),je,xt),s)}Gt||h.render(t,pe,s);for(const xt of Object.values(u.scrollbars))xt.updateScrollbar(Se,pe),xt.render(t,i,s);v==null||v.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=ve(this,El,Mu).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Oo||s instanceof l1)&&Wde(t,i.coords,o=>tt(this,Cx,qz).call(this,i.coords,i.view,o),this.context.getCurrentHover())),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}Dp=new WeakMap,kp=new WeakMap,No=new WeakMap,mh=new WeakMap,Ep=new WeakMap,El=new WeakSet,Mu=function(){return ve(this,No).filter(t=>t.view.isConfiguredVisible())},wx=new WeakSet,Uz=function(){return new BO(ve(this,El,Mu).length,ve(this,Dp)??1/0)},_h=new WeakSet,E0=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=ve(this,El,Mu)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>ve(this,wx,Uz)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:Wae(o.map(r=>ve(this,El,Mu)[r].view.getViewportSize()[i]))})))},Tv=new WeakSet,aI=function(t){const i=tt(this,_h,E0).call(this,t),s=[];s.push(n_);for(const[o,r]of i.entries())o>0&&s.push({px:ve(this,kp),grow:0}),(o==0||this.wrappingFacet)&&s.push(n_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(n_);return s},Nv=new WeakSet,lI=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return uz(o);const r=tt(this,_h,E0).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=ve(this,kp)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},Mv=new WeakSet,cI=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},yx=new WeakSet,jz=function(){const t=tt(this,_h,E0).call(this,"column"),i=tt(this,_h,E0).call(this,"row");return!t.length||!i.length?Cs.zero():new Cs(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},Ip=new WeakSet,ky=function(){const t=i=>{const s=WR[i],o=ve(this,mh)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+o.axisProps.offset,0)};return new Cs(t("top"),t("right"),t("bottom"),t("left"))},Cx=new WeakSet,qz=function(t,i,s){for(const[o,r]of Object.entries($de(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function Hde(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function zde(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",strokeOpacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function $de(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function Ude(n){let e=!0;return n.visit(t=>{t instanceof Oo&&e&&(e=t.mark.properties.clip===!0)}),e}function VO(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class HO{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=ql.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=Hde(o);r&&(this.background=new Oo(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=zde(o);a&&(this.backgroundStroke=new Oo(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=Bde(e.spec.title);if(l){const c=new Oo(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new zO(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new zO(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of WC[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!WC[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new Vz(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new Ede(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof l1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Oo&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+i.axisProps.offset,0):0};return new Cs(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class zO extends Oo{constructor(e,t){const i={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},e.layoutParent.context,e.layoutParent,e.view,"scrollbar-"+t,{blockEncodingInheritance:!0}),this.config=i,this.scrollDirection=t,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=ql.ZERO,this.addInteractionEventListener("mousedown",(s,o)=>{if(o.stopPropagation(),this.maxScrollOffset<=0)return;const r=h=>t=="vertical"?h.clientY:h.clientX,a=o.uiEvent;a.preventDefault();const l=this.getScrollOffset(),c=r(a),d=h=>{const f=J_(r(h)-c+l,0,this.maxScrollOffset);this.viewportOffset=f/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u,!1),document.addEventListener("mousemove",d,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(e,t,i){super.render(e,this.scrollbarCoords,i)}updateScrollbar(e,t){const i=this.config.scrollbarPadding,s=this.config.scrollbarSize,o=this.scrollDirection=="horizontal"?"width":"height",r=Math.min(1,e[o]/t[o]),a=e[o]-2*i,l=r*a;this.maxScrollOffset=a-l,this.maxViewportOffset=t[o]-e[o],this.viewportOffset=J_(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new ql(()=>e.x+e.width-s-i,()=>e.y+i+this.getScrollOffset(),()=>s,()=>l):new ql(()=>e.x+i+this.getScrollOffset(),()=>e.y+e.height-s-i,()=>l,()=>s)}}class Ck extends Vde{constructor(e,t,i,s,o){super(e,t,i,s,o,hI(e)?e.columns:Ey(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=hI(e)?e.concat:Ey(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":Ey(this.spec)&&e==="x"||Kz(this.spec)&&e==="y"?"shared":"independent"}}const Gz="viewRoot";var Ap;class jde{constructor(e={}){et(this,Ap,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(uI,t(l1)),this.addViewType(dI,t(Oo)),this.addViewType(Ey,t(Ck)),this.addViewType(Kz,t(Ck)),this.addViewType(hI,t(Ck)),this.addViewType(Gde,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){ve(this,Ap).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of ve(this,Ap))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...ve(this,Ap).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(qde(e))if(this.options.allowImport)a=await Jce(e,s.getBaseUrl(),t),r&&r(a);else throw new Dh("Importing views is not allowed!",i);else a=e;!s&&this.options.wrapRoot&&(dI(a)||uI(a))&&o===Gz&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof Xh&&await l.initializeChildren(),l}}Ap=new WeakMap;function dI(n){return"mark"in n&&(Di(n.mark)||Lo(n.mark))}function uI(n){return"layer"in n&&Lo(n.layer)}function qde(n){return"import"in n}function Ey(n){return"vconcat"in n&&Eo(n.vconcat)}function Kz(n){return"hconcat"in n&&Eo(n.hconcat)}function hI(n){return"concat"in n&&Eo(n.concat)}function Gde(n){return"samples"in n&&Lo(n.samples)&&"spec"in n&&Lo(n.spec)}var Tp,bh,Rv,vh;class Kde{constructor(){et(this,Tp,void 0);et(this,bh,void 0);et(this,Rv,void 0);et(this,vh,void 0);Ei(this,Tp,new Map),Ei(this,bh,new Set),Ei(this,vh,new Map),Ei(this,Rv,new Proxy(ve(this,Tp),{get(e,t){return Di(t)?e.get(t):void 0}}))}allocateSetter(e){if(ve(this,bh).has(e))throw new Error("Setter already allocated for parameter: "+e);return ve(this,bh).add(e),t=>{ve(this,Tp).set(e,t);const i=ve(this,vh).get(e);if(i)for(const s of i)s()}}createExpression(e){const t=Hx(e,ve(this,Rv));for(const i of t.globals)if(!ve(this,bh).has(i))throw new Error(`Unknown variable "${i}" in expression: ${e}`);return t.addListener=i=>{for(const s of t.globals){const o=ve(this,vh).get(s)??new Set;ve(this,vh).set(s,o),o.add(i)}},t}}Tp=new WeakMap,bh=new WeakMap,Rv=new WeakMap,vh=new WeakMap;OW("fasta",fde);class Yde{constructor(e,t,i={}){this.container=e,this._destructionCallbacks=[];const s=document.createElement("style");s.innerHTML=JJ,e.appendChild(s),this.spec=t,this.accessorFactory=new zie,this.viewFactory=new jde,this.namedDataProviders=[],this.animator=new rde(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=o=>o.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new gde(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:Cde,refseqgene:mde,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new Kde,this._loadingViews=new Map}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),sI(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i);for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(Ti`
+ `:"";return zt`${a}${o}`}var Il;class p1 extends Xh{constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);Fe(this,Il,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){_i(this,Il,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!yI(s)&&!wI(s))throw new kh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return me(this,Il).slice()}*[Symbol.iterator](){for(const t of me(this,Il))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of me(this,Il))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=me(this,Il).length-1;i>=0;i--)if(me(this,Il)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}Il=new WeakMap;class XO{constructor(e,t){this.n=e,this.maxCols=t??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],t=this.nCols,i=this.nRows;for(let s=0;s=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const $de="chromosome_ticks_and_labels",Ude={x:"width",y:"height"};function mI(n){return n=="x"?"y":"x"}const $C={x:["bottom","top"],y:["left","right"]},ZR=Object.fromEntries(Object.entries($C).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Hd(n){return ZR[n]}class i$ extends p1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?qde:n$,...jde(t,e),...e};super(a?Gde(l,t):s$(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return ZR[this.axisProps.orient]=="x"?new Vd(t,e):new Vd(e,t)}getPerpendicularSize(){return XR(this.axisProps)}isPickingSupported(){return!1}}function XR(n){const e=Hd(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const n$={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function jde(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function s$(n,e){const t={...n,extent:XR(n)},i=Hd(t.orient),s=mI(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[Ude[mI(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const qde={...n$,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function Gde(n,e){const t={...n,extent:XR(n)},i=Hd(t.orient),s=mI(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=s$({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:$de,data:{lazy:{type:"axisGenome",channel:Hd(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class Kde extends p1{constructor(e,t,i,s,o,r){const l={...t=="locus"?Yde:o$,...e};super(Jde(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const o$={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},Yde={...o$,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function Zde(n,e){const t=n,i=Hd(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function Xde(n,e){const t=n,i=Hd(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function Qde(n,e){const t=n,i=Hd(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function Jde(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(Qde(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(Xde(t,e)),t.grid&&t.gridOpacity>0&&i.push(Zde(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Hd(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const QO={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},eue={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},tue={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},iue={start:0,middle:.5,end:1},nue={start:"left",middle:"center",end:"right"};function sue(n){if(!n)return;const e=Ei(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":eue,overlay:tue}[e.style]??{},i={...QO,...t,...e};let s={},o={x:0,y:0};const r=iue[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...QO,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??nue[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}function oue(n,e,t,i){if(n.type=="wheel"){n.uiEvent.preventDefault();const s=n.uiEvent,o=s.deltaMode?120:1;let{x:r,y:a}=n.point;if(i){const l=i.mark.encoders;l.x&&!l.x2&&!l.x.constantValue&&(r=+l.x(i.datum)*e.width+e.x),l.y&&!l.y2&&!l.y.constantValue&&(a=(1-+l.y(i.datum))*e.height+e.y)}Math.abs(s.deltaX){t({x:o.clientX,y:o.clientY,xDelta:l.clientX-o.clientX,yDelta:l.clientY-o.clientY,zDelta:0}),o=l},a=l=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a)};document.addEventListener("mouseup",a,!1),document.addEventListener("mousemove",r,!1)}}var kp,Ep,To,wh,Ip,Al,Bu,Dx,r$,yh,A0,Bv,_I,Wv,bI,Vv,vI,kx,a$,Ap,Ry,Ex,l$;class rue extends Xh{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);Fe(this,Al);Fe(this,Dx);Fe(this,yh);Fe(this,Bv);Fe(this,Wv);Fe(this,Vv);Fe(this,kx);Fe(this,Ap);Fe(this,Ex);Fe(this,kp,1/0);Fe(this,Ep,10);Fe(this,To,[]);Fe(this,wh,{});Fe(this,Ip,0);this.spec=t,_i(this,Ep,t.spacing??10),_i(this,kp,a),_i(this,To,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),me(this,To).push(new eF(t,this,me(this,Ip))),N3(this,Ip)._++}setChildren(t){_i(this,To,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=me(this,To).findIndex(o=>o.view==t);if(s>=0)me(this,To)[s]=new eF(i,this,me(this,Ip));else throw new Error("Not my child view!")}get children(){return me(this,To).map(t=>t.view)}get childCount(){return me(this,To).length}async createAxes(){const t=[];for(const i of Im){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:$C[i][0],...o},a=new i$(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),me(this,wh)[i]=a}}}return Promise.all([...t,...me(this,To).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of me(this,To))yield*t.getChildren();for(const t of Object.values(me(this,wh)))yield t}getOverhang(){return Be(this,kx,a$).call(this).union(Be(this,Ap,Ry).call(this))}getSize(){return this._cache("size",()=>new Vd(Be(this,Wv,bI).call(this,"column"),Be(this,Wv,bI).call(this,"row")).addPadding(Be(this,Ap,Ry).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(Be(this,Ap,Ry).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=PO(Be(this,Bv,_I).call(this,"column"),i.width,o),a=PO(Be(this,Bv,_I).call(this,"row"),i.height,o),l=new XO(me(this,Al,Bu).length,me(this,kp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of me(this,Al,Bu).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:v}=u,[b,w]=l.getCellCoords(d),y=r[Be(this,Vv,vI).call(this,"column",b)],S=a[Be(this,Vv,vI).call(this,"row",w)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=y.location-D.left,P=S.location-D.top,O=(xt,It)=>(xt[It].grow?(It=="width"?y:S).size:xt[It].px)+D[It],R=O(L,"width"),M=O(L,"height"),W=O(x,"width"),G=O(x,"height"),ne=u.scrollbars.horizontal,ce=u.scrollbars.vertical,ge=ne?()=>c(ne.viewportOffset):()=>0,se=ce?()=>c(ce.viewportOffset):()=>0,Se=new Yl(()=>i.x+k,()=>i.y+P,()=>R,()=>M),Ie=h.isScrollable(),pe=Ie?new Yl(()=>i.x+k-ge(),()=>i.y+P-se(),()=>W,()=>G):Se;u.coords=Se;const ee=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ee,{...s,clipRect:void 0});for(const xt of Object.values(g))xt.render(t,Se,s);const Kt=due(h)||Ie;Kt&&h.render(t,pe,{...s,clipRect:ee}),_==null||_.render(t,ee,{...s,clipRect:void 0});for(const[xt,It]of Object.entries(f)){const Ge=xt=="left"||xt=="right"?"vertical":"horizontal",ti=u.scrollbars[Ge],De=ti?Se.modify(Ge=="vertical"?{y:()=>pe.y,height:G}:{x:()=>pe.x,width:W}):Se,Ve=JO(De,xt,It);let he=s.clipRect;ti&&(he=Ve.intersect(he).intersect(ti?Se.modify(Ge=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),It.render(t,Ve,{...s,clipRect:he})}for(const xt of Object.values(me(this,wh))){const Ge=xt.axisProps.orient;(Ge=="left"&&b==0||Ge=="right"&&b==l.nCols-1||Ge=="top"&&w==0||Ge=="bottom"&&w==l.nRows-1)&&xt.render(t,JO(Se.shrink(u.view.getOverhang()),Ge,xt),s)}Kt||h.render(t,pe,s);for(const xt of Object.values(u.scrollbars))xt.updateScrollbar(Se,pe),xt.render(t,i,s);v==null||v.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=me(this,Al,Bu).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Po||s instanceof p1)&&oue(t,i.coords,o=>Be(this,Ex,l$).call(this,i.coords,i.view,o),this.context.getCurrentHover())),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}kp=new WeakMap,Ep=new WeakMap,To=new WeakMap,wh=new WeakMap,Ip=new WeakMap,Al=new WeakSet,Bu=function(){return me(this,To).filter(t=>t.view.isConfiguredVisible())},Dx=new WeakSet,r$=function(){return new XO(me(this,Al,Bu).length,me(this,kp)??1/0)},yh=new WeakSet,A0=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=me(this,Al,Bu)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>me(this,Dx,r$)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:ole(o.map(r=>me(this,Al,Bu)[r].view.getViewportSize()[i]))})))},Bv=new WeakSet,_I=function(t){const i=Be(this,yh,A0).call(this,t),s=[];s.push(o_);for(const[o,r]of i.entries())o>0&&s.push({px:me(this,Ep),grow:0}),(o==0||this.wrappingFacet)&&s.push(o_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(o_);return s},Wv=new WeakSet,bI=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return Lz(o);const r=Be(this,yh,A0).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=me(this,Ep)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},Vv=new WeakSet,vI=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},kx=new WeakSet,a$=function(){const t=Be(this,yh,A0).call(this,"column"),i=Be(this,yh,A0).call(this,"row");return!t.length||!i.length?ys.zero():new ys(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},Ap=new WeakSet,Ry=function(){const t=i=>{const s=ZR[i],o=me(this,wh)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+o.axisProps.offset,0)};return new ys(t("top"),t("right"),t("bottom"),t("left"))},Ex=new WeakSet,l$=function(t,i,s){for(const[o,r]of Object.entries(cue(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function aue(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function lue(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",strokeOpacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function cue(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function due(n){let e=!0;return n.visit(t=>{t instanceof Po&&e&&(e=t.mark.properties.clip===!0)}),e}function JO(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class eF{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=Yl.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=aue(o);r&&(this.background=new Po(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=lue(o);a&&(this.backgroundStroke=new Po(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=sue(e.spec.title);if(l){const c=new Po(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new tF(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new tF(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of $C[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!$C[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new i$(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new Kde(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof p1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Po&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+i.axisProps.offset,0):0};return new ys(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class tF extends Po{constructor(e,t){const i={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},e.layoutParent.context,e.layoutParent,e.view,"scrollbar-"+t,{blockEncodingInheritance:!0}),this.config=i,this.scrollDirection=t,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=Yl.ZERO,this.addInteractionEventListener("mousedown",(s,o)=>{if(o.stopPropagation(),this.maxScrollOffset<=0)return;const r=h=>t=="vertical"?h.clientY:h.clientX,a=o.uiEvent;a.preventDefault();const l=this.getScrollOffset(),c=r(a),d=h=>{const f=eb(r(h)-c+l,0,this.maxScrollOffset);this.viewportOffset=f/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u,!1),document.addEventListener("mousemove",d,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(e,t,i){super.render(e,this.scrollbarCoords,i)}updateScrollbar(e,t){const i=this.config.scrollbarPadding,s=this.config.scrollbarSize,o=this.scrollDirection=="horizontal"?"width":"height",r=Math.min(1,e[o]/t[o]),a=e[o]-2*i,l=r*a;this.maxScrollOffset=a-l,this.maxViewportOffset=t[o]-e[o],this.viewportOffset=eb(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new Yl(()=>e.x+e.width-s-i,()=>e.y+i+this.getScrollOffset(),()=>s,()=>l):new Yl(()=>e.x+i+this.getScrollOffset(),()=>e.y+e.height-s-i,()=>l,()=>s)}}class Ek extends rue{constructor(e,t,i,s,o){super(e,t,i,s,o,CI(e)?e.columns:Py(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=CI(e)?e.concat:Py(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":Py(this.spec)&&e==="x"||d$(this.spec)&&e==="y"?"shared":"independent"}}const c$="viewRoot";var Tp;class uue{constructor(e={}){Fe(this,Tp,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(yI,t(p1)),this.addViewType(wI,t(Po)),this.addViewType(Py,t(Ek)),this.addViewType(d$,t(Ek)),this.addViewType(CI,t(Ek)),this.addViewType(fue,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){me(this,Tp).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of me(this,Tp))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...me(this,Tp).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(hue(e))if(this.options.allowImport)a=await vde(e,s.getBaseUrl(),t),r&&r(a);else throw new kh("Importing views is not allowed!",i);else a=e;!s&&this.options.wrapRoot&&(wI(a)||yI(a))&&o===c$&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof Xh&&await l.initializeChildren(),l}}Tp=new WeakMap;function wI(n){return"mark"in n&&(Ei(n.mark)||xo(n.mark))}function yI(n){return"layer"in n&&xo(n.layer)}function hue(n){return"import"in n}function Py(n){return"vconcat"in n&&Zs(n.vconcat)}function d$(n){return"hconcat"in n&&Zs(n.hconcat)}function CI(n){return"concat"in n&&Zs(n.concat)}function fue(n){return"samples"in n&&xo(n.samples)&&"spec"in n&&xo(n.spec)}var Np,Ch,Hv,qc;class gue{constructor(){Fe(this,Np,void 0);Fe(this,Ch,void 0);Fe(this,Hv,void 0);Fe(this,qc,void 0);_i(this,Np,new Map),_i(this,Ch,new Set),_i(this,qc,new Map),_i(this,Hv,new Proxy(me(this,Np),{get(e,t){return Ei(t)?e.get(t):void 0}}))}allocateSetter(e){if(me(this,Ch).has(e))throw new Error("Setter already allocated for parameter: "+e);return me(this,Ch).add(e),t=>{me(this,Np).set(e,t);const i=me(this,qc).get(e);if(i)for(const s of i)s()}}createExpression(e){const t=Kx(e,me(this,Hv));for(const s of t.globals)if(!me(this,Ch).has(s))throw new Error(`Unknown variable "${s}" in expression: ${e}`);const i=new Set;return t.addListener=s=>{for(const o of t.globals){const r=me(this,qc).get(o)??new Set;me(this,qc).set(o,r),r.add(s),i.add(s)}},t.invalidate=()=>{for(const s of t.globals){const o=me(this,qc).get(s);for(const r of i)o.delete(r)}},t}}Np=new WeakMap,Ch=new WeakMap,Hv=new WeakMap,qc=new WeakMap;YW("fasta",Mde);var Ix,u$;class pue{constructor(e,t,i={}){Fe(this,Ix);this.container=e,this._destructionCallbacks=[];const s=document.createElement("style");s.innerHTML=mee,e.appendChild(s),this.spec=t,this.accessorFactory=new vae,this.viewFactory=new uue,this.namedDataProviders=[],this.animator=new Dde(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=o=>o.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new Rde(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:zde,refseqgene:Ode,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new gue,Be(this,Ix,u$).call(this),this._loadingViews=new Map}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),gI(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i);for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(zt`
- + Loading...
-
`)}}t()?this.loadingIndicatorsElement.style.display="block":setTimeout(()=>{t()||(this.loadingIndicatorsElement.style.display="none")},3e3),M_(e,this.loadingIndicatorsElement)}_prepareContainer(){this.container.classList.add("genome-spy"),this.container.classList.add("loading"),this._glHelper=new rae(this.container,()=>this.viewRoot?ede(this.viewRoot):{width:void 0,height:void 0},this.spec.background);const e=()=>{this._glHelper.invalidateSize(),i(window.devicePixelRatio),this.computeLayout(),this.renderAll()},t=new ResizeObserver(e);t.observe(this.container),this._destructionCallbacks.push(()=>t.disconnect());const i=this._paramBroker.allocateSetter("devicePixelRatio");i(window.devicePixelRatio);let s=null;const o=()=>{s!=null&&(s(),e());const r=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",o),s=()=>{r.removeEventListener("change",o)}};o(),s&&this._destructionCallbacks.push(s),this.loadingMessageElement=document.createElement("div"),this.loadingMessageElement.className="loading-message",this.loadingMessageElement.innerHTML='
Loading...
',this.container.appendChild(this.loadingMessageElement),this.loadingIndicatorsElement=document.createElement("div"),this.loadingIndicatorsElement.className="loading-indicators",this.container.appendChild(this.loadingIndicatorsElement),this.tooltip=new tee(this.container),this.loadingMessageElement.querySelector(".message").addEventListener("transitionend",()=>{this.loadingMessageElement.style.display="none"})}destroy(){this.container.classList.remove("genome-spy"),this.container.classList.remove("loading");for(const[e,t]of this._keyboardListeners)for(const i of t)document.removeEventListener(e,i);for(this._destructionCallbacks.forEach(e=>e()),this._glHelper.finalize();this.container.firstChild;)this.container.firstChild.remove()}async _prepareViewsAndData(){this.spec.genome&&(this.genomeStore=new ade(this.spec.baseUrl),await this.genomeStore.initialize(this.spec.genome));const e=this,t={dataFlow:new Pz,accessorFactory:this.accessorFactory,glHelper:this._glHelper,animator:this.animator,genomeStore:this.genomeStore,fontManager:new dde(this._glHelper),get devicePixelRatio(){return e._glHelper.dpr},paramBroker:this._paramBroker,requestLayoutReflow:()=>{},updateTooltip:this.updateTooltip.bind(this),getNamedDataFromProvider:this.getNamedDataFromProvider.bind(this),getCurrentHover:()=>this._currentHover,setDataLoadingStatus:(l,c)=>{this._loadingViews.set(l,c),this._updateLoadingIndicators()},addKeyboardListener:(l,c)=>{document.addEventListener(l,c);let d=this._keyboardListeners.get(l);d||(d=[],this._keyboardListeners.set(l,d)),d.push(c)},addBroadcastListener(l,c){const d=e._extraBroadcastListeners;let u=d.get(l);u||(u=new Set,d.set(l,u)),u.add(c)},removeBroadcastListener(l,c){var u;(u=e._extraBroadcastListeners.get(l))==null||u.delete(c)},isViewConfiguredVisible:e.viewVisibilityPredicate,isViewSpec:l=>e.viewFactory.isViewSpec(l),createView:function(l,c,d,u){return e.viewFactory.createView(l,t,c,d,u)},createOrImportView:async function(l,c,d,u,h){return e.viewFactory.createOrImportView(l,t,c,d,u,h)}},i=this.spec;i.datasets&&this.registerNamedDataProvider(l=>i.datasets[l]),this.viewRoot=await t.createOrImportView(i,null,null,Gz),Xce(this.viewRoot),Qce(this.viewRoot);const s=this.viewRoot.getDescendants();s.forEach(l=>l.configureViewOpacity()),this._glHelper.invalidateSize();const o=s.filter(l=>l instanceof Oo),r=jce(this.viewRoot,t.dataFlow);Zce(r),this.broadcast("dataFlowBuilt",r),o.forEach(l=>l.mark.initializeEncoders());const a=Promise.all(o.map(l=>l.mark.initializeGraphics()));for(const l of o)r.addObserver(c=>{l.mark.initializeData(),l.mark.updateGraphicsData()},l);await t.fontManager.waitUntilReady(),r.initialize(),await Promise.all(r.dataSources.map(l=>l.load())),sI(this.viewRoot),this.broadcast("dataLoaded"),await a,this.viewRoot.visit(l=>{for(const c of Object.values(l.resolutions.scale))this._glHelper.createRangeTexture(c)});for(const l of o)l.mark.finalizeGraphicsInitialization();t.requestLayoutReflow=this.computeLayout.bind(this),this.viewRoot.visit(l=>Ly(l,"size")),this._glHelper.invalidateSize()}async launch(){try{return this._prepareContainer(),await this._prepareViewsAndData(),this.registerMouseEvents(),this.computeLayout(),this.animator.requestRender(),!0}catch(e){const t=`${e.view?`At "${e.view.getPathString()}": `:""}${e.toString()}`;return console.error(e.stack),Zde(this.container,t),!1}finally{this.container.classList.remove("loading"),window.setTimeout(()=>{this.loadingMessageElement.style.display="none"},2e3)}}registerMouseEvents(){const e=this._glHelper.canvas,t=i=>{var s;if(i instanceof MouseEvent){i.type=="mousemove"&&(this.tooltip.handleMouseMove(i),this._tooltipUpdateRequested=!1,i.buttons==0&&this.renderPickingFramebuffer());const o=e.getBoundingClientRect(),r=new nde(i.clientX-o.left-e.clientLeft,i.clientY-o.top-e.clientTop),a=l=>{this.viewRoot.propagateInteractionEvent(new ide(r,l)),this._tooltipUpdateRequested||this.tooltip.clear()};if(i.type!="wheel"&&this._wheelInertia.cancel(),i.type=="mousemove")this._handlePicking(r.x,r.y);else if(i.type=="mousedown"||i.type=="mouseup")this.renderPickingFramebuffer();else if(i.type=="wheel"){this._tooltipUpdateRequested=!1;const l=i;if(Math.abs(l.deltaX)>Math.abs(l.deltaY))this._currentHover=null,this._wheelInertia.cancel();else{const c=pde(l);this._wheelInertia.setMomentum(l.deltaY*(l.deltaMode?80:1),d=>{const u=new WheelEvent("wheel",{...c,deltaMode:0,deltaX:0,deltaY:d});a(u)}),l.preventDefault();return}}if(i.type=="click"){const l=this._currentHover?{type:i.type,viewPath:this._currentHover.mark.unitView.getLayoutAncestors().map(c=>c.name).reverse(),datum:this._currentHover.datum}:{type:i.type,viewPath:null,datum:null};(s=this._eventListeners.get("click"))==null||s.forEach(c=>c(l))}a(i)}};["mousedown","mouseup","wheel","click","mousemove","gesturechange","contextmenu"].forEach(i=>e.addEventListener(i,t)),e.addEventListener("mousedown",()=>{document.addEventListener("mouseup",()=>this.tooltip.popEnabledState(),{once:!0}),this.tooltip.pushEnabledState(!1)}),e.addEventListener("dragstart",i=>i.stopPropagation())}_handlePicking(e,t){var o;const i=this._glHelper.readPickingPixel(e,t),s=i[0]|i[1]<<8|i[2]<<16;if(s==0){this._currentHover=null;return}if(s!==((o=this._currentHover)==null?void 0:o.uniqueId)&&(this._currentHover=null),this._currentHover||this.viewRoot.visit(r=>{if(r instanceof Oo){if(r.mark.isPickingParticipant()){const a=r.mark.encoders.uniqueId.accessor;r.getCollector().visitData(l=>{a(l)==s&&(this._currentHover={mark:r.mark,datum:l,uniqueId:s})})}if(this._currentHover)return s_}}),this._currentHover){const r=this._currentHover.mark;this.updateTooltip(this._currentHover.datum,async a=>{if(!r.isPickingParticipant())return;const l=r.properties.tooltip;if(l!==null){const c=(l==null?void 0:l.handler)??"default",d=this.tooltipHandlers[c];if(!d)throw new Error("No such tooltip handler: "+c);return d(a,r,l==null?void 0:l.params)}})}}updateTooltip(e,t){if(!this._tooltipUpdateRequested||!e)this.tooltip.updateWithDatum(e,t),this._tooltipUpdateRequested=!0;else throw new Error("Tooltip has already been updated! Duplicate event handler?")}computeLayout(){const e=this.viewRoot;if(!e)return;this.broadcast("layout");const t=this._glHelper.getLogicalCanvasSize();if(isNaN(t.width)||isNaN(t.height)){console.log(`NaN in canvas size: ${t.width}x${t.height}. Skipping computeLayout().`);return}this._renderingContext=new PO({picking:!1},this._glHelper),this._pickingContext=new PO({picking:!0},this._glHelper),e.render(new tde(this._renderingContext,this._pickingContext),ql.create(0,0,t.width,t.height)),this.broadcast("layoutComputed")}renderAll(){var e;(e=this._renderingContext)==null||e.render(),this._dirtyPickingBuffer=!0}renderPickingFramebuffer(){this._dirtyPickingBuffer&&(this._pickingContext.render(),this._dirtyPickingBuffer=!1)}getSearchableViews(){const e=[];return this.viewRoot.visit(t=>{t instanceof Oo&&t.getAccessor("search")&&e.push(t)}),e}getNamedScaleResolutions(){const e=new Map;return this.viewRoot.visit(t=>{for(const i of Object.values(t.resolutions.scale))i.name&&e.set(i.name,i)}),e}}function Zde(n,e){const t=document.createElement("div");t.className="message-box";const i=document.createElement("div");i.textContent=e,t.appendChild(i),n.appendChild(t)}const Xde="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e";async function Qde(n,e,t={}){let i;if(Di(n)){if(i=document.querySelector(n),!i)throw new Error(`No such element: ${n}`)}else if(n instanceof HTMLElement)i=n;else throw new Error(`Invalid element: ${n}`);let s;try{const o=Lo(e)?e:await eue(e);if(o.baseUrl??(o.baseUrl=""),o.width??(o.width="container"),o.padding??(o.padding=10),i==document.body){const r=document.createElement("div");r.style.position="fixed",r.style.inset="0",r.style.overflow="hidden",i.appendChild(r),i=r}s=new Yde(i,o,t),Jde(s,t),await s.launch()}catch(o){i.innerText=o.toString(),console.error(o)}return{finalize(){for(s.destroy();i.firstChild;)i.firstChild.remove()},addEventListener(o,r){const a=s._eventListeners;let l=a.get(o);l||(l=new Set,a.set(o,l)),l.add(r)},removeEventListener(o,r){var l;(l=s._eventListeners.get(o))==null||l.delete(r)},getScaleResolutionByName(o){return s.getNamedScaleResolutions().get(o)},updateNamedData:s.updateNamedData.bind(s)}}function Jde(n,e){e.namedDataProvider&&n.registerNamedDataProvider(e.namedDataProvider)}async function eue(n){let e;try{e=JSON.parse(await Ox().load(n))}catch(t){throw new Error(`Could not load or parse configuration: ${n}, reason: ${t.message}`)}if(!e.baseUrl){const t=n.match(/^[^?#]*\//);e.baseUrl=t&&t[0]||"./"}return e}const tue=`{ +
`)}}t()?this.loadingIndicatorsElement.style.display="block":setTimeout(()=>{t()||(this.loadingIndicatorsElement.style.display="none")},3e3),Rp(e,this.loadingIndicatorsElement)}_prepareContainer(){this.container.classList.add("genome-spy"),this.container.classList.add("loading"),this._glHelper=new rae(this.container,()=>this.viewRoot?wde(this.viewRoot):{width:void 0,height:void 0},this.spec.background);const e=()=>{this._glHelper.invalidateSize(),i(window.devicePixelRatio),this.computeLayout(),this.renderAll()},t=new ResizeObserver(e);t.observe(this.container),this._destructionCallbacks.push(()=>t.disconnect());const i=this._paramBroker.allocateSetter("devicePixelRatio");i(window.devicePixelRatio);let s=null;const o=()=>{s!=null&&(s(),e());const r=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",o),s=()=>{r.removeEventListener("change",o)}};o(),s&&this._destructionCallbacks.push(s),this.loadingMessageElement=document.createElement("div"),this.loadingMessageElement.className="loading-message",this.loadingMessageElement.innerHTML='
Loading...
',this.container.appendChild(this.loadingMessageElement),this.loadingIndicatorsElement=document.createElement("div"),this.loadingIndicatorsElement.className="loading-indicators",this.container.appendChild(this.loadingIndicatorsElement),this.tooltip=new bee(this.container),this.loadingMessageElement.querySelector(".message").addEventListener("transitionend",()=>{this.loadingMessageElement.style.display="none"})}destroy(){this.container.classList.remove("genome-spy"),this.container.classList.remove("loading");for(const[e,t]of this._keyboardListeners)for(const i of t)document.removeEventListener(e,i);for(this._destructionCallbacks.forEach(e=>e()),this._glHelper.finalize();this.container.firstChild;)this.container.firstChild.remove()}async _prepareViewsAndData(){this.spec.genome&&(this.genomeStore=new kde(this.spec.baseUrl),await this.genomeStore.initialize(this.spec.genome));const e=this,t={dataFlow:new Xz,accessorFactory:this.accessorFactory,glHelper:this._glHelper,animator:this.animator,genomeStore:this.genomeStore,fontManager:new Ade(this._glHelper),get devicePixelRatio(){return e._glHelper.dpr},paramBroker:this._paramBroker,requestLayoutReflow:()=>{},updateTooltip:this.updateTooltip.bind(this),getNamedDataFromProvider:this.getNamedDataFromProvider.bind(this),getCurrentHover:()=>this._currentHover,setDataLoadingStatus:(l,c)=>{this._loadingViews.set(l,c),this._updateLoadingIndicators()},addKeyboardListener:(l,c)=>{document.addEventListener(l,c);let d=this._keyboardListeners.get(l);d||(d=[],this._keyboardListeners.set(l,d)),d.push(c)},addBroadcastListener(l,c){const d=e._extraBroadcastListeners;let u=d.get(l);u||(u=new Set,d.set(l,u)),u.add(c)},removeBroadcastListener(l,c){var u;(u=e._extraBroadcastListeners.get(l))==null||u.delete(c)},isViewConfiguredVisible:e.viewVisibilityPredicate,isViewSpec:l=>e.viewFactory.isViewSpec(l),createView:function(l,c,d,u){return e.viewFactory.createView(l,t,c,d,u)},createOrImportView:async function(l,c,d,u,h){return e.viewFactory.createOrImportView(l,t,c,d,u,h)}},i=this.spec;i.datasets&&this.registerNamedDataProvider(l=>i.datasets[l]),this.viewRoot=await t.createOrImportView(i,null,null,c$),_de(this.viewRoot),bde(this.viewRoot);const s=this.viewRoot.getDescendants();s.forEach(l=>l.configureViewOpacity()),this._glHelper.invalidateSize();const o=s.filter(l=>l instanceof Po),r=ude(this.viewRoot,t.dataFlow);mde(r),this.broadcast("dataFlowBuilt",r),o.forEach(l=>l.mark.initializeEncoders());const a=Promise.all(o.map(l=>l.mark.initializeGraphics()));for(const l of o)r.addObserver(c=>{l.mark.initializeData(),l.mark.updateGraphicsData()},l);await t.fontManager.waitUntilReady(),r.initialize(),await Promise.all(r.dataSources.map(l=>l.load())),gI(this.viewRoot),this.broadcast("dataLoaded"),await a;for(const l of o)l.mark.finalizeGraphicsInitialization();t.requestLayoutReflow=this.computeLayout.bind(this),this.viewRoot.visit(l=>Ny(l,"size")),this._glHelper.invalidateSize()}async launch(){try{return this._prepareContainer(),await this._prepareViewsAndData(),this.registerMouseEvents(),this.computeLayout(),this.animator.requestRender(),!0}catch(e){const t=`${e.view?`At "${e.view.getPathString()}": `:""}${e.toString()}`;return console.error(e.stack),mue(this.container,t),!1}finally{this.container.classList.remove("loading"),window.setTimeout(()=>{this.loadingMessageElement.style.display="none"},2e3)}}registerMouseEvents(){const e=this._glHelper.canvas,t=i=>{var s;if(i instanceof MouseEvent){i.type=="mousemove"&&(this.tooltip.handleMouseMove(i),this._tooltipUpdateRequested=!1,i.buttons==0&&this.renderPickingFramebuffer());const o=e.getBoundingClientRect(),r=new Sde(i.clientX-o.left-e.clientLeft,i.clientY-o.top-e.clientTop),a=l=>{this.viewRoot.propagateInteractionEvent(new Cde(r,l)),this._tooltipUpdateRequested||this.tooltip.clear()};if(i.type!="wheel"&&this._wheelInertia.cancel(),i.type=="mousemove")this._handlePicking(r.x,r.y);else if(i.type=="mousedown"||i.type=="mouseup")this.renderPickingFramebuffer();else if(i.type=="wheel"){this._tooltipUpdateRequested=!1;const l=i;if(Math.abs(l.deltaX)>Math.abs(l.deltaY))this._currentHover=null,this._wheelInertia.cancel();else{const c=Pde(l);this._wheelInertia.setMomentum(l.deltaY*(l.deltaMode?80:1),d=>{const u=new WheelEvent("wheel",{...c,deltaMode:0,deltaX:0,deltaY:d});a(u)}),l.preventDefault();return}}if(i.type=="click"){const l=this._currentHover?{type:i.type,viewPath:this._currentHover.mark.unitView.getLayoutAncestors().map(c=>c.name).reverse(),datum:this._currentHover.datum}:{type:i.type,viewPath:null,datum:null};(s=this._eventListeners.get("click"))==null||s.forEach(c=>c(l))}a(i)}};["mousedown","mouseup","wheel","click","mousemove","gesturechange","contextmenu"].forEach(i=>e.addEventListener(i,t)),e.addEventListener("mousedown",()=>{document.addEventListener("mouseup",()=>this.tooltip.popEnabledState(),{once:!0}),this.tooltip.pushEnabledState(!1)}),e.addEventListener("dragstart",i=>i.stopPropagation())}_handlePicking(e,t){var o;const i=this._glHelper.readPickingPixel(e,t),s=i[0]|i[1]<<8|i[2]<<16;if(s==0){this._currentHover=null;return}if(s!==((o=this._currentHover)==null?void 0:o.uniqueId)&&(this._currentHover=null),this._currentHover||this.viewRoot.visit(r=>{if(r instanceof Po){if(r.mark.isPickingParticipant()){const a=r.mark.encoders.uniqueId.accessor;r.getCollector().visitData(l=>{a(l)==s&&(this._currentHover={mark:r.mark,datum:l,uniqueId:s})})}if(this._currentHover)return r_}}),this._currentHover){const r=this._currentHover.mark;this.updateTooltip(this._currentHover.datum,async a=>{if(!r.isPickingParticipant())return;const l=r.properties.tooltip;if(l!==null){const c=(l==null?void 0:l.handler)??"default",d=this.tooltipHandlers[c];if(!d)throw new Error("No such tooltip handler: "+c);return d(a,r,l==null?void 0:l.params)}})}}updateTooltip(e,t){if(!this._tooltipUpdateRequested||!e)this.tooltip.updateWithDatum(e,t),this._tooltipUpdateRequested=!0;else throw new Error("Tooltip has already been updated! Duplicate event handler?")}computeLayout(){const e=this.viewRoot;if(!e)return;this.broadcast("layout");const t=this._glHelper.getLogicalCanvasSize();if(isNaN(t.width)||isNaN(t.height)){console.log(`NaN in canvas size: ${t.width}x${t.height}. Skipping computeLayout().`);return}this._renderingContext=new KO({picking:!1},this._glHelper),this._pickingContext=new KO({picking:!0},this._glHelper),e.render(new yde(this._renderingContext,this._pickingContext),Yl.create(0,0,t.width,t.height)),this.broadcast("layoutComputed")}renderAll(){var e;(e=this._renderingContext)==null||e.render(),this._dirtyPickingBuffer=!0}renderPickingFramebuffer(){this._dirtyPickingBuffer&&(this._pickingContext.render(),this._dirtyPickingBuffer=!1)}getSearchableViews(){const e=[];return this.viewRoot.visit(t=>{t instanceof Po&&t.getAccessor("search")&&e.push(t)}),e}getNamedScaleResolutions(){const e=new Map;return this.viewRoot.visit(t=>{for(const i of Object.values(t.resolutions.scale))i.name&&e.set(i.name,i)}),e}}Ix=new WeakSet,u$=function(){const e=[];for(const t of this.spec.params??[]){const{name:i,value:s,bind:o}=t,r=this._paramBroker.allocateSetter(i);if(s!=null&&r(s),o&&"input"in o){const a=o.debounce?lb(r,o.debounce,!1):r;if(o.input=="range")e.push(zt``);else if(o.input=="checkbox")e.push(zt``);else if(o.input=="radio")e.push(zt`${o.name??i} + ${o.options.map((l,c)=>{var d;return zt``})}`);else if(o.input=="select")e.push(zt``);else throw new Error("Unsupported input type: "+o.input)}}if(e.length){const t=document.createElement("div");this.container.appendChild(t),t.style="position: absolute; bottom: 10px; right: 10px; background: rgba(255, 255, 255, 0.8); padding: 10px; z-index: 1; border: 1px solid lightgray",Rp(zt`${e.map(i=>zt`
${i}
`)}`,t)}};function mue(n,e){const t=document.createElement("div");t.className="message-box";const i=document.createElement("div");i.textContent=e,t.appendChild(i),n.appendChild(t)}const _ue="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e";async function bue(n,e,t={}){let i;if(Ei(n)){if(i=document.querySelector(n),!i)throw new Error(`No such element: ${n}`)}else if(n instanceof HTMLElement)i=n;else throw new Error(`Invalid element: ${n}`);let s;try{const o=xo(e)?e:await wue(e);if(o.baseUrl??(o.baseUrl=""),o.width??(o.width="container"),o.padding??(o.padding=10),i==document.body){const r=document.createElement("div");r.style.position="fixed",r.style.inset="0",r.style.overflow="hidden",i.appendChild(r),i=r}s=new pue(i,o,t),vue(s,t),await s.launch()}catch(o){i.innerText=o.toString(),console.error(o)}return{finalize(){for(s.destroy();i.firstChild;)i.firstChild.remove()},addEventListener(o,r){const a=s._eventListeners;let l=a.get(o);l||(l=new Set,a.set(o,l)),l.add(r)},removeEventListener(o,r){var l;(l=s._eventListeners.get(o))==null||l.delete(r)},getScaleResolutionByName(o){return s.getNamedScaleResolutions().get(o)},updateNamedData:s.updateNamedData.bind(s)}}function vue(n,e){e.namedDataProvider&&n.registerNamedDataProvider(e.namedDataProvider)}async function wue(n){let e;try{e=JSON.parse(await $x().load(n))}catch(t){throw new Error(`Could not load or parse configuration: ${n}, reason: ${t.message}`)}if(!e.baseUrl){const t=n.match(/^[^?#]*\//);e.baseUrl=t&&t[0]||"./"}return e}const yue=`{ "data": { "sequence": { "start": 0, "stop": 60, "as": "x" } }, @@ -2554,39 +2601,39 @@ Reason: ${a.message}`)}));if(t.isViewSpec(o))return o.baseUrl=(r=s.match(/^[^?#] } } } -`;function Io(n,e=0){return n[n.length-(1+e)]}function iue(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Ki(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function sue(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function*Zz(n,e){let t,i;for(const s of n)i!==void 0&&e(i,s)?t.push(s):(t&&(yield t),t=[s]),i=s;t&&(yield t)}function Xz(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function oue(n,e){for(let t=0;t!!e)}function $O(n){let e=0;for(let t=0;t0}function Qh(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function Qz(n,e){return n.length>0?n[0]:e}function ts(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function gL(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function Sk(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function cw(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function fI(n,e){for(const t of e)n.push(t)}function Jz(n){return Array.isArray(n)?n:[n]}function aue(n,e,t){const i=e$(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(ab||(ab={}));function cr(n,e){return(t,i)=>e(n(t),n(i))}function lue(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!ab.isNeitherLessOrGreaterThan(s))return s}return ab.neitherLessOrGreaterThan}}const ld=(n,e)=>n-e,cue=(n,e)=>ld(n?1:0,e?1:0);function t$(n){return(e,t)=>-n(e,t)}class sc{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=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 za{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new za(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new za(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(s=>((i||ab.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}za.empty=new za(n=>{});function Ms(n){return typeof n=="string"}function Ds(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function due(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Fd(n){return typeof n=="number"&&!isNaN(n)}function jO(n){return!!n&&typeof n[Symbol.iterator]=="function"}function i$(n){return n===!0||n===!1}function Us(n){return typeof n>"u"}function VC(n){return!go(n)}function go(n){return Us(n)||n===null}function Ls(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function gI(n){if(go(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function HC(n){return typeof n=="function"}function uue(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?yl(i):i}),e}function fue(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(n$.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!due(s)&&e.push(s)}}return n}const n$=Object.prototype.hasOwnProperty;function s$(n,e){return pI(n,e,new Set)}function pI(n,e,t){if(go(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(pI(o,e,t));return s}if(Ds(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)n$.call(n,o)&&(s[o]=pI(n[o],e,t));return t.delete(n),s}return n}function pL(n,e,t=!0){return Ds(n)?(Ds(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Ds(n[i])&&Ds(e[i])?pL(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function So(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},i={};for(const s of n)i[s]=t(s);return i}let mue=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function _ue(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),mue&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return _ue(e,t)}var xk;const wg="en";let zC=!1,$C=!1,Iy=!1,o$=!1,zR=!1,$R=!1,r$=!1,dw,Lk=wg,qO=wg,bue,Ar;const dr=typeof self=="object"?self:typeof globalThis=="object"?globalThis:{};let is;typeof dr.vscode<"u"&&typeof dr.vscode.process<"u"?is=dr.vscode.process:typeof process<"u"&&(is=process);const vue=typeof((xk=is==null?void 0:is.versions)===null||xk===void 0?void 0:xk.electron)=="string",wue=vue&&(is==null?void 0:is.type)==="renderer";if(typeof navigator=="object"&&!wue)Ar=navigator.userAgent,zC=Ar.indexOf("Windows")>=0,$C=Ar.indexOf("Macintosh")>=0,$R=(Ar.indexOf("Macintosh")>=0||Ar.indexOf("iPad")>=0||Ar.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Iy=Ar.indexOf("Linux")>=0,r$=(Ar==null?void 0:Ar.indexOf("Mobi"))>=0,zR=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),dw=wg,Lk=dw,qO=navigator.language;else if(typeof is=="object"){zC=is.platform==="win32",$C=is.platform==="darwin",Iy=is.platform==="linux",Iy&&is.env.SNAP&&is.env.SNAP_REVISION,is.env.CI||is.env.BUILD_ARTIFACTSTAGINGDIRECTORY,dw=wg,Lk=wg;const n=is.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];dw=e.locale,qO=e.osLocale,Lk=t||wg,bue=e._translationsConfigFile}catch{}o$=!0}else console.error("Unable to resolve platform.");const Rs=zC,gt=$C,Zn=Iy,Yg=o$,Em=zR,yue=zR&&typeof dr.importScripts=="function",Bd=$R,Cue=r$,ja=Ar,Sue=typeof dr.postMessage=="function"&&!dr.importScripts,a$=(()=>{if(Sue){const n=[];dr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),dr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),bo=$C||$R?2:zC?1:3;let GO=!0,KO=!1;function xue(){if(!KO){KO=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,GO=new Uint16Array(n.buffer)[0]===512+1}return GO}const l$=!!(ja&&ja.indexOf("Chrome")>=0),Lue=!!(ja&&ja.indexOf("Firefox")>=0),Due=!!(!l$&&ja&&ja.indexOf("Safari")>=0),kue=!!(ja&&ja.indexOf("Edg/")>=0);ja&&ja.indexOf("Android")>=0;const An={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var dt;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(b){yield b}n.single=s;function o(b){return e(b)?b:s(b)}n.wrap=o;function r(b){return b||t}n.from=r;function*a(b){for(let w=b.length-1;w>=0;w--)yield b[w]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function d(b,w){for(const y of b)if(w(y))return!0;return!1}n.some=d;function u(b,w){for(const y of b)if(w(y))return y}n.find=u;function*h(b,w){for(const y of b)w(y)&&(yield y)}n.filter=h;function*f(b,w){let y=0;for(const S of b)yield w(S,y++)}n.map=f;function*g(...b){for(const w of b)for(const y of w)yield y}n.concat=g;function p(b,w,y){let S=y;for(const L of b)S=w(S,L);return S}n.reduce=p;function*_(b,w,y=b.length){for(w<0&&(w+=b.length),y<0?y+=b.length:y>b.length&&(y=b.length);w{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Ii.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ii.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ii.Undefined&&e.next!==Ii.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ii.Undefined&&e.next===Ii.Undefined?(this._first=Ii.Undefined,this._last=Ii.Undefined):e.next===Ii.Undefined?(this._last=this._last.prev,this._last.next=Ii.Undefined):e.prev===Ii.Undefined&&(this._first=this._first.next,this._first.prev=Ii.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ii.Undefined;)yield e.element,e=e.next}}const c$="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Eue(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of c$)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const UR=Eue();function d$(n){let e=UR;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const u$=new ks;u$.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function lb(n,e,t,i,s){if(s||(s=dt.first(u$)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),lb(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=Iue(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Iue(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Dc=8;class h${constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class f${constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Kt{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return mL(e,t)}compute(e,t,i){return i}}class o_{constructor(e,t){this.newValue=e,this.didChange=t}}function mL(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new o_(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Ki(n,e);return new o_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=mL(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new o_(n,t)}class c1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return mL(e,t)}validate(e){return this.defaultValue}}class Im{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return mL(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function be(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class st extends Im{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return be(e,this.defaultValue)}}function Ru(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class kt extends Im{static clampedInt(e,t,i,s){return Ru(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return kt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Aue(n,e,t,i){if(typeof n>"u")return e;const s=sr.float(n,e);return sr.clamp(s,t,i)}class sr extends Im{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}validate(e){return this.validationFn(sr.float(e,this.defaultValue))}}class Hs extends Im{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Hs.string(e,this.defaultValue)}}function wi(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ti extends Im{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return wi(e,this.defaultValue,this._allowedValues)}}class uw extends Kt{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Tue(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Nue extends Kt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),m("accessibilitySupport.on","Optimize for usage with a Screen Reader"),m("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:m("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class Mue extends Kt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:be(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:be(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Rue(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var fn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(fn||(fn={}));function Pue(n){switch(n){case"line":return fn.Line;case"block":return fn.Block;case"underline":return fn.Underline;case"line-thin":return fn.LineThin;case"block-outline":return fn.BlockOutline;case"underline-thin":return fn.UnderlineThin}}class Oue extends c1{constructor(){super(140)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(73)==="default"?s.push("mouse-default"):t.get(73)==="copy"&&s.push("mouse-copy"),t.get(110)&&s.push("showUnused"),t.get(138)&&s.push("showDeprecated"),s.join(" ")}}class Fue extends st{constructor(){super(37,"emptySelectionClipboard",!0,{description:m("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Bue extends Kt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),m("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),m("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:m("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),m("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),m("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:gt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:be(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":wi(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":wi(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:be(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:be(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:be(t.loop,this.defaultValue.loop)}}}class Mo extends Kt{constructor(){super(51,"fontLigatures",Mo.OFF,{anyOf:[{type:"boolean",description:m("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Mo.OFF:e==="true"?Mo.ON:e:e?Mo.ON:Mo.OFF}}Mo.OFF='"liga" off, "calt" off';Mo.ON='"liga" on, "calt" on';class $r extends Kt{constructor(){super(54,"fontVariations",$r.OFF,{anyOf:[{type:"boolean",description:m("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?$r.OFF:e==="true"?$r.TRANSLATE:e:e?$r.TRANSLATE:$r.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}$r.OFF="normal";$r.TRANSLATE="translate";class Wue extends c1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class Vue extends Im{constructor(){super(52,"fontSize",Wo.fontSize,{type:"number",minimum:6,maximum:100,default:Wo.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=sr.float(e,this.defaultValue);return t===0?Wo.fontSize:sr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Ca extends Kt{constructor(){super(53,"fontWeight",Wo.fontWeight,{anyOf:[{type:"number",minimum:Ca.MINIMUM_VALUE,maximum:Ca.MAXIMUM_VALUE,errorMessage:m("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ca.SUGGESTION_VALUES}],default:Wo.fontWeight,description:m("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(kt.clampedInt(e,Wo.fontWeight,Ca.MINIMUM_VALUE,Ca.MAXIMUM_VALUE))}}Ca.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Ca.MINIMUM_VALUE=1;Ca.MAXIMUM_VALUE=1e3;class Hue extends Kt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),m("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),m("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:m("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:m("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:m("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:wi(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:wi(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:wi(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:wi(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:wi(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:wi(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Hs.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Hs.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Hs.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Hs.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Hs.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class zue extends Kt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:m("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),delay:kt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:be(t.sticky,this.defaultValue.sticky),hidingDelay:kt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:be(t.above,this.defaultValue.above)}}}class Zg extends c1{constructor(){super(143)}compute(e,t,i){return Zg.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,w=e.isViewportWrapping,y=u?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,D=!1,k=y*h,O=h/o,R=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:ge,extraLinesBeforeFirstLine:se,extraLinesBeyondLastLine:Se,desiredRatio:Ie,minimapLineCount:pe}=Zg.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/pe>1)x=!0,D=!0,h=1,k=1,O=h/o;else{let Gt=!1,xt=h+1;if(g==="fit"){const It=Math.ceil((se+v+Se)*k);w&&a&&b<=t.stableFitRemainingWidth?(Gt=!0,xt=t.stableFitMaxMinimapScale):Gt=It>S}if(g==="fill"||Gt){x=!0;const It=h;k=Math.min(l*o,Math.max(1,Math.floor(1/Ie))),w&&a&&b<=t.stableFitRemainingWidth&&(xt=t.stableFitMaxMinimapScale),h=Math.min(xt,Math.max(1,Math.floor(k/y))),h>It&&(R=Math.min(2,h/It)),O=h/o/R,S=Math.ceil(Math.max(ge,se+v+Se)*k),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*O),M=Math.min(P,Math.max(0,Math.floor((b-_-2)*O/(c+O)))+Dc);let $=Math.floor(o*M);const Y=$/o;$=Math.floor($*R);const ne=u?1:2,ce=p==="left"?0:i-M-_;return{renderMinimap:ne,minimapLeft:ce,minimapWidth:M,minimapHeightIsEditorHeight:x,minimapIsSampling:D,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:$,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:Y,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,_=e.get(57),v=e.get(67).renderType!==0,b=e.get(68),w=e.get(104),y=e.get(83),S=e.get(72),L=e.get(102),x=L.verticalScrollbarSize,D=L.verticalHasArrows,k=L.arrowSize,O=L.horizontalScrollbarSize,R=e.get(43),P=e.get(109)!=="never";let M=e.get(65);R&&P&&(M+=16);let $=0;if(v){const ei=Math.max(r,b);$=Math.round(ei*l)}let Y=0;_&&(Y=o*t.glyphMarginDecorationLaneCount);let ne=0,ce=ne+Y,ge=ce+$,se=ge+M;const Se=i-Y-$-M;let Ie=!1,pe=!1,ee=-1;h==="inherit"&&p?(Ie=!0,pe=!0):f==="on"||f==="bounded"?pe=!0:f==="wordWrapColumn"&&(ee=g);const Gt=Zg._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:y.top,paddingBottom:y.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Se,isViewportWrapping:pe},t.memory||new f$);Gt.renderMinimap!==0&&Gt.minimapLeft===0&&(ne+=Gt.minimapWidth,ce+=Gt.minimapWidth,ge+=Gt.minimapWidth,se+=Gt.minimapWidth);const xt=Se-Gt.minimapWidth,It=Math.max(1,Math.floor((xt-x-2)/a)),je=D?k:0;return pe&&(ee=Math.max(1,It),f==="bounded"&&(ee=Math.min(ee,g))),{width:i,height:s,glyphMarginLeft:ne,glyphMarginWidth:Y,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:ce,lineNumbersWidth:$,decorationsLeft:ge,decorationsWidth:M,contentLeft:se,contentWidth:xt,minimap:Gt,viewportColumn:It,isWordWrapMinified:Ie,isViewportWrapping:pe,wrappingColumn:ee,verticalScrollbarWidth:x,horizontalScrollbarHeight:O,overviewRuler:{top:je,width:x,height:s-2*je,right:0}}}}class $ue extends Kt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return wi(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class Uue extends Kt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:m("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:be(e.enabled,this.defaultValue.enabled)}}}class jue extends Kt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:m("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),maxLineCount:kt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:wi(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:be(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class que extends Kt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m("editor.inlayHints.on","Inlay hints are enabled"),m("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:wi(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:kt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Hs.string(t.fontFamily,this.defaultValue.fontFamily),padding:be(t.padding,this.defaultValue.padding)}}}class Gue extends Kt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):kt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?kt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Kue extends sr{constructor(){super(66,"lineHeight",Wo.lineHeight,e=>sr.clamp(e,0,150),{markdownDescription:m("lineHeight",`Controls the line height. +`;function ko(n,e=0){return n[n.length-(1+e)]}function Cue(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Ki(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function xue(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function*f$(n,e){let t,i;for(const s of n)i!==void 0&&e(i,s)?t.push(s):(t&&(yield t),t=[s]),i=s;t&&(yield t)}function g$(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function Lue(n,e){for(let t=0;t!!e)}function iF(n){let e=0;for(let t=0;t0}function Qh(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function p$(n,e){return n.length>0?n[0]:e}function es(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function CL(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function Ik(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function mw(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function SI(n,e){for(const t of e)n.push(t)}function m$(n){return Array.isArray(n)?n:[n]}function kue(n,e,t){const i=_$(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(cb||(cb={}));function cr(n,e){return(t,i)=>e(n(t),n(i))}function Eue(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!cb.isNeitherLessOrGreaterThan(s))return s}return cb.neitherLessOrGreaterThan}}const ud=(n,e)=>n-e,Iue=(n,e)=>ud(n?1:0,e?1:0);function b$(n){return(e,t)=>-n(e,t)}class ac{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=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 za{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new za(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new za(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(s=>((i||cb.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}za.empty=new za(n=>{});function Ns(n){return typeof n=="string"}function Ls(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Aue(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function zd(n){return typeof n=="number"&&!isNaN(n)}function sF(n){return!!n&&typeof n[Symbol.iterator]=="function"}function v$(n){return n===!0||n===!1}function $s(n){return typeof n>"u"}function UC(n){return!go(n)}function go(n){return $s(n)||n===null}function xs(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function xI(n){if(go(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function jC(n){return typeof n=="function"}function Tue(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?Cl(i):i}),e}function Mue(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(w$.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!Aue(s)&&e.push(s)}}return n}const w$=Object.prototype.hasOwnProperty;function y$(n,e){return LI(n,e,new Set)}function LI(n,e,t){if(go(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(LI(o,e,t));return s}if(Ls(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)w$.call(n,o)&&(s[o]=LI(n[o],e,t));return t.delete(n),s}return n}function SL(n,e,t=!0){return Ls(n)?(Ls(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Ls(n[i])&&Ls(e[i])?SL(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Co(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},i={};for(const s of n)i[s]=t(s);return i}let Oue=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Fue(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),Oue&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return Fue(e,t)}var Ak;const wg="en";let qC=!1,GC=!1,Oy=!1,C$=!1,JR=!1,e4=!1,S$=!1,_w,Tk=wg,oF=wg,Bue,Tr;const dr=typeof self=="object"?self:typeof globalThis=="object"?globalThis:{};let ts;typeof dr.vscode<"u"&&typeof dr.vscode.process<"u"?ts=dr.vscode.process:typeof process<"u"&&(ts=process);const Wue=typeof((Ak=ts==null?void 0:ts.versions)===null||Ak===void 0?void 0:Ak.electron)=="string",Vue=Wue&&(ts==null?void 0:ts.type)==="renderer";if(typeof navigator=="object"&&!Vue)Tr=navigator.userAgent,qC=Tr.indexOf("Windows")>=0,GC=Tr.indexOf("Macintosh")>=0,e4=(Tr.indexOf("Macintosh")>=0||Tr.indexOf("iPad")>=0||Tr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Oy=Tr.indexOf("Linux")>=0,S$=(Tr==null?void 0:Tr.indexOf("Mobi"))>=0,JR=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),_w=wg,Tk=_w,oF=navigator.language;else if(typeof ts=="object"){qC=ts.platform==="win32",GC=ts.platform==="darwin",Oy=ts.platform==="linux",Oy&&ts.env.SNAP&&ts.env.SNAP_REVISION,ts.env.CI||ts.env.BUILD_ARTIFACTSTAGINGDIRECTORY,_w=wg,Tk=wg;const n=ts.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];_w=e.locale,oF=e.osLocale,Tk=t||wg,Bue=e._translationsConfigFile}catch{}C$=!0}else console.error("Unable to resolve platform.");const Ms=qC,gt=GC,Zn=Oy,Zg=C$,Am=JR,Hue=JR&&typeof dr.importScripts=="function",$d=e4,zue=S$,ja=Tr,$ue=typeof dr.postMessage=="function"&&!dr.importScripts,x$=(()=>{if($ue){const n=[];dr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),dr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),_o=GC||e4?2:qC?1:3;let rF=!0,aF=!1;function Uue(){if(!aF){aF=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,rF=new Uint16Array(n.buffer)[0]===512+1}return rF}const L$=!!(ja&&ja.indexOf("Chrome")>=0),jue=!!(ja&&ja.indexOf("Firefox")>=0),que=!!(!L$&&ja&&ja.indexOf("Safari")>=0),Gue=!!(ja&&ja.indexOf("Edg/")>=0);ja&&ja.indexOf("Android")>=0;const An={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var dt;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(b){yield b}n.single=s;function o(b){return e(b)?b:s(b)}n.wrap=o;function r(b){return b||t}n.from=r;function*a(b){for(let w=b.length-1;w>=0;w--)yield b[w]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function d(b,w){for(const y of b)if(w(y))return!0;return!1}n.some=d;function u(b,w){for(const y of b)if(w(y))return y}n.find=u;function*h(b,w){for(const y of b)w(y)&&(yield y)}n.filter=h;function*f(b,w){let y=0;for(const S of b)yield w(S,y++)}n.map=f;function*g(...b){for(const w of b)for(const y of w)yield y}n.concat=g;function p(b,w,y){let S=y;for(const L of b)S=w(S,L);return S}n.reduce=p;function*_(b,w,y=b.length){for(w<0&&(w+=b.length),y<0?y+=b.length:y>b.length&&(y=b.length);w{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Ai.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ai.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ai.Undefined&&e.next!==Ai.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ai.Undefined&&e.next===Ai.Undefined?(this._first=Ai.Undefined,this._last=Ai.Undefined):e.next===Ai.Undefined?(this._last=this._last.prev,this._last.next=Ai.Undefined):e.prev===Ai.Undefined&&(this._first=this._first.next,this._first.prev=Ai.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ai.Undefined;)yield e.element,e=e.next}}const D$="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Kue(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of D$)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const t4=Kue();function k$(n){let e=t4;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const E$=new Ds;E$.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function db(n,e,t,i,s){if(s||(s=dt.first(E$)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),db(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=Yue(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Yue(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Ec=8;class I${constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class A${constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Yt{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return xL(e,t)}compute(e,t,i){return i}}class a_{constructor(e,t){this.newValue=e,this.didChange=t}}function xL(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new a_(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Ki(n,e);return new a_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=xL(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new a_(n,t)}class m1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return xL(e,t)}validate(e){return this.defaultValue}}class Tm{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return xL(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function ve(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class st extends Tm{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return ve(e,this.defaultValue)}}function Wu(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class kt extends Tm{static clampedInt(e,t,i,s){return Wu(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return kt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Zue(n,e,t,i){if(typeof n>"u")return e;const s=sr.float(n,e);return sr.clamp(s,t,i)}class sr extends Tm{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}validate(e){return this.validationFn(sr.float(e,this.defaultValue))}}class Vs extends Tm{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Vs.string(e,this.defaultValue)}}function Ci(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ii extends Tm{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Ci(e,this.defaultValue,this._allowedValues)}}class bw extends Yt{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Xue(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Que extends Yt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),m("accessibilitySupport.on","Optimize for usage with a Screen Reader"),m("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:m("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class Jue extends Yt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:ve(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ve(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function ehe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var fn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(fn||(fn={}));function the(n){switch(n){case"line":return fn.Line;case"block":return fn.Block;case"underline":return fn.Underline;case"line-thin":return fn.LineThin;case"block-outline":return fn.BlockOutline;case"underline-thin":return fn.UnderlineThin}}class ihe extends m1{constructor(){super(140)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(73)==="default"?s.push("mouse-default"):t.get(73)==="copy"&&s.push("mouse-copy"),t.get(110)&&s.push("showUnused"),t.get(138)&&s.push("showDeprecated"),s.join(" ")}}class nhe extends st{constructor(){super(37,"emptySelectionClipboard",!0,{description:m("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class she extends Yt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),m("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),m("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:m("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),m("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),m("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:gt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:ve(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ci(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ci(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ve(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ve(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ve(t.loop,this.defaultValue.loop)}}}class No extends Yt{constructor(){super(51,"fontLigatures",No.OFF,{anyOf:[{type:"boolean",description:m("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?No.OFF:e==="true"?No.ON:e:e?No.ON:No.OFF}}No.OFF='"liga" off, "calt" off';No.ON='"liga" on, "calt" on';class jr extends Yt{constructor(){super(54,"fontVariations",jr.OFF,{anyOf:[{type:"boolean",description:m("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?jr.OFF:e==="true"?jr.TRANSLATE:e:e?jr.TRANSLATE:jr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}jr.OFF="normal";jr.TRANSLATE="translate";class ohe extends m1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class rhe extends Tm{constructor(){super(52,"fontSize",Wo.fontSize,{type:"number",minimum:6,maximum:100,default:Wo.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=sr.float(e,this.defaultValue);return t===0?Wo.fontSize:sr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Ca extends Yt{constructor(){super(53,"fontWeight",Wo.fontWeight,{anyOf:[{type:"number",minimum:Ca.MINIMUM_VALUE,maximum:Ca.MAXIMUM_VALUE,errorMessage:m("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ca.SUGGESTION_VALUES}],default:Wo.fontWeight,description:m("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(kt.clampedInt(e,Wo.fontWeight,Ca.MINIMUM_VALUE,Ca.MAXIMUM_VALUE))}}Ca.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Ca.MINIMUM_VALUE=1;Ca.MAXIMUM_VALUE=1e3;class ahe extends Yt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),m("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),m("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:m("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:m("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:m("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ci(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ci(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ci(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:Ci(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Ci(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ci(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Vs.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Vs.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Vs.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Vs.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Vs.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class lhe extends Yt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:m("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),delay:kt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ve(t.sticky,this.defaultValue.sticky),hidingDelay:kt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ve(t.above,this.defaultValue.above)}}}class Xg extends m1{constructor(){super(143)}compute(e,t,i){return Xg.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,w=e.isViewportWrapping,y=u?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,D=!1,k=y*h,P=h/o,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:ge,extraLinesBeforeFirstLine:se,extraLinesBeyondLastLine:Se,desiredRatio:Ie,minimapLineCount:pe}=Xg.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/pe>1)x=!0,D=!0,h=1,k=1,P=h/o;else{let Kt=!1,xt=h+1;if(g==="fit"){const It=Math.ceil((se+v+Se)*k);w&&a&&b<=t.stableFitRemainingWidth?(Kt=!0,xt=t.stableFitMaxMinimapScale):Kt=It>S}if(g==="fill"||Kt){x=!0;const It=h;k=Math.min(l*o,Math.max(1,Math.floor(1/Ie))),w&&a&&b<=t.stableFitRemainingWidth&&(xt=t.stableFitMaxMinimapScale),h=Math.min(xt,Math.max(1,Math.floor(k/y))),h>It&&(O=Math.min(2,h/It)),P=h/o/O,S=Math.ceil(Math.max(ge,se+v+Se)*k),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const R=Math.floor(f*P),M=Math.min(R,Math.max(0,Math.floor((b-_-2)*P/(c+P)))+Ec);let W=Math.floor(o*M);const G=W/o;W=Math.floor(W*O);const ne=u?1:2,ce=p==="left"?0:i-M-_;return{renderMinimap:ne,minimapLeft:ce,minimapWidth:M,minimapHeightIsEditorHeight:x,minimapIsSampling:D,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:W,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:G,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,_=e.get(57),v=e.get(67).renderType!==0,b=e.get(68),w=e.get(104),y=e.get(83),S=e.get(72),L=e.get(102),x=L.verticalScrollbarSize,D=L.verticalHasArrows,k=L.arrowSize,P=L.horizontalScrollbarSize,O=e.get(43),R=e.get(109)!=="never";let M=e.get(65);O&&R&&(M+=16);let W=0;if(v){const ti=Math.max(r,b);W=Math.round(ti*l)}let G=0;_&&(G=o*t.glyphMarginDecorationLaneCount);let ne=0,ce=ne+G,ge=ce+W,se=ge+M;const Se=i-G-W-M;let Ie=!1,pe=!1,ee=-1;h==="inherit"&&p?(Ie=!0,pe=!0):f==="on"||f==="bounded"?pe=!0:f==="wordWrapColumn"&&(ee=g);const Kt=Xg._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:y.top,paddingBottom:y.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Se,isViewportWrapping:pe},t.memory||new A$);Kt.renderMinimap!==0&&Kt.minimapLeft===0&&(ne+=Kt.minimapWidth,ce+=Kt.minimapWidth,ge+=Kt.minimapWidth,se+=Kt.minimapWidth);const xt=Se-Kt.minimapWidth,It=Math.max(1,Math.floor((xt-x-2)/a)),Ge=D?k:0;return pe&&(ee=Math.max(1,It),f==="bounded"&&(ee=Math.min(ee,g))),{width:i,height:s,glyphMarginLeft:ne,glyphMarginWidth:G,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:ce,lineNumbersWidth:W,decorationsLeft:ge,decorationsWidth:M,contentLeft:se,contentWidth:xt,minimap:Kt,viewportColumn:It,isWordWrapMinified:Ie,isViewportWrapping:pe,wrappingColumn:ee,verticalScrollbarWidth:x,horizontalScrollbarHeight:P,overviewRuler:{top:Ge,width:x,height:s-2*Ge,right:0}}}}class che extends Yt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ci(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class dhe extends Yt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:m("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ve(e.enabled,this.defaultValue.enabled)}}}class uhe extends Yt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:m("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),maxLineCount:kt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ci(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ve(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class hhe extends Yt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m("editor.inlayHints.on","Inlay hints are enabled"),m("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ci(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:kt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Vs.string(t.fontFamily,this.defaultValue.fontFamily),padding:ve(t.padding,this.defaultValue.padding)}}}class fhe extends Yt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):kt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?kt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class ghe extends sr{constructor(){super(66,"lineHeight",Wo.lineHeight,e=>sr.clamp(e,0,150),{markdownDescription:m("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Yue extends Kt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("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:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),autohide:be(t.autohide,this.defaultValue.autohide),size:wi(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:wi(t.side,this.defaultValue.side,["right","left"]),showSlider:wi(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:be(t.renderCharacters,this.defaultValue.renderCharacters),scale:kt.clampedInt(t.scale,1,1,3),maxColumn:kt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Zue(n){return n==="ctrlCmd"?gt?"metaKey":"ctrlKey":"altKey"}class Xue extends Kt{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:kt.clampedInt(t.top,0,0,1e3),bottom:kt.clampedInt(t.bottom,0,0,1e3)}}}class Que extends Kt{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:m("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:m("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),cycle:be(t.cycle,this.defaultValue.cycle)}}}class Jue extends c1{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class ehe extends Kt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[m("on","Quick suggestions show inside the suggest widget"),m("inline","Quick suggestions show as ghost text"),m("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:m("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:m("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:m("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:m("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=wi(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=wi(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=wi(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class the extends Kt{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[m("lineNumbers.off","Line numbers are not rendered."),m("lineNumbers.on","Line numbers are rendered as absolute number."),m("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),m("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:m("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function UC(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class ihe extends Kt{constructor(){const e=[],t={type:"number",description:m("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:m("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:m("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:kt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:kt.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class nhe extends Kt{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function YO(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let she=class extends Kt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),m("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),m("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),m("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),m("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:m("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:m("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:m("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=kt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=kt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:kt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:YO(t.vertical,this.defaultValue.vertical),horizontal:YO(t.horizontal,this.defaultValue.horizontal),useShadows:be(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:be(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:be(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:be(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:be(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:kt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:kt.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:be(t.scrollByPage,this.defaultValue.scrollByPage)}}};const kr="inUntrustedWorkspace",Du={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class ohe extends Kt{constructor(){const e={nonBasicASCII:kr,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:kr,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Du.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kr],default:e.nonBasicASCII,description:m("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Du.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:m("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Du.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:m("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Du.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kr],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Du.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kr],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Du.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Du.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:m("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(So(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(So(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new o_(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Xg(t.nonBasicASCII,kr,[!0,!1,kr]),invisibleCharacters:be(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:be(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Xg(t.includeComments,kr,[!0,!1,kr]),includeStrings:Xg(t.includeStrings,kr,[!0,!1,kr]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,o]of Object.entries(e))o===!0&&(i[s]=!0);return i}}class rhe extends Kt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:m("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[m("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),m("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:m("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:m("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),mode:wi(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:wi(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:be(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:be(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class ahe extends Kt{constructor(){const e={enabled:An.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:An.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:m("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:be(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class lhe extends Kt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairs.true","Enables bracket pair guides."),m("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),m("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:m("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),m("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),m("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:m("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:m("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:m("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[m("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),m("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),m("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:m("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Xg(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Xg(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:be(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:be(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Xg(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Xg(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class che extends Kt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[m("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),m("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:m("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:m("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:m("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:m("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[m("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),m("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:m("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:m("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:m("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:m("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:m("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:m("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:m("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:m("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:wi(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:be(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:be(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:be(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:be(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:wi(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:be(t.showIcons,this.defaultValue.showIcons),showStatusBar:be(t.showStatusBar,this.defaultValue.showStatusBar),preview:be(t.preview,this.defaultValue.preview),previewMode:wi(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:be(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:be(t.showMethods,this.defaultValue.showMethods),showFunctions:be(t.showFunctions,this.defaultValue.showFunctions),showConstructors:be(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:be(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:be(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:be(t.showFields,this.defaultValue.showFields),showVariables:be(t.showVariables,this.defaultValue.showVariables),showClasses:be(t.showClasses,this.defaultValue.showClasses),showStructs:be(t.showStructs,this.defaultValue.showStructs),showInterfaces:be(t.showInterfaces,this.defaultValue.showInterfaces),showModules:be(t.showModules,this.defaultValue.showModules),showProperties:be(t.showProperties,this.defaultValue.showProperties),showEvents:be(t.showEvents,this.defaultValue.showEvents),showOperators:be(t.showOperators,this.defaultValue.showOperators),showUnits:be(t.showUnits,this.defaultValue.showUnits),showValues:be(t.showValues,this.defaultValue.showValues),showConstants:be(t.showConstants,this.defaultValue.showConstants),showEnums:be(t.showEnums,this.defaultValue.showEnums),showEnumMembers:be(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:be(t.showKeywords,this.defaultValue.showKeywords),showWords:be(t.showWords,this.defaultValue.showWords),showColors:be(t.showColors,this.defaultValue.showColors),showFiles:be(t.showFiles,this.defaultValue.showFiles),showReferences:be(t.showReferences,this.defaultValue.showReferences),showFolders:be(t.showFolders,this.defaultValue.showFolders),showTypeParameters:be(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:be(t.showSnippets,this.defaultValue.showSnippets),showUsers:be(t.showUsers,this.defaultValue.showUsers),showIssues:be(t.showIssues,this.defaultValue.showIssues)}}}class dhe extends Kt{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:m("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:m("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:be(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:be(e.selectSubwords,this.defaultValue.selectSubwords)}}}class uhe extends Kt{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[m("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),m("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),m("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),m("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:m("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class hhe extends c1{constructor(){super(144)}compute(e,t,i){const s=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class fhe extends Kt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:m("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[m("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),m("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),showDropSelector:wi(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class ghe extends Kt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:m("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[m("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),m("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),showPasteSelector:wi(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const phe="Consolas, 'Courier New', monospace",mhe="Menlo, Monaco, 'Courier New', monospace",_he="'Droid Sans Mono', 'monospace', monospace",Wo={fontFamily:gt?mhe:Zn?_he:phe,fontWeight:"normal",fontSize:gt?12:14,lineHeight:0,letterSpacing:0},yg=[];function Q(n){return yg[n.id]=n,n}const yf={acceptSuggestionOnCommitCharacter:Q(new st(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:m("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Q(new ti(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",m("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:m("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Q(new Nue),accessibilityPageSize:Q(new kt(3,"accessibilityPageSize",10,1,1073741824,{description:m("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Q(new Hs(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:Q(new st(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Q(new st(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Q(new ti(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),m("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:m("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Q(new ti(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),m("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:m("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Q(new ti(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Q(new ti(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Q(new ti(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),m("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:m("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Q(new uw(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Tue,{enumDescriptions:[m("editor.autoIndent.none","The editor will not insert indentation automatically."),m("editor.autoIndent.keep","The editor will keep the current line's indentation."),m("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),m("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),m("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:m("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Q(new st(13,"automaticLayout",!1)),autoSurround:Q(new ti(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[m("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),m("editor.autoSurround.quotes","Surround with quotes but not brackets."),m("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:m("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Q(new ahe),bracketPairGuides:Q(new lhe),stickyTabStops:Q(new st(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Q(new st(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Q(new Hs(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Q(new kt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:m("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Q(new st(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Q(new ti(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[m("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),m("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),m("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:m("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Q(new kt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:m("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Q(new st(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Q(new Mue),contextmenu:Q(new st(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Q(new st(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Q(new uw(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Rue,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Q(new ti(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[m("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),m("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),m("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:m("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Q(new uw(28,"cursorStyle",fn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Pue,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Q(new kt(29,"cursorSurroundingLines",0,0,1073741824,{description:m("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Q(new ti(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[m("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),m("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:m("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Q(new kt(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Q(new st(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Q(new st(33,"disableMonospaceOptimizations",!1)),domReadOnly:Q(new st(34,"domReadOnly",!1)),dragAndDrop:Q(new st(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Q(new Fue),dropIntoEditor:Q(new fhe),stickyScroll:Q(new jue),experimentalWhitespaceRendering:Q(new ti(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[m("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),m("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),m("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:m("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Q(new Hs(39,"extraEditorClassName","")),fastScrollSensitivity:Q(new sr(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Q(new Bue),fixedOverflowWidgets:Q(new st(42,"fixedOverflowWidgets",!1)),folding:Q(new st(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Q(new ti(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[m("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),m("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:m("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Q(new st(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Q(new st(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Q(new kt(47,"foldingMaximumRegions",5e3,10,65e3,{description:m("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Q(new st(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Q(new Hs(49,"fontFamily",Wo.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:Q(new Wue),fontLigatures2:Q(new Mo),fontSize:Q(new Vue),fontWeight:Q(new Ca),fontVariations:Q(new $r),formatOnPaste:Q(new st(55,"formatOnPaste",!1,{description:m("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Q(new st(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Q(new st(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Q(new Hue),hideCursorInOverviewRuler:Q(new st(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Q(new zue),inDiffEditor:Q(new st(61,"inDiffEditor",!1)),letterSpacing:Q(new sr(63,"letterSpacing",Wo.letterSpacing,n=>sr.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Q(new Uue),lineDecorationsWidth:Q(new Gue),lineHeight:Q(new Kue),lineNumbers:Q(new the),lineNumbersMinChars:Q(new kt(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Q(new st(69,"linkedEditing",!1,{description:m("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Q(new st(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Q(new ti(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:Q(new Yue),mouseStyle:Q(new ti(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Q(new sr(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:m("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Q(new st(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Q(new st(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Q(new uw(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Zue,{markdownEnumDescriptions:[m("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:m({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Q(new ti(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[m("multiCursorPaste.spread","Each cursor pastes a single line of the text."),m("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:m("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Q(new kt(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Q(new st(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Q(new st(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Q(new kt(82,"overviewRulerLanes",3,0,3)),padding:Q(new Xue),pasteAs:Q(new ghe),parameterHints:Q(new Que),peekWidgetDefaultFocus:Q(new ti(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[m("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),m("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:m("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Q(new st(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Q(new ehe),quickSuggestionsDelay:Q(new kt(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Q(new st(90,"readOnly",!1)),readOnlyMessage:Q(new nhe),renameOnType:Q(new st(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Q(new st(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Q(new ti(94,"renderFinalNewline",Zn?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Q(new ti(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",m("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:m("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Q(new st(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Q(new ti(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Q(new ti(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",m("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),m("renderWhitespace.selection","Render whitespace characters only on selected text."),m("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:m("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Q(new kt(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Q(new st(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Q(new ihe),scrollbar:Q(new she),scrollBeyondLastColumn:Q(new kt(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Q(new st(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Q(new st(105,"scrollPredominantAxis",!0,{description:m("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Q(new st(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Zn})),selectionHighlight:Q(new st(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Q(new st(108,"selectOnLineNumbers",!0)),showFoldingControls:Q(new ti(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[m("showFoldingControls.always","Always show the folding controls."),m("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),m("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:m("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Q(new st(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:Q(new st(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Q(new que),snippetSuggestions:Q(new ti(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[m("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),m("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),m("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),m("snippetSuggestions.none","Do not show snippet suggestions.")],description:m("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Q(new dhe),smoothScrolling:Q(new st(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Q(new kt(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Q(new che),inlineSuggest:Q(new rhe),inlineCompletionsAccessibilityVerbose:Q(new st(147,"inlineCompletionsAccessibilityVerbose",!1,{description:m("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Q(new kt(118,"suggestFontSize",0,0,1e3,{markdownDescription:m("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Q(new kt(119,"suggestLineHeight",0,0,1e3,{markdownDescription:m("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Q(new st(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Q(new ti(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[m("suggestSelection.first","Always select the first suggestion."),m("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),m("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:m("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Q(new ti(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[m("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),m("tabCompletion.off","Disable tab completions."),m("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:m("tabCompletion","Enables tab completions.")})),tabIndex:Q(new kt(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Q(new ohe),unusualLineTerminators:Q(new ti(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[m("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),m("unusualLineTerminators.off","Unusual line terminators are ignored."),m("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:m("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Q(new st(126,"useShadowDOM",!0)),useTabStops:Q(new st(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Q(new ti(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[m("wordBreak.normal","Use the default line break rule."),m("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:m("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Q(new Hs(129,"wordSeparators",c$,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Q(new ti(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),m({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:m({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Q(new Hs(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Q(new Hs(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Q(new kt(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:m({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Q(new ti(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Q(new ti(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Q(new Oue),defaultColorDecorators:Q(new st(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Q(new Jue),tabFocusMode:Q(new st(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Q(new Zg),wrappingInfo:Q(new hhe),wrappingIndent:Q(new uhe),wrappingStrategy:Q(new $ue)};class bhe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?$p.isErrorNoTelemetry(e)?new $p(e.message+` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class phe extends Yt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("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:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),autohide:ve(t.autohide,this.defaultValue.autohide),size:Ci(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ci(t.side,this.defaultValue.side,["right","left"]),showSlider:Ci(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:kt.clampedInt(t.scale,1,1,3),maxColumn:kt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function mhe(n){return n==="ctrlCmd"?gt?"metaKey":"ctrlKey":"altKey"}class _he extends Yt{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:kt.clampedInt(t.top,0,0,1e3),bottom:kt.clampedInt(t.bottom,0,0,1e3)}}}class bhe extends Yt{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:m("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:m("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),cycle:ve(t.cycle,this.defaultValue.cycle)}}}class vhe extends m1{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class whe extends Yt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[m("on","Quick suggestions show inside the suggest widget"),m("inline","Quick suggestions show as ghost text"),m("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:m("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:m("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:m("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:m("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=Ci(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Ci(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=Ci(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class yhe extends Yt{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[m("lineNumbers.off","Line numbers are not rendered."),m("lineNumbers.on","Line numbers are rendered as absolute number."),m("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),m("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:m("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function KC(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class Che extends Yt{constructor(){const e=[],t={type:"number",description:m("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:m("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:m("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:kt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:kt.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class She extends Yt{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function lF(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let xhe=class extends Yt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),m("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),m("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),m("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),m("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:m("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:m("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:m("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=kt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=kt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:kt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:lF(t.vertical,this.defaultValue.vertical),horizontal:lF(t.horizontal,this.defaultValue.horizontal),useShadows:ve(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ve(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ve(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ve(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ve(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:kt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:kt.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:ve(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Er="inUntrustedWorkspace",Tu={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class Lhe extends Yt{constructor(){const e={nonBasicASCII:Er,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Er,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Tu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Er],default:e.nonBasicASCII,description:m("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Tu.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:m("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Tu.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:m("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Tu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Er],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Tu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Er],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Tu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Tu.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:m("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Co(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Co(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new a_(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Qg(t.nonBasicASCII,Er,[!0,!1,Er]),invisibleCharacters:ve(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ve(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Qg(t.includeComments,Er,[!0,!1,Er]),includeStrings:Qg(t.includeStrings,Er,[!0,!1,Er]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,o]of Object.entries(e))o===!0&&(i[s]=!0);return i}}class Dhe extends Yt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:m("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[m("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),m("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:m("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:m("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),mode:Ci(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ci(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:ve(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ve(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class khe extends Yt{constructor(){const e={enabled:An.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:An.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:m("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ve(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Ehe extends Yt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairs.true","Enables bracket pair guides."),m("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),m("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:m("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),m("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),m("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:m("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:m("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:m("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[m("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),m("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),m("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:m("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Qg(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Qg(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ve(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ve(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Qg(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Qg(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class Ihe extends Yt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[m("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),m("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:m("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:m("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:m("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:m("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[m("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),m("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:m("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:m("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:m("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:m("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:m("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:m("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:m("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:m("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Ci(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ve(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ve(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ve(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ve(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ci(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ve(t.showIcons,this.defaultValue.showIcons),showStatusBar:ve(t.showStatusBar,this.defaultValue.showStatusBar),preview:ve(t.preview,this.defaultValue.preview),previewMode:Ci(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ve(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ve(t.showMethods,this.defaultValue.showMethods),showFunctions:ve(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ve(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ve(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ve(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ve(t.showFields,this.defaultValue.showFields),showVariables:ve(t.showVariables,this.defaultValue.showVariables),showClasses:ve(t.showClasses,this.defaultValue.showClasses),showStructs:ve(t.showStructs,this.defaultValue.showStructs),showInterfaces:ve(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ve(t.showModules,this.defaultValue.showModules),showProperties:ve(t.showProperties,this.defaultValue.showProperties),showEvents:ve(t.showEvents,this.defaultValue.showEvents),showOperators:ve(t.showOperators,this.defaultValue.showOperators),showUnits:ve(t.showUnits,this.defaultValue.showUnits),showValues:ve(t.showValues,this.defaultValue.showValues),showConstants:ve(t.showConstants,this.defaultValue.showConstants),showEnums:ve(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ve(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ve(t.showKeywords,this.defaultValue.showKeywords),showWords:ve(t.showWords,this.defaultValue.showWords),showColors:ve(t.showColors,this.defaultValue.showColors),showFiles:ve(t.showFiles,this.defaultValue.showFiles),showReferences:ve(t.showReferences,this.defaultValue.showReferences),showFolders:ve(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ve(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ve(t.showSnippets,this.defaultValue.showSnippets),showUsers:ve(t.showUsers,this.defaultValue.showUsers),showIssues:ve(t.showIssues,this.defaultValue.showIssues)}}}class Ahe extends Yt{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:m("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:m("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:ve(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ve(e.selectSubwords,this.defaultValue.selectSubwords)}}}class The extends Yt{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[m("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),m("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),m("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),m("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:m("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class Nhe extends m1{constructor(){super(144)}compute(e,t,i){const s=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class Mhe extends Yt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:m("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[m("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),m("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showDropSelector:Ci(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Rhe extends Yt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:m("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[m("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),m("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showPasteSelector:Ci(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Phe="Consolas, 'Courier New', monospace",Ohe="Menlo, Monaco, 'Courier New', monospace",Fhe="'Droid Sans Mono', 'monospace', monospace",Wo={fontFamily:gt?Ohe:Zn?Fhe:Phe,fontWeight:"normal",fontSize:gt?12:14,lineHeight:0,letterSpacing:0},yg=[];function Q(n){return yg[n.id]=n,n}const yf={acceptSuggestionOnCommitCharacter:Q(new st(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:m("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Q(new ii(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",m("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:m("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Q(new Que),accessibilityPageSize:Q(new kt(3,"accessibilityPageSize",10,1,1073741824,{description:m("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Q(new Vs(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:Q(new st(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Q(new st(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Q(new ii(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),m("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:m("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Q(new ii(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),m("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:m("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Q(new ii(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Q(new ii(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Q(new ii(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),m("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:m("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Q(new bw(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Xue,{enumDescriptions:[m("editor.autoIndent.none","The editor will not insert indentation automatically."),m("editor.autoIndent.keep","The editor will keep the current line's indentation."),m("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),m("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),m("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:m("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Q(new st(13,"automaticLayout",!1)),autoSurround:Q(new ii(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[m("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),m("editor.autoSurround.quotes","Surround with quotes but not brackets."),m("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:m("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Q(new khe),bracketPairGuides:Q(new Ehe),stickyTabStops:Q(new st(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Q(new st(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Q(new Vs(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Q(new kt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:m("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Q(new st(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Q(new ii(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[m("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),m("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),m("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:m("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Q(new kt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:m("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Q(new st(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Q(new Jue),contextmenu:Q(new st(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Q(new st(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Q(new bw(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],ehe,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Q(new ii(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[m("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),m("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),m("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:m("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Q(new bw(28,"cursorStyle",fn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],the,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Q(new kt(29,"cursorSurroundingLines",0,0,1073741824,{description:m("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Q(new ii(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[m("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),m("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:m("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Q(new kt(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Q(new st(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Q(new st(33,"disableMonospaceOptimizations",!1)),domReadOnly:Q(new st(34,"domReadOnly",!1)),dragAndDrop:Q(new st(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Q(new nhe),dropIntoEditor:Q(new Mhe),stickyScroll:Q(new uhe),experimentalWhitespaceRendering:Q(new ii(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[m("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),m("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),m("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:m("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Q(new Vs(39,"extraEditorClassName","")),fastScrollSensitivity:Q(new sr(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Q(new she),fixedOverflowWidgets:Q(new st(42,"fixedOverflowWidgets",!1)),folding:Q(new st(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Q(new ii(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[m("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),m("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:m("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Q(new st(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Q(new st(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Q(new kt(47,"foldingMaximumRegions",5e3,10,65e3,{description:m("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Q(new st(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Q(new Vs(49,"fontFamily",Wo.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:Q(new ohe),fontLigatures2:Q(new No),fontSize:Q(new rhe),fontWeight:Q(new Ca),fontVariations:Q(new jr),formatOnPaste:Q(new st(55,"formatOnPaste",!1,{description:m("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Q(new st(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Q(new st(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Q(new ahe),hideCursorInOverviewRuler:Q(new st(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Q(new lhe),inDiffEditor:Q(new st(61,"inDiffEditor",!1)),letterSpacing:Q(new sr(63,"letterSpacing",Wo.letterSpacing,n=>sr.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Q(new dhe),lineDecorationsWidth:Q(new fhe),lineHeight:Q(new ghe),lineNumbers:Q(new yhe),lineNumbersMinChars:Q(new kt(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Q(new st(69,"linkedEditing",!1,{description:m("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Q(new st(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Q(new ii(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:Q(new phe),mouseStyle:Q(new ii(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Q(new sr(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:m("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Q(new st(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Q(new st(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Q(new bw(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],mhe,{markdownEnumDescriptions:[m("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:m({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Q(new ii(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[m("multiCursorPaste.spread","Each cursor pastes a single line of the text."),m("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:m("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Q(new kt(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Q(new st(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Q(new st(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Q(new kt(82,"overviewRulerLanes",3,0,3)),padding:Q(new _he),pasteAs:Q(new Rhe),parameterHints:Q(new bhe),peekWidgetDefaultFocus:Q(new ii(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[m("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),m("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:m("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Q(new st(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Q(new whe),quickSuggestionsDelay:Q(new kt(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Q(new st(90,"readOnly",!1)),readOnlyMessage:Q(new She),renameOnType:Q(new st(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Q(new st(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Q(new ii(94,"renderFinalNewline",Zn?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Q(new ii(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",m("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:m("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Q(new st(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Q(new ii(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Q(new ii(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",m("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),m("renderWhitespace.selection","Render whitespace characters only on selected text."),m("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:m("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Q(new kt(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Q(new st(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Q(new Che),scrollbar:Q(new xhe),scrollBeyondLastColumn:Q(new kt(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Q(new st(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Q(new st(105,"scrollPredominantAxis",!0,{description:m("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Q(new st(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Zn})),selectionHighlight:Q(new st(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Q(new st(108,"selectOnLineNumbers",!0)),showFoldingControls:Q(new ii(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[m("showFoldingControls.always","Always show the folding controls."),m("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),m("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:m("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Q(new st(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:Q(new st(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Q(new hhe),snippetSuggestions:Q(new ii(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[m("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),m("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),m("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),m("snippetSuggestions.none","Do not show snippet suggestions.")],description:m("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Q(new Ahe),smoothScrolling:Q(new st(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Q(new kt(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Q(new Ihe),inlineSuggest:Q(new Dhe),inlineCompletionsAccessibilityVerbose:Q(new st(147,"inlineCompletionsAccessibilityVerbose",!1,{description:m("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Q(new kt(118,"suggestFontSize",0,0,1e3,{markdownDescription:m("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Q(new kt(119,"suggestLineHeight",0,0,1e3,{markdownDescription:m("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Q(new st(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Q(new ii(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[m("suggestSelection.first","Always select the first suggestion."),m("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),m("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:m("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Q(new ii(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[m("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),m("tabCompletion.off","Disable tab completions."),m("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:m("tabCompletion","Enables tab completions.")})),tabIndex:Q(new kt(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Q(new Lhe),unusualLineTerminators:Q(new ii(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[m("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),m("unusualLineTerminators.off","Unusual line terminators are ignored."),m("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:m("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Q(new st(126,"useShadowDOM",!0)),useTabStops:Q(new st(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Q(new ii(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[m("wordBreak.normal","Use the default line break rule."),m("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:m("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Q(new Vs(129,"wordSeparators",D$,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Q(new ii(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),m({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:m({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Q(new Vs(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Q(new Vs(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Q(new kt(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:m({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Q(new ii(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Q(new ii(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Q(new ihe),defaultColorDecorators:Q(new st(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Q(new vhe),tabFocusMode:Q(new st(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Q(new Xg),wrappingInfo:Q(new Nhe),wrappingIndent:Q(new The),wrappingStrategy:Q(new che)};class Bhe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?jp.isErrorNoTelemetry(e)?new jp(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const g$=new bhe;function pt(n){Cf(n)||g$.onUnexpectedError(n)}function lc(n){Cf(n)||g$.onUnexpectedExternalError(n)}function ZO(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:$p.isErrorNoTelemetry(n)}}return n}const jC="Canceled";function Cf(n){return n instanceof Am?!0:n instanceof Error&&n.name===jC&&n.message===jC}class Am extends Error{constructor(){super(jC),this.name=this.message}}function vhe(){const n=new Error(jC);return n.name=n.message,n}function Kl(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function jR(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class whe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class $p extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof $p)return e;const t=new $p;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class $i extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,$i.prototype)}}function Up(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function yhe(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Pt(n){if(dt.is(n)){const e=[];for(const t of n)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(n)?[]:n}else if(n)return n.dispose(),n}function ur(...n){return Ke(()=>Pt(n))}function Ke(n){return{dispose:Up(()=>{n()})}}class fe{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{Pt(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?fe.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)}}fe.DISABLE_DISPOSED_WARNING=!1;class K{constructor(){this._store=new fe,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)}}K.None=Object.freeze({dispose(){}});class Qr{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Che{constructor(e){this.object=e}dispose(){}}class qR{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Pt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))===null||s===void 0||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const She=globalThis.performance&&typeof globalThis.performance.now=="function";class ou{static create(e){return new ou(e)}constructor(e){this._now=She&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var de;(function(n){n.None=()=>K.None;function e(P,M){return u(P,()=>{},0,void 0,!0,void 0,M)}n.defer=e;function t(P){return(M,$=null,Y)=>{let ne=!1,ce;return ce=P(ge=>{if(!ne)return ce?ce.dispose():ne=!0,M.call($,ge)},null,Y),ne&&ce.dispose(),ce}}n.once=t;function i(P,M,$){return c((Y,ne=null,ce)=>P(ge=>Y.call(ne,M(ge)),null,ce),$)}n.map=i;function s(P,M,$){return c((Y,ne=null,ce)=>P(ge=>{M(ge),Y.call(ne,ge)},null,ce),$)}n.forEach=s;function o(P,M,$){return c((Y,ne=null,ce)=>P(ge=>M(ge)&&Y.call(ne,ge),null,ce),$)}n.filter=o;function r(P){return P}n.signal=r;function a(...P){return(M,$=null,Y)=>{const ne=ur(...P.map(ce=>ce(ge=>M.call($,ge))));return d(ne,Y)}}n.any=a;function l(P,M,$,Y){let ne=$;return i(P,ce=>(ne=M(ne,ce),ne),Y)}n.reduce=l;function c(P,M){let $;const Y={onWillAddFirstListener(){$=P(ne.fire,ne)},onDidRemoveLastListener(){$==null||$.dispose()}},ne=new B(Y);return M==null||M.add(ne),ne.event}function d(P,M){return M instanceof Array?M.push(P):M&&M.add(P),P}function u(P,M,$=100,Y=!1,ne=!1,ce,ge){let se,Se,Ie,pe=0,ee;const Gt={leakWarningThreshold:ce,onWillAddFirstListener(){se=P(It=>{pe++,Se=M(Se,It),Y&&!Ie&&(xt.fire(Se),Se=void 0),ee=()=>{const je=Se;Se=void 0,Ie=void 0,(!Y||pe>1)&&xt.fire(je),pe=0},typeof $=="number"?(clearTimeout(Ie),Ie=setTimeout(ee,$)):Ie===void 0&&(Ie=0,queueMicrotask(ee))})},onWillRemoveListener(){ne&&pe>0&&(ee==null||ee())},onDidRemoveLastListener(){ee=void 0,se.dispose()}},xt=new B(Gt);return ge==null||ge.add(xt),xt.event}n.debounce=u;function h(P,M=0,$){return n.debounce(P,(Y,ne)=>Y?(Y.push(ne),Y):[ne],M,void 0,!0,void 0,$)}n.accumulate=h;function f(P,M=(Y,ne)=>Y===ne,$){let Y=!0,ne;return o(P,ce=>{const ge=Y||!M(ce,ne);return Y=!1,ne=ce,ge},$)}n.latch=f;function g(P,M,$){return[n.filter(P,M,$),n.filter(P,Y=>!M(Y),$)]}n.split=g;function p(P,M=!1,$=[],Y){let ne=$.slice(),ce=P(Se=>{ne?ne.push(Se):se.fire(Se)});Y&&Y.add(ce);const ge=()=>{ne==null||ne.forEach(Se=>se.fire(Se)),ne=null},se=new B({onWillAddFirstListener(){ce||(ce=P(Se=>se.fire(Se)),Y&&Y.add(ce))},onDidAddFirstListener(){ne&&(M?setTimeout(ge):ge())},onDidRemoveLastListener(){ce&&ce.dispose(),ce=null}});return Y&&Y.add(se),se.event}n.buffer=p;function _(P,M){return(Y,ne,ce)=>{const ge=M(new b);return P(function(se){const Se=ge.evaluate(se);Se!==v&&Y.call(ne,Se)},void 0,ce)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push($=>(M($),$)),this}filter(M){return this.steps.push($=>M($)?$:v),this}reduce(M,$){let Y=$;return this.steps.push(ne=>(Y=M(Y,ne),Y)),this}latch(M=($,Y)=>$===Y){let $=!0,Y;return this.steps.push(ne=>{const ce=$||!M(ne,Y);return $=!1,Y=ne,ce?ne:v}),this}evaluate(M){for(const $ of this.steps)if(M=$(M),M===v)break;return M}}function w(P,M,$=Y=>Y){const Y=(...se)=>ge.fire($(...se)),ne=()=>P.on(M,Y),ce=()=>P.removeListener(M,Y),ge=new B({onWillAddFirstListener:ne,onDidRemoveLastListener:ce});return ge.event}n.fromNodeEventEmitter=w;function y(P,M,$=Y=>Y){const Y=(...se)=>ge.fire($(...se)),ne=()=>P.addEventListener(M,Y),ce=()=>P.removeEventListener(M,Y),ge=new B({onWillAddFirstListener:ne,onDidRemoveLastListener:ce});return ge.event}n.fromDOMEventEmitter=y;function S(P){return new Promise(M=>t(P)(M))}n.toPromise=S;function L(P){const M=new B;return P.then($=>{M.fire($)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}n.fromPromise=L;function x(P,M){return M(void 0),P($=>M($))}n.runAndSubscribe=x;function D(P,M){let $=null;function Y(ce){$==null||$.dispose(),$=new fe,M(ce,$)}Y(void 0);const ne=P(ce=>Y(ce));return Ke(()=>{ne.dispose(),$==null||$.dispose()})}n.runAndSubscribeWithStore=D;class k{constructor(M,$){this._observable=M,this._counter=0,this._hasChanged=!1;const Y={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new B(Y),$&&$.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,$){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function O(P,M){return new k(P,M).emitter.event}n.fromObservable=O;function R(P){return M=>{let $=0,Y=!1;const ne={beginUpdate(){$++},endUpdate(){$--,$===0&&(P.reportChanges(),Y&&(Y=!1,M()))},handlePossibleChange(){},handleChange(){Y=!0}};return P.addObserver(ne),P.reportChanges(),{dispose(){P.removeObserver(ne)}}}}n.fromObservableLight=R})(de||(de={}));class jp{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${jp._idPool++}`,jp.all.add(this)}start(e){this._stopWatch=new ou,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}jp.all=new Set;jp._idPool=0;let xhe=-1;class Lhe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class GR{static create(){var e;return new GR((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+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 T$=new Bhe;function pt(n){Cf(n)||T$.onUnexpectedError(n)}function uc(n){Cf(n)||T$.onUnexpectedExternalError(n)}function cF(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:jp.isErrorNoTelemetry(n)}}return n}const YC="Canceled";function Cf(n){return n instanceof Nm?!0:n instanceof Error&&n.name===YC&&n.message===YC}class Nm extends Error{constructor(){super(YC),this.name=this.message}}function Whe(){const n=new Error(YC);return n.name=n.message,n}function Xl(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function i4(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class Vhe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class jp extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof jp)return e;const t=new jp;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class $i extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,$i.prototype)}}function qp(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function Hhe(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Pt(n){if(dt.is(n)){const e=[];for(const t of n)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(n)?[]:n}else if(n)return n.dispose(),n}function ur(...n){return Ze(()=>Pt(n))}function Ze(n){return{dispose:qp(()=>{n()})}}class fe{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{Pt(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?fe.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)}}fe.DISABLE_DISPOSED_WARNING=!1;class Y{constructor(){this._store=new fe,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)}}Y.None=Object.freeze({dispose(){}});class Jr{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class zhe{constructor(e){this.object=e}dispose(){}}class n4{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Pt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))===null||s===void 0||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const $he=globalThis.performance&&typeof globalThis.performance.now=="function";class du{static create(e){return new du(e)}constructor(e){this._now=$he&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var de;(function(n){n.None=()=>Y.None;function e(R,M){return u(R,()=>{},0,void 0,!0,void 0,M)}n.defer=e;function t(R){return(M,W=null,G)=>{let ne=!1,ce;return ce=R(ge=>{if(!ne)return ce?ce.dispose():ne=!0,M.call(W,ge)},null,G),ne&&ce.dispose(),ce}}n.once=t;function i(R,M,W){return c((G,ne=null,ce)=>R(ge=>G.call(ne,M(ge)),null,ce),W)}n.map=i;function s(R,M,W){return c((G,ne=null,ce)=>R(ge=>{M(ge),G.call(ne,ge)},null,ce),W)}n.forEach=s;function o(R,M,W){return c((G,ne=null,ce)=>R(ge=>M(ge)&&G.call(ne,ge),null,ce),W)}n.filter=o;function r(R){return R}n.signal=r;function a(...R){return(M,W=null,G)=>{const ne=ur(...R.map(ce=>ce(ge=>M.call(W,ge))));return d(ne,G)}}n.any=a;function l(R,M,W,G){let ne=W;return i(R,ce=>(ne=M(ne,ce),ne),G)}n.reduce=l;function c(R,M){let W;const G={onWillAddFirstListener(){W=R(ne.fire,ne)},onDidRemoveLastListener(){W==null||W.dispose()}},ne=new B(G);return M==null||M.add(ne),ne.event}function d(R,M){return M instanceof Array?M.push(R):M&&M.add(R),R}function u(R,M,W=100,G=!1,ne=!1,ce,ge){let se,Se,Ie,pe=0,ee;const Kt={leakWarningThreshold:ce,onWillAddFirstListener(){se=R(It=>{pe++,Se=M(Se,It),G&&!Ie&&(xt.fire(Se),Se=void 0),ee=()=>{const Ge=Se;Se=void 0,Ie=void 0,(!G||pe>1)&&xt.fire(Ge),pe=0},typeof W=="number"?(clearTimeout(Ie),Ie=setTimeout(ee,W)):Ie===void 0&&(Ie=0,queueMicrotask(ee))})},onWillRemoveListener(){ne&&pe>0&&(ee==null||ee())},onDidRemoveLastListener(){ee=void 0,se.dispose()}},xt=new B(Kt);return ge==null||ge.add(xt),xt.event}n.debounce=u;function h(R,M=0,W){return n.debounce(R,(G,ne)=>G?(G.push(ne),G):[ne],M,void 0,!0,void 0,W)}n.accumulate=h;function f(R,M=(G,ne)=>G===ne,W){let G=!0,ne;return o(R,ce=>{const ge=G||!M(ce,ne);return G=!1,ne=ce,ge},W)}n.latch=f;function g(R,M,W){return[n.filter(R,M,W),n.filter(R,G=>!M(G),W)]}n.split=g;function p(R,M=!1,W=[],G){let ne=W.slice(),ce=R(Se=>{ne?ne.push(Se):se.fire(Se)});G&&G.add(ce);const ge=()=>{ne==null||ne.forEach(Se=>se.fire(Se)),ne=null},se=new B({onWillAddFirstListener(){ce||(ce=R(Se=>se.fire(Se)),G&&G.add(ce))},onDidAddFirstListener(){ne&&(M?setTimeout(ge):ge())},onDidRemoveLastListener(){ce&&ce.dispose(),ce=null}});return G&&G.add(se),se.event}n.buffer=p;function _(R,M){return(G,ne,ce)=>{const ge=M(new b);return R(function(se){const Se=ge.evaluate(se);Se!==v&&G.call(ne,Se)},void 0,ce)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push(W=>(M(W),W)),this}filter(M){return this.steps.push(W=>M(W)?W:v),this}reduce(M,W){let G=W;return this.steps.push(ne=>(G=M(G,ne),G)),this}latch(M=(W,G)=>W===G){let W=!0,G;return this.steps.push(ne=>{const ce=W||!M(ne,G);return W=!1,G=ne,ce?ne:v}),this}evaluate(M){for(const W of this.steps)if(M=W(M),M===v)break;return M}}function w(R,M,W=G=>G){const G=(...se)=>ge.fire(W(...se)),ne=()=>R.on(M,G),ce=()=>R.removeListener(M,G),ge=new B({onWillAddFirstListener:ne,onDidRemoveLastListener:ce});return ge.event}n.fromNodeEventEmitter=w;function y(R,M,W=G=>G){const G=(...se)=>ge.fire(W(...se)),ne=()=>R.addEventListener(M,G),ce=()=>R.removeEventListener(M,G),ge=new B({onWillAddFirstListener:ne,onDidRemoveLastListener:ce});return ge.event}n.fromDOMEventEmitter=y;function S(R){return new Promise(M=>t(R)(M))}n.toPromise=S;function L(R){const M=new B;return R.then(W=>{M.fire(W)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}n.fromPromise=L;function x(R,M){return M(void 0),R(W=>M(W))}n.runAndSubscribe=x;function D(R,M){let W=null;function G(ce){W==null||W.dispose(),W=new fe,M(ce,W)}G(void 0);const ne=R(ce=>G(ce));return Ze(()=>{ne.dispose(),W==null||W.dispose()})}n.runAndSubscribeWithStore=D;class k{constructor(M,W){this._observable=M,this._counter=0,this._hasChanged=!1;const G={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new B(G),W&&W.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,W){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(R,M){return new k(R,M).emitter.event}n.fromObservable=P;function O(R){return M=>{let W=0,G=!1;const ne={beginUpdate(){W++},endUpdate(){W--,W===0&&(R.reportChanges(),G&&(G=!1,M()))},handlePossibleChange(){},handleChange(){G=!0}};return R.addObserver(ne),R.reportChanges(),{dispose(){R.removeObserver(ne)}}}}n.fromObservableLight=O})(de||(de={}));class Gp{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Gp._idPool++}`,Gp.all.add(this)}start(e){this._stopWatch=new du,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}Gp.all=new Set;Gp._idPool=0;let Uhe=-1;class jhe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class s4{static create(){var e;return new s4((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class Dk{constructor(e){this.value=e}}const Dhe=2;let B=class{constructor(e){var t,i,s,o,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new Lhe((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:xhe):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new jp(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(s=this._leakageMon)===null||s===void 0||s.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,s)=>{var o,r,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),K.None;if(this._disposed)return K.None;i&&(t=t.bind(i));const d=new Dk(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=GR.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof Dk?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new p$),this._listeners=[this._listeners,d]):this._listeners.push(d):((r=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||r===void 0||r.call(o,this),this._listeners=d,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ke(()=>{u==null||u(),this._removeListener(d)});return s instanceof fe?s.add(h):Array.isArray(s)&&s.push(h),h}),this._event}_removeListener(e){var t,i,s,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(s=this._options)===null||s===void 0?void 0:s.onDidRemoveLastListener)===null||o===void 0||o.call(s,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-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--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*Dhe<=r.length){let c=0;for(let d=0;d0}};const khe=()=>new p$;class p${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 cb extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new ks,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class m$ extends cb{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Ehe extends B{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class Ihe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new B({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Ke(Up(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class KR{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class XO{constructor(){this.listening=!1,this.inputEvent=de.None,this.inputEventListener=K.None,this.emitter=new B({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const _$=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var rn;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof Ay?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:de.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:_$})})(rn||(rn={}));class Ay{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?_$:(this._emitter||(this._emitter=new B),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let yr=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Ay),this._token}cancel(){this._token?this._token instanceof Ay&&this._token.cancel():this._token=rn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof Ay&&this._token.dispose():this._token=rn.None}};class YR{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const Ty=new YR,_I=new YR,bI=new YR,b$=new Array(230),Ahe=Object.create(null),The=Object.create(null),ZR=[];for(let n=0;n<=193;n++)ZR[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[o,r,a,l,c,d,u,h,f]=s;if(i[r]||(i[r]=!0,Ahe[a]=r,The[a.toLowerCase()]=r,o&&(ZR[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);Ty.define(l,c),_I.define(l,h||c),bI.define(l,f||h||c)}d&&(b$[d]=l)}})();var Al;(function(n){function e(a){return Ty.keyCodeToStr(a)}n.toString=e;function t(a){return Ty.strToKeyCode(a)}n.fromString=t;function i(a){return _I.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return bI.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return _I.strToKeyCode(a)||bI.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ty.keyCodeToStr(a)}n.toElectronAccelerator=r})(Al||(Al={}));function Fn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var QO={};let Qg;if(typeof dr.vscode<"u"&&typeof dr.vscode.process<"u"){const n=dr.vscode.process;Qg={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?Qg={get platform(){return process.platform},get arch(){return process.arch},get env(){return QO},cwd(){return QO.VSCODE_CWD||process.cwd()}}:Qg={get platform(){return Rs?"win32":gt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const qC=Qg.cwd,v$=Qg.env,Nhe=Qg.platform,Mhe=65,Rhe=97,Phe=90,Ohe=122,cd=46,Un=47,ao=92,wc=58,Fhe=63;class w$ extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function Bhe(n,e){if(n===null||typeof n!="object")throw new w$(e,"Object",n)}function Qi(n,e){if(typeof n!="string")throw new w$(e,"string",n)}const ru=Nhe==="win32";function yt(n){return n===Un||n===ao}function vI(n){return n===Un}function yc(n){return n>=Mhe&&n<=Phe||n>=Rhe&&n<=Ohe}function GC(n,e,t,i){let s="",o=0,r=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=c,a=0;continue}else if(s.length!==0){s="",o=0,r=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,c)}`:s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===cd&&a!==-1?++a:a=-1}return s}function y$(n,e){Bhe(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const js={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],Qi(o,"path"),o.length===0)continue}else e.length===0?o=qC():(o=v$[`=${e}`]||qC(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ao)&&(o=`${e}\\`));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)yt(d)&&(a=1,c=!0);else if(yt(d))if(c=!0,yt(o.charCodeAt(1))){let u=2,h=u;for(;u2&&yt(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=GC(t,!i,"\\",yt),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Qi(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return vI(o)?"\\":n;if(yt(o))if(s=!0,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&yt(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){Qi(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return yt(t)||e>2&&yc(t)&&n.charCodeAt(1)===wc&&yt(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&yt(t.charCodeAt(0))){++s;const o=t.length;o>1&&yt(t.charCodeAt(1))&&(++s,o>2&&(yt(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return js.normalize(e)},relative(n,e){if(Qi(n,"from"),Qi(e,"to"),n===e)return"";const t=js.resolve(n),i=js.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===ao;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===ao;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===ao)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===ao?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=s+u+1;h<=o;++h)(h===o||n.charCodeAt(h)===ao)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===ao&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=js.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===ao){if(e.charCodeAt(1)===ao){const t=e.charCodeAt(2);if(t!==Fhe&&t!==cd)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(yc(e.charCodeAt(0))&&e.charCodeAt(1)===wc&&e.charCodeAt(2)===ao)return`\\\\?\\${e}`;return n},dirname(n){Qi(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return yt(s)?n:".";if(yt(s)){if(t=i=1,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(yt(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&Qi(e,"ext"),Qi(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&yc(n.charCodeAt(0))&&n.charCodeAt(1)===wc&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(yt(l)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(yt(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Qi(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===wc&&yc(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(yt(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===cd?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:y$.bind(null,"\\"),parse(n){Qi(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return yt(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(yt(s)){if(i=1,yt(n.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,l=!0,c=n.length-1,d=0;for(;c>=i;--c){if(s=n.charCodeAt(c),yt(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===cd?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Whe=(()=>{if(ru){const n=/\\/g;return()=>{const e=qC().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>qC()})(),Ri={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:Whe();Qi(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Un)}return e=GC(e,!t,"/",vI),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Qi(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un,t=n.charCodeAt(n.length-1)===Un;return n=GC(n,!e,"/",vI),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Qi(n,"path"),n.length>0&&n.charCodeAt(0)===Un},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Ri.normalize(e)},relative(n,e){if(Qi(n,"from"),Qi(e,"to"),n===e||(n=Ri.resolve(n),e=Ri.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=sa){if(e.charCodeAt(o+c)===Un)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===Un?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Un)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Qi(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===Un){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&Qi(e,"ext"),Qi(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Un){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Un){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Qi(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===Un){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===cd?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:y$.bind(null,"/"),parse(n){Qi(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Un;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const d=n.charCodeAt(l);if(d===Un){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===cd?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||c===0||c===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Ri.win32=js.win32=js;Ri.posix=js.posix=Ri;const C$=ru?js.normalize:Ri.normalize,Vhe=ru?js.resolve:Ri.resolve,Hhe=ru?js.relative:Ri.relative,zhe=ru?js.dirname:Ri.dirname,S$=ru?js.basename:Ri.basename,$he=ru?js.extname:Ri.extname,dd=ru?js.sep:Ri.sep,Uhe=/^\w[\w\d+.-]*$/,jhe=/^\//,qhe=/^\/\//;function Ghe(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!Uhe.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!jhe.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(qhe.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Khe(n,e){return!n&&!e?"file":n}function Yhe(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==Vr&&(e=Vr+e):e=Vr;break}return e}const mi="",Vr="/",Zhe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class $e{static isUri(e){return e instanceof $e?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||mi,this.authority=e.authority||mi,this.path=e.path||mi,this.query=e.query||mi,this.fragment=e.fragment||mi):(this.scheme=Khe(e,r),this.authority=t||mi,this.path=Yhe(this.scheme,i||mi),this.query=s||mi,this.fragment=o||mi,Ghe(this,r))}get fsPath(){return KC(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=mi),i===void 0?i=this.authority:i===null&&(i=mi),s===void 0?s=this.path:s===null&&(s=mi),o===void 0?o=this.query:o===null&&(o=mi),r===void 0?r=this.fragment:r===null&&(r=mi),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new Xf(t,i,s,o,r)}static parse(e,t=!1){const i=Zhe.exec(e);return i?new Xf(i[2]||mi,hw(i[4]||mi),hw(i[5]||mi),hw(i[7]||mi),hw(i[9]||mi),t):new Xf(mi,mi,mi,mi,mi)}static file(e){let t=mi;if(Rs&&(e=e.replace(/\\/g,Vr)),e[0]===Vr&&e[1]===Vr){const i=e.indexOf(Vr,2);i===-1?(t=e.substring(2),e=Vr):(t=e.substring(2,i),e=e.substring(i)||Vr)}return new Xf("file",t,e,mi,mi)}static from(e,t){return new Xf(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Rs&&e.scheme==="file"?i=$e.file(js.join(KC(e,!0),...t)).path:i=Ri.join(e.path,...t),e.with({path:i})}toString(e=!1){return wI(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof $e)return e;{const s=new Xf(e);return s._formatted=(t=e.external)!==null&&t!==void 0?t:null,s._fsPath=e._sep===x$&&(i=e.fsPath)!==null&&i!==void 0?i:null,s}}else return e}}const x$=Rs?1:void 0;let Xf=class extends $e{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=KC(this,!1)),this._fsPath}toString(e=!1){return e?wI(this,!0):(this._formatted||(this._formatted=wI(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=x$),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const L$={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function JO(n,e,t){let i,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=L$[r];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i+=a):s===-1&&(s=o)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function Xhe(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Rs&&(t=t.replace(/\//g,"\\")),t}function wI(n,e){const t=e?Xhe:JO;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=Vr,i+=Vr),o){let c=o.indexOf("@");if(c!==-1){const d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:JO(l,!1,!1)),i}function D$(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+D$(n.substr(3)):n}}const eF=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function hw(n){return n.match(eF)?n.replace(eF,e=>D$(e)):n}let V=class Pu{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Pu(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Pu.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Pu.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return an.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return an.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return an.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return an.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return an.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new an(i,s,o,r)}intersectRanges(e){return an.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(o=c,r=d):o===c&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new an(i,s,o,r)}equalsRange(e){return an.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return an.getEndPosition(this)}static getEndPosition(e){return new V(e.endLineNumber,e.endColumn)}getStartPosition(){return an.getStartPosition(this)}static getStartPosition(e){return new V(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new an(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new an(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return an.collapseToStart(this)}static collapseToStart(e){return new an(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return an.collapseToEnd(this)}static collapseToEnd(e){return new an(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new an(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new an(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new an(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},lt=class er extends N{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return er.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new er(this.startLineNumber,this.startColumn,e,t):new er(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new V(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new V(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new er(e,t,this.endLineNumber,this.endColumn):new er(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new er(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new er(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new er(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new er(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const s=new Jhe(this,e,t);return this._factories.set(e,s),Ke(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return CI(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class Jhe extends K{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return CI(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return CI(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let db=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class XR{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class _L{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var tF;(function(n){const e=new Map;e.set(0,ie.symbolMethod),e.set(1,ie.symbolFunction),e.set(2,ie.symbolConstructor),e.set(3,ie.symbolField),e.set(4,ie.symbolVariable),e.set(5,ie.symbolClass),e.set(6,ie.symbolStruct),e.set(7,ie.symbolInterface),e.set(8,ie.symbolModule),e.set(9,ie.symbolProperty),e.set(10,ie.symbolEvent),e.set(11,ie.symbolOperator),e.set(12,ie.symbolUnit),e.set(13,ie.symbolValue),e.set(15,ie.symbolEnum),e.set(14,ie.symbolConstant),e.set(15,ie.symbolEnum),e.set(16,ie.symbolEnumMember),e.set(17,ie.symbolKeyword),e.set(27,ie.symbolSnippet),e.set(18,ie.symbolText),e.set(19,ie.symbolColor),e.set(20,ie.symbolFile),e.set(21,ie.symbolReference),e.set(22,ie.symbolCustomColor),e.set(23,ie.symbolFolder),e.set(24,ie.symbolTypeParameter),e.set(25,ie.account),e.set(26,ie.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=ie.symbolProperty),r}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function s(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}n.fromString=s})(tF||(tF={}));var SI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(SI||(SI={}));class efe{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return N.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var iF;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(iF||(iF={}));var nF;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(nF||(nF={}));function tfe(n){return n&&$e.isUri(n.uri)&&N.isIRange(n.range)&&(N.isIRange(n.originSelectionRange)||N.isIRange(n.targetSelectionRange))}m("Array","array"),m("Boolean","boolean"),m("Class","class"),m("Constant","constant"),m("Constructor","constructor"),m("Enum","enumeration"),m("EnumMember","enumeration member"),m("Event","event"),m("Field","field"),m("File","file"),m("Function","function"),m("Interface","interface"),m("Key","key"),m("Method","method"),m("Module","module"),m("Namespace","namespace"),m("Null","null"),m("Number","number"),m("Object","object"),m("Operator","operator"),m("Package","package"),m("Property","property"),m("String","string"),m("Struct","struct"),m("TypeParameter","type parameter"),m("Variable","variable");var xI;(function(n){const e=new Map;e.set(0,ie.symbolFile),e.set(1,ie.symbolModule),e.set(2,ie.symbolNamespace),e.set(3,ie.symbolPackage),e.set(4,ie.symbolClass),e.set(5,ie.symbolMethod),e.set(6,ie.symbolProperty),e.set(7,ie.symbolField),e.set(8,ie.symbolConstructor),e.set(9,ie.symbolEnum),e.set(10,ie.symbolInterface),e.set(11,ie.symbolFunction),e.set(12,ie.symbolVariable),e.set(13,ie.symbolConstant),e.set(14,ie.symbolString),e.set(15,ie.symbolNumber),e.set(16,ie.symbolBoolean),e.set(17,ie.symbolArray),e.set(18,ie.symbolObject),e.set(19,ie.symbolKey),e.set(20,ie.symbolNull),e.set(21,ie.symbolEnumMember),e.set(22,ie.symbolStruct),e.set(23,ie.symbolEvent),e.set(24,ie.symbolOperator),e.set(25,ie.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=ie.symbolProperty),s}n.toIcon=t})(xI||(xI={}));class ls{static fromValue(e){switch(e){case"comment":return ls.Comment;case"imports":return ls.Imports;case"region":return ls.Region}return new ls(e)}constructor(e){this.value=e}}ls.Comment=new ls("comment");ls.Imports=new ls("imports");ls.Region=new ls("region");var sF;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(sF||(sF={}));var oF;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(oF||(oF={}));class ife{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const vi=new Qhe;var LI;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(LI||(LI={}));var DI;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(DI||(DI={}));var kI;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(kI||(kI={}));var EI;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(EI||(EI={}));var II;(function(n){n[n.Deprecated=1]="Deprecated"})(II||(II={}));var AI;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(AI||(AI={}));var TI;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(TI||(TI={}));var NI;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(NI||(NI={}));var MI;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(MI||(MI={}));var RI;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(RI||(RI={}));var PI;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(PI||(PI={}));var OI;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(OI||(OI={}));var FI;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(FI||(FI={}));var BI;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(BI||(BI={}));var WI;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(WI||(WI={}));var VI;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(VI||(VI={}));var HI;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(HI||(HI={}));var zI;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(zI||(zI={}));var $I;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})($I||($I={}));var UI;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(UI||(UI={}));var jI;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(jI||(jI={}));var qI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(qI||(qI={}));var GI;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(GI||(GI={}));var KI;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(KI||(KI={}));var YI;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(YI||(YI={}));var ZI;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(ZI||(ZI={}));var XI;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(XI||(XI={}));var QI;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(QI||(QI={}));var JI;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(JI||(JI={}));var eA;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(eA||(eA={}));var tA;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(tA||(tA={}));var iA;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(iA||(iA={}));var nA;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(nA||(nA={}));var sA;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(sA||(sA={}));var oA;(function(n){n[n.Deprecated=1]="Deprecated"})(oA||(oA={}));var rA;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(rA||(rA={}));var aA;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(aA||(aA={}));var lA;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(lA||(lA={}));var cA;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(cA||(cA={}));let d1=class{static chord(e,t){return Fn(e,t)}};d1.CtrlCmd=2048;d1.Shift=1024;d1.Alt=512;d1.WinCtrl=256;function E$(){return{editor:void 0,languages:void 0,CancellationTokenSource:yr,Emitter:B,KeyCode:UI,KeyMod:d1,Position:V,Range:N,Selection:lt,SelectionDirection:iA,MarkerSeverity:jI,MarkerTag:qI,Uri:$e,Token:db}}class nfe{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class rF{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Sf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var qp;function sfe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const ofe=/{(\d+)}/g;function ub(n,...e){return e.length===0?n:n.replace(ofe,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function YC(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function pr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function bL(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function rfe(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,o=-1;for(;o=n.lastIndexOf(e,s-1),!(o===-1||o+t!==s);){if(o===0)return"";s=o}return n.substring(0,s)}function afe(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I$(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=pr(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function lfe(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function xf(n){return n.split(/\r\n|\r|\n/)}function Ks(n){for(let e=0,t=n.length;e=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function hb(n,e){return ne?1:0}function QR(n,e,t=0,i=n.length,s=0,o=e.length){for(;tc)return 1}const r=i-t,a=o-s;return ra?1:0}function aF(n,e){return u1(n,e,0,n.length,0,e.length)}function u1(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return QR(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Cg(l)&&(l-=32),Cg(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function fw(n){return n>=48&&n<=57}function Cg(n){return n>=97&&n<=122}function Mc(n){return n>=65&&n<=90}function Sg(n,e){return n.length===e.length&&u1(n,e)===0}function JR(n,e){const t=e.length;return e.length>n.length?!1:u1(n,e,0,t)===0}function ZC(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(tn(i))return e4(i,t)}return t}class t4{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=cfe(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=XC(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class QC{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new t4(e,t)}nextGraphemeLength(){const e=jc.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(lF(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=jc.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(lF(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function i4(n,e){return new QC(n,e).nextGraphemeLength()}function A$(n,e){return new QC(n,e).prevGraphemeLength()}function dfe(n,e){e>0&&Gp(n.charCodeAt(e))&&e--;const t=e+i4(n,e);return[t-A$(n,t),t]}let kk;function ufe(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function fb(n){return kk||(kk=ufe()),kk.test(n)}const hfe=/^[\t\n\r\x20-\x7E]*$/;function n4(n){return hfe.test(n)}const T$=/[\u2028\u2029]/;function N$(n){return T$.test(n)}function Wd(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function s4(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const ffe=String.fromCharCode(65279);function o4(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function gfe(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function M$(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function lF(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class jc{static getInstance(){return jc._INSTANCE||(jc._INSTANCE=new jc),jc._INSTANCE}constructor(){this._data=pfe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}jc._INSTANCE=null;function pfe(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function mfe(n,e){if(n===0)return 0;const t=_fe(n,e);if(t!==void 0)return t;const i=new t4(e,n);return i.prevCodePoint(),i.offset}function _fe(n,e){const t=new t4(e,n);let i=t.prevCodePoint();for(;bfe(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!s4(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function bfe(n){return 127995<=n&&n<=127999}class Jh{static getInstance(e){return qp.cache.get(Array.from(e))}static getLocales(){return qp._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}qp=Jh;Jh.ambiguousCharacterData=new Sf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Jh.cache=new nfe(n=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in s);o.length===0&&(o=["_default"]);let r;for(const c of o){const d=e(s[c]);r=i(r,d)}const a=e(s._common),l=t(a,r);return new qp(l)});Jh._locales=new Sf(()=>Object.keys(qp.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class ud{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(ud.getRawData())),this._data}static isInvisibleCharacter(e){return ud.getData().has(e)}static get codePoints(){return ud.getData()}}ud._data=void 0;class uA{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}uA.INSTANCE=new uA;class vfe extends K{constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class wfe extends K{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new vfe);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class yfe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new wfe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function R$(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const JC=new yfe;function Cfe(){return uA.INSTANCE.getZoomFactor()}const Tm=navigator.userAgent,mr=Tm.indexOf("Firefox")>=0,kh=Tm.indexOf("AppleWebKit")>=0,r4=Tm.indexOf("Chrome")>=0,oc=!r4&&Tm.indexOf("Safari")>=0,P$=!r4&&!oc&&kh;Tm.indexOf("Electron/")>=0;const cF=Tm.indexOf("Android")>=0;let Ny=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");Ny=n.matches,R$(n,({matches:t})=>{Ny&&e.matches||(Ny=t)})}function Sfe(){return Ny}class O${constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Er(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Er(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Er(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Er(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Er(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Er(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Er(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Er(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Er(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Er(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Er(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Er(n){return typeof n=="number"?`${n}px`:n}function _t(n){return new O$(n)}function Mn(n,e){n instanceof O$?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class xfe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class a4{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Mn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Mn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Mn(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=s),a.appendChild(document.createElement("br"));const l=document.createElement("span");a4._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new hA({pixelRatio:JC.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,s){const o=new xfe(e,t);return i.push(o),s==null||s.push(o),o}_actualReadFontInfo(e){const t=[],i=[],s=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),r=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),u=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),_=this._createRequest("9",0,t,i),v=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),w=this._createRequest("·",0,t,i),y=this._createRequest(String.fromCharCode(11825),0,t,null),S="|/-_ilm%";for(let O=0,R=S.length;O.001){x=!1;break}}let k=!0;return x&&b.width!==D&&(k=!1),b.width>v.width&&(k=!1),new hA({pixelRatio:JC.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:x,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:L},!0)}}class dF{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const fA=new Efe;var qr;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(qr||(qr={}));const bt=at("instantiationService");function Ife(n,e,t){e[qr.DI_TARGET]===e?e[qr.DI_DEPENDENCIES].push({id:n,index:t}):(e[qr.DI_DEPENDENCIES]=[{id:n,index:t}],e[qr.DI_TARGET]=e)}function at(n){if(qr.serviceIds.has(n))return qr.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ife(e,t,s)};return e.toString=()=>n,qr.serviceIds.set(n,e),e}const zt=at("codeEditorService"),fs=at("modelService"),au=at("textModelService");var Kp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class xo extends K{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return Kp(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class Yp extends K{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}run(e,t){return Kp(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return Kp(this,void 0,void 0,function*(){yield e.run(t)})}}class Rn{constructor(){this.id=Rn.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Rn,...i]:t=i);return t}run(){return Kp(this,void 0,void 0,function*(){})}}Rn.ID="vs.actions.separator";class vL{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}run(){return Kp(this,void 0,void 0,function*(){})}}class wL extends xo{constructor(){super(wL.ID,m("submenu.empty","(empty)"),void 0,!1)}}wL.ID="vs.actions.empty";function r_(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>Kp(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var gA;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(gA||(gA={}));var Ae;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(ie.error);const[,g,p]=f,_=["codicon","codicon-"+g];return p&&_.push("codicon-modifier-"+p.substring(1)),_}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function s(h){return"."+t(h).join(".")}n.asCSSSelector=s;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||gA.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=r.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=d;function u(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}n.isEqual=u})(Ae||(Ae={}));const gs=at("commandService"),qt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const r=[];for(const l of n.description.args)r.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return uue(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new ks,this._commands.set(t,i));const s=i.unshift(n),o=Ke(()=>{s();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return qt.registerCommand(n,(t,...i)=>t.get(gs).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return dt.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};qt.registerCommand("noop",()=>{});function Ik(...n){switch(n.length){case 1:return m("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return m("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return m("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const Afe=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Tfe=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Sa{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw jR(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(Ik("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Ik("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Ik("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Sa._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Afe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Tfe);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}}Sa._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));Sa._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Bn=new Map;Bn.set("false",!1);Bn.set("true",!0);Bn.set("isMac",gt);Bn.set("isLinux",Zn);Bn.set("isWindows",Rs);Bn.set("isWeb",Em);Bn.set("isMacNative",gt&&!Em);Bn.set("isEdge",kue);Bn.set("isFirefox",Lue);Bn.set("isChrome",l$);Bn.set("isSafari",Due);const Nfe=Object.prototype.hasOwnProperty,Mfe={regexParsingWithErrorRecovery:!0},Rfe=m("contextkey.parser.error.emptyString","Empty context key expression"),Pfe=m("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Ofe=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),uF=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Ffe=m("contextkey.parser.error.unexpectedToken","Unexpected token"),Bfe=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),Wfe=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),Vfe=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let F$=class I0{constructor(e=Mfe){this._config=e,this._scanner=new Sa,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Rfe,offset:0,lexeme:"",additionalInfo:Pfe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),s=i.type===17?Bfe:void 0;throw this._parsingErrors.push({message:Ffe,offset:i.offset,lexeme:Sa.getLexeme(i),additionalInfo:s}),I0._parseError}return t}catch(t){if(t!==I0._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:xe.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:xe.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),us.INSTANCE;case 12:return this._advance(),Ps.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,uF),t==null?void 0:t.negate()}case 17:return this._advance(),kf.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),xe.true();case 12:return this._advance(),xe.false();case 0:{this._advance();const t=this._expr();return this._consume(1,uF),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const o=s.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",s)}return gb.create(t,l)}switch(s.type){case 10:case 19:{const o=[s.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(r===null)throw this._errExpectedButGot("REGEX",s);return gb.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Ofe);const s=this._value();return xe.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return xe.equals(t,s);switch(s){case"true":return xe.has(t);case"false":return xe.not(t);default:return xe.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return xe.notEquals(t,s);switch(s){case"true":return xe.not(t);case"false":return xe.has(t);default:return xe.notEquals(t,s)}}case 5:return this._advance(),kL.create(t,this._value());case 6:return this._advance(),EL.create(t,this._value());case 7:return this._advance(),LL.create(t,this._value());case 8:return this._advance(),DL.create(t,this._value());case 13:return this._advance(),xe.in(t,this._value());default:return xe.has(t)}}case 20:throw this._parsingErrors.push({message:Wfe,offset:e.offset,lexeme:"",additionalInfo:Vfe}),I0._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class Nk{constructor(e){this.value=e}}const qhe=2;let B=class{constructor(e){var t,i,s,o,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new jhe((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:Uhe):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new Gp(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(s=this._leakageMon)===null||s===void 0||s.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,s)=>{var o,r,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Y.None;if(this._disposed)return Y.None;i&&(t=t.bind(i));const d=new Nk(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=s4.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof Nk?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new N$),this._listeners=[this._listeners,d]):this._listeners.push(d):((r=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||r===void 0||r.call(o,this),this._listeners=d,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ze(()=>{u==null||u(),this._removeListener(d)});return s instanceof fe?s.add(h):Array.isArray(s)&&s.push(h),h}),this._event}_removeListener(e){var t,i,s,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(s=this._options)===null||s===void 0?void 0:s.onDidRemoveLastListener)===null||o===void 0||o.call(s,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-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--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*qhe<=r.length){let c=0;for(let d=0;d0}};const Ghe=()=>new N$;class N${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 ub extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ds,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class M$ extends ub{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Khe extends B{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class Yhe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new B({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Ze(qp(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class o4{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class dF{constructor(){this.listening=!1,this.inputEvent=de.None,this.inputEventListener=Y.None,this.emitter=new B({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const R$=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var rn;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof Fy?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:de.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:R$})})(rn||(rn={}));class Fy{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?R$:(this._emitter||(this._emitter=new B),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Cr=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Fy),this._token}cancel(){this._token?this._token instanceof Fy&&this._token.cancel():this._token=rn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof Fy&&this._token.dispose():this._token=rn.None}};class r4{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const By=new r4,kI=new r4,EI=new r4,P$=new Array(230),Zhe=Object.create(null),Xhe=Object.create(null),a4=[];for(let n=0;n<=193;n++)a4[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[o,r,a,l,c,d,u,h,f]=s;if(i[r]||(i[r]=!0,Zhe[a]=r,Xhe[a.toLowerCase()]=r,o&&(a4[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);By.define(l,c),kI.define(l,h||c),EI.define(l,f||h||c)}d&&(P$[d]=l)}})();var Nl;(function(n){function e(a){return By.keyCodeToStr(a)}n.toString=e;function t(a){return By.strToKeyCode(a)}n.fromString=t;function i(a){return kI.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return EI.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return kI.strToKeyCode(a)||EI.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return By.keyCodeToStr(a)}n.toElectronAccelerator=r})(Nl||(Nl={}));function Fn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var uF={};let Jg;if(typeof dr.vscode<"u"&&typeof dr.vscode.process<"u"){const n=dr.vscode.process;Jg={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?Jg={get platform(){return process.platform},get arch(){return process.arch},get env(){return uF},cwd(){return uF.VSCODE_CWD||process.cwd()}}:Jg={get platform(){return Ms?"win32":gt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const ZC=Jg.cwd,O$=Jg.env,Qhe=Jg.platform,Jhe=65,efe=97,tfe=90,ife=122,hd=46,Un=47,ao=92,Sc=58,nfe=63;class F$ extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function sfe(n,e){if(n===null||typeof n!="object")throw new F$(e,"Object",n)}function Qi(n,e){if(typeof n!="string")throw new F$(e,"string",n)}const uu=Qhe==="win32";function yt(n){return n===Un||n===ao}function II(n){return n===Un}function xc(n){return n>=Jhe&&n<=tfe||n>=efe&&n<=ife}function XC(n,e,t,i){let s="",o=0,r=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=c,a=0;continue}else if(s.length!==0){s="",o=0,r=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,c)}`:s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===hd&&a!==-1?++a:a=-1}return s}function B$(n,e){sfe(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Us={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],Qi(o,"path"),o.length===0)continue}else e.length===0?o=ZC():(o=O$[`=${e}`]||ZC(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ao)&&(o=`${e}\\`));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)yt(d)&&(a=1,c=!0);else if(yt(d))if(c=!0,yt(o.charCodeAt(1))){let u=2,h=u;for(;u2&&yt(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=XC(t,!i,"\\",yt),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Qi(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return II(o)?"\\":n;if(yt(o))if(s=!0,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&yt(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){Qi(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return yt(t)||e>2&&xc(t)&&n.charCodeAt(1)===Sc&&yt(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&yt(t.charCodeAt(0))){++s;const o=t.length;o>1&&yt(t.charCodeAt(1))&&(++s,o>2&&(yt(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return Us.normalize(e)},relative(n,e){if(Qi(n,"from"),Qi(e,"to"),n===e)return"";const t=Us.resolve(n),i=Us.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===ao;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===ao;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===ao)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===ao?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=s+u+1;h<=o;++h)(h===o||n.charCodeAt(h)===ao)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===ao&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Us.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===ao){if(e.charCodeAt(1)===ao){const t=e.charCodeAt(2);if(t!==nfe&&t!==hd)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(xc(e.charCodeAt(0))&&e.charCodeAt(1)===Sc&&e.charCodeAt(2)===ao)return`\\\\?\\${e}`;return n},dirname(n){Qi(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return yt(s)?n:".";if(yt(s)){if(t=i=1,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(yt(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&Qi(e,"ext"),Qi(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&xc(n.charCodeAt(0))&&n.charCodeAt(1)===Sc&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(yt(l)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(yt(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Qi(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===Sc&&xc(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(yt(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===hd?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:B$.bind(null,"\\"),parse(n){Qi(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return yt(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(yt(s)){if(i=1,yt(n.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,l=!0,c=n.length-1,d=0;for(;c>=i;--c){if(s=n.charCodeAt(c),yt(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===hd?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},ofe=(()=>{if(uu){const n=/\\/g;return()=>{const e=ZC().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>ZC()})(),Ri={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:ofe();Qi(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Un)}return e=XC(e,!t,"/",II),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Qi(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un,t=n.charCodeAt(n.length-1)===Un;return n=XC(n,!e,"/",II),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Qi(n,"path"),n.length>0&&n.charCodeAt(0)===Un},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Ri.normalize(e)},relative(n,e){if(Qi(n,"from"),Qi(e,"to"),n===e||(n=Ri.resolve(n),e=Ri.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=sa){if(e.charCodeAt(o+c)===Un)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===Un?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Un)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Qi(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===Un){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&Qi(e,"ext"),Qi(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Un){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Un){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Qi(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===Un){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===hd?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:B$.bind(null,"/"),parse(n){Qi(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Un;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const d=n.charCodeAt(l);if(d===Un){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===hd?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||c===0||c===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Ri.win32=Us.win32=Us;Ri.posix=Us.posix=Ri;const W$=uu?Us.normalize:Ri.normalize,rfe=uu?Us.resolve:Ri.resolve,afe=uu?Us.relative:Ri.relative,lfe=uu?Us.dirname:Ri.dirname,V$=uu?Us.basename:Ri.basename,cfe=uu?Us.extname:Ri.extname,fd=uu?Us.sep:Ri.sep,dfe=/^\w[\w\d+.-]*$/,ufe=/^\//,hfe=/^\/\//;function ffe(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!dfe.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!ufe.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(hfe.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function gfe(n,e){return!n&&!e?"file":n}function pfe(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==zr&&(e=zr+e):e=zr;break}return e}const bi="",zr="/",mfe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class je{static isUri(e){return e instanceof je?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||bi,this.authority=e.authority||bi,this.path=e.path||bi,this.query=e.query||bi,this.fragment=e.fragment||bi):(this.scheme=gfe(e,r),this.authority=t||bi,this.path=pfe(this.scheme,i||bi),this.query=s||bi,this.fragment=o||bi,ffe(this,r))}get fsPath(){return QC(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=bi),i===void 0?i=this.authority:i===null&&(i=bi),s===void 0?s=this.path:s===null&&(s=bi),o===void 0?o=this.query:o===null&&(o=bi),r===void 0?r=this.fragment:r===null&&(r=bi),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new Xf(t,i,s,o,r)}static parse(e,t=!1){const i=mfe.exec(e);return i?new Xf(i[2]||bi,vw(i[4]||bi),vw(i[5]||bi),vw(i[7]||bi),vw(i[9]||bi),t):new Xf(bi,bi,bi,bi,bi)}static file(e){let t=bi;if(Ms&&(e=e.replace(/\\/g,zr)),e[0]===zr&&e[1]===zr){const i=e.indexOf(zr,2);i===-1?(t=e.substring(2),e=zr):(t=e.substring(2,i),e=e.substring(i)||zr)}return new Xf("file",t,e,bi,bi)}static from(e,t){return new Xf(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Ms&&e.scheme==="file"?i=je.file(Us.join(QC(e,!0),...t)).path:i=Ri.join(e.path,...t),e.with({path:i})}toString(e=!1){return AI(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof je)return e;{const s=new Xf(e);return s._formatted=(t=e.external)!==null&&t!==void 0?t:null,s._fsPath=e._sep===H$&&(i=e.fsPath)!==null&&i!==void 0?i:null,s}}else return e}}const H$=Ms?1:void 0;let Xf=class extends je{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=QC(this,!1)),this._fsPath}toString(e=!1){return e?AI(this,!0):(this._formatted||(this._formatted=AI(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=H$),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const z$={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function hF(n,e,t){let i,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=z$[r];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i+=a):s===-1&&(s=o)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function _fe(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Ms&&(t=t.replace(/\//g,"\\")),t}function AI(n,e){const t=e?_fe:hF;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=zr,i+=zr),o){let c=o.indexOf("@");if(c!==-1){const d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:hF(l,!1,!1)),i}function $$(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+$$(n.substr(3)):n}}const fF=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function vw(n){return n.match(fF)?n.replace(fF,e=>$$(e)):n}let H=class Vu{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Vu(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Vu.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Vu.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return an.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return an.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return an.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return an.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return an.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new an(i,s,o,r)}intersectRanges(e){return an.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(o=c,r=d):o===c&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new an(i,s,o,r)}equalsRange(e){return an.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return an.getEndPosition(this)}static getEndPosition(e){return new H(e.endLineNumber,e.endColumn)}getStartPosition(){return an.getStartPosition(this)}static getStartPosition(e){return new H(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new an(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new an(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return an.collapseToStart(this)}static collapseToStart(e){return new an(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return an.collapseToEnd(this)}static collapseToEnd(e){return new an(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new an(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new an(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new an(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},lt=class er extends N{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return er.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new er(this.startLineNumber,this.startColumn,e,t):new er(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new H(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new H(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new er(e,t,this.endLineNumber,this.endColumn):new er(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new er(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new er(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new er(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new er(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const s=new vfe(this,e,t);return this._factories.set(e,s),Ze(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return NI(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class vfe extends Y{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return NI(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return NI(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let hb=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class l4{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class LL{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var gF;(function(n){const e=new Map;e.set(0,ie.symbolMethod),e.set(1,ie.symbolFunction),e.set(2,ie.symbolConstructor),e.set(3,ie.symbolField),e.set(4,ie.symbolVariable),e.set(5,ie.symbolClass),e.set(6,ie.symbolStruct),e.set(7,ie.symbolInterface),e.set(8,ie.symbolModule),e.set(9,ie.symbolProperty),e.set(10,ie.symbolEvent),e.set(11,ie.symbolOperator),e.set(12,ie.symbolUnit),e.set(13,ie.symbolValue),e.set(15,ie.symbolEnum),e.set(14,ie.symbolConstant),e.set(15,ie.symbolEnum),e.set(16,ie.symbolEnumMember),e.set(17,ie.symbolKeyword),e.set(27,ie.symbolSnippet),e.set(18,ie.symbolText),e.set(19,ie.symbolColor),e.set(20,ie.symbolFile),e.set(21,ie.symbolReference),e.set(22,ie.symbolCustomColor),e.set(23,ie.symbolFolder),e.set(24,ie.symbolTypeParameter),e.set(25,ie.account),e.set(26,ie.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=ie.symbolProperty),r}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function s(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}n.fromString=s})(gF||(gF={}));var MI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(MI||(MI={}));class wfe{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return N.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var pF;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(pF||(pF={}));var mF;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(mF||(mF={}));function yfe(n){return n&&je.isUri(n.uri)&&N.isIRange(n.range)&&(N.isIRange(n.originSelectionRange)||N.isIRange(n.targetSelectionRange))}m("Array","array"),m("Boolean","boolean"),m("Class","class"),m("Constant","constant"),m("Constructor","constructor"),m("Enum","enumeration"),m("EnumMember","enumeration member"),m("Event","event"),m("Field","field"),m("File","file"),m("Function","function"),m("Interface","interface"),m("Key","key"),m("Method","method"),m("Module","module"),m("Namespace","namespace"),m("Null","null"),m("Number","number"),m("Object","object"),m("Operator","operator"),m("Package","package"),m("Property","property"),m("String","string"),m("Struct","struct"),m("TypeParameter","type parameter"),m("Variable","variable");var RI;(function(n){const e=new Map;e.set(0,ie.symbolFile),e.set(1,ie.symbolModule),e.set(2,ie.symbolNamespace),e.set(3,ie.symbolPackage),e.set(4,ie.symbolClass),e.set(5,ie.symbolMethod),e.set(6,ie.symbolProperty),e.set(7,ie.symbolField),e.set(8,ie.symbolConstructor),e.set(9,ie.symbolEnum),e.set(10,ie.symbolInterface),e.set(11,ie.symbolFunction),e.set(12,ie.symbolVariable),e.set(13,ie.symbolConstant),e.set(14,ie.symbolString),e.set(15,ie.symbolNumber),e.set(16,ie.symbolBoolean),e.set(17,ie.symbolArray),e.set(18,ie.symbolObject),e.set(19,ie.symbolKey),e.set(20,ie.symbolNull),e.set(21,ie.symbolEnumMember),e.set(22,ie.symbolStruct),e.set(23,ie.symbolEvent),e.set(24,ie.symbolOperator),e.set(25,ie.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=ie.symbolProperty),s}n.toIcon=t})(RI||(RI={}));class as{static fromValue(e){switch(e){case"comment":return as.Comment;case"imports":return as.Imports;case"region":return as.Region}return new as(e)}constructor(e){this.value=e}}as.Comment=new as("comment");as.Imports=new as("imports");as.Region=new as("region");var _F;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(_F||(_F={}));var bF;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(bF||(bF={}));class Cfe{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const yi=new bfe;var PI;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(PI||(PI={}));var OI;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(OI||(OI={}));var FI;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(FI||(FI={}));var BI;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(BI||(BI={}));var WI;(function(n){n[n.Deprecated=1]="Deprecated"})(WI||(WI={}));var VI;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(VI||(VI={}));var HI;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(HI||(HI={}));var zI;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(zI||(zI={}));var $I;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})($I||($I={}));var UI;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(UI||(UI={}));var jI;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(jI||(jI={}));var qI;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(qI||(qI={}));var GI;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(GI||(GI={}));var KI;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(KI||(KI={}));var YI;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(YI||(YI={}));var ZI;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(ZI||(ZI={}));var XI;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(XI||(XI={}));var QI;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(QI||(QI={}));var JI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(JI||(JI={}));var eA;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(eA||(eA={}));var tA;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(tA||(tA={}));var iA;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(iA||(iA={}));var nA;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(nA||(nA={}));var sA;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(sA||(sA={}));var oA;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(oA||(oA={}));var rA;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(rA||(rA={}));var aA;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(aA||(aA={}));var lA;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(lA||(lA={}));var cA;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(cA||(cA={}));var dA;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(dA||(dA={}));var uA;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(uA||(uA={}));var hA;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(hA||(hA={}));var fA;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(fA||(fA={}));var gA;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(gA||(gA={}));var pA;(function(n){n[n.Deprecated=1]="Deprecated"})(pA||(pA={}));var mA;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(mA||(mA={}));var _A;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(_A||(_A={}));var bA;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(bA||(bA={}));var vA;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(vA||(vA={}));let _1=class{static chord(e,t){return Fn(e,t)}};_1.CtrlCmd=2048;_1.Shift=1024;_1.Alt=512;_1.WinCtrl=256;function j$(){return{editor:void 0,languages:void 0,CancellationTokenSource:Cr,Emitter:B,KeyCode:eA,KeyMod:_1,Position:H,Range:N,Selection:lt,SelectionDirection:hA,MarkerSeverity:tA,MarkerTag:iA,Uri:je,Token:hb}}class Sfe{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class vF{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Sf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var Kp;function xfe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const Lfe=/{(\d+)}/g;function fb(n,...e){return e.length===0?n:n.replace(Lfe,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function JC(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function mr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function DL(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function Dfe(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,o=-1;for(;o=n.lastIndexOf(e,s-1),!(o===-1||o+t!==s);){if(o===0)return"";s=o}return n.substring(0,s)}function kfe(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function q$(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=mr(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function Efe(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function xf(n){return n.split(/\r\n|\r|\n/)}function Gs(n){for(let e=0,t=n.length;e=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function gb(n,e){return ne?1:0}function c4(n,e,t=0,i=n.length,s=0,o=e.length){for(;tc)return 1}const r=i-t,a=o-s;return ra?1:0}function wF(n,e){return b1(n,e,0,n.length,0,e.length)}function b1(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return c4(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Cg(l)&&(l-=32),Cg(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function ww(n){return n>=48&&n<=57}function Cg(n){return n>=97&&n<=122}function Pc(n){return n>=65&&n<=90}function Sg(n,e){return n.length===e.length&&b1(n,e)===0}function d4(n,e){const t=e.length;return e.length>n.length?!1:b1(n,e,0,t)===0}function eS(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(tn(i))return u4(i,t)}return t}class h4{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=Ife(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=tS(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class iS{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new h4(e,t)}nextGraphemeLength(){const e=Kc.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(yF(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=Kc.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(yF(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function f4(n,e){return new iS(n,e).nextGraphemeLength()}function G$(n,e){return new iS(n,e).prevGraphemeLength()}function Afe(n,e){e>0&&Yp(n.charCodeAt(e))&&e--;const t=e+f4(n,e);return[t-G$(n,t),t]}let Mk;function Tfe(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function pb(n){return Mk||(Mk=Tfe()),Mk.test(n)}const Nfe=/^[\t\n\r\x20-\x7E]*$/;function g4(n){return Nfe.test(n)}const K$=/[\u2028\u2029]/;function Y$(n){return K$.test(n)}function Ud(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function p4(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const Mfe=String.fromCharCode(65279);function m4(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function Rfe(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function Z$(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function yF(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class Kc{static getInstance(){return Kc._INSTANCE||(Kc._INSTANCE=new Kc),Kc._INSTANCE}constructor(){this._data=Pfe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}Kc._INSTANCE=null;function Pfe(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function Ofe(n,e){if(n===0)return 0;const t=Ffe(n,e);if(t!==void 0)return t;const i=new h4(e,n);return i.prevCodePoint(),i.offset}function Ffe(n,e){const t=new h4(e,n);let i=t.prevCodePoint();for(;Bfe(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!p4(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function Bfe(n){return 127995<=n&&n<=127999}class Jh{static getInstance(e){return Kp.cache.get(Array.from(e))}static getLocales(){return Kp._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Kp=Jh;Jh.ambiguousCharacterData=new Sf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Jh.cache=new Sfe(n=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in s);o.length===0&&(o=["_default"]);let r;for(const c of o){const d=e(s[c]);r=i(r,d)}const a=e(s._common),l=t(a,r);return new Kp(l)});Jh._locales=new Sf(()=>Object.keys(Kp.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class gd{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(gd.getRawData())),this._data}static isInvisibleCharacter(e){return gd.getData().has(e)}static get codePoints(){return gd.getData()}}gd._data=void 0;class yA{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}yA.INSTANCE=new yA;class Wfe extends Y{constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Vfe extends Y{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Wfe);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class Hfe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Vfe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function X$(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const nS=new Hfe;function zfe(){return yA.INSTANCE.getZoomFactor()}const Mm=navigator.userAgent,_r=Mm.indexOf("Firefox")>=0,Eh=Mm.indexOf("AppleWebKit")>=0,_4=Mm.indexOf("Chrome")>=0,lc=!_4&&Mm.indexOf("Safari")>=0,Q$=!_4&&!lc&&Eh;Mm.indexOf("Electron/")>=0;const CF=Mm.indexOf("Android")>=0;let Wy=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");Wy=n.matches,X$(n,({matches:t})=>{Wy&&e.matches||(Wy=t)})}function $fe(){return Wy}class J${constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Ir(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Ir(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Ir(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Ir(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Ir(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Ir(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Ir(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Ir(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Ir(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Ir(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Ir(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Ir(n){return typeof n=="number"?`${n}px`:n}function _t(n){return new J$(n)}function Mn(n,e){n instanceof J$?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class Ufe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class b4{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Mn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Mn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Mn(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=s),a.appendChild(document.createElement("br"));const l=document.createElement("span");b4._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new CA({pixelRatio:nS.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,s){const o=new Ufe(e,t);return i.push(o),s==null||s.push(o),o}_actualReadFontInfo(e){const t=[],i=[],s=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),r=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),u=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),_=this._createRequest("9",0,t,i),v=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),w=this._createRequest("·",0,t,i),y=this._createRequest(String.fromCharCode(11825),0,t,null),S="|/-_ilm%";for(let P=0,O=S.length;P.001){x=!1;break}}let k=!0;return x&&b.width!==D&&(k=!1),b.width>v.width&&(k=!1),new CA({pixelRatio:nS.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:x,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:L},!0)}}class SF{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const SA=new Kfe;var Kr;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Kr||(Kr={}));const bt=at("instantiationService");function Yfe(n,e,t){e[Kr.DI_TARGET]===e?e[Kr.DI_DEPENDENCIES].push({id:n,index:t}):(e[Kr.DI_DEPENDENCIES]=[{id:n,index:t}],e[Kr.DI_TARGET]=e)}function at(n){if(Kr.serviceIds.has(n))return Kr.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Yfe(e,t,s)};return e.toString=()=>n,Kr.serviceIds.set(n,e),e}const $t=at("codeEditorService"),hs=at("modelService"),hu=at("textModelService");var Zp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class So extends Y{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return Zp(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class Xp extends Y{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}run(e,t){return Zp(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return Zp(this,void 0,void 0,function*(){yield e.run(t)})}}class Rn{constructor(){this.id=Rn.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Rn,...i]:t=i);return t}run(){return Zp(this,void 0,void 0,function*(){})}}Rn.ID="vs.actions.separator";class kL{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}run(){return Zp(this,void 0,void 0,function*(){})}}class EL extends So{constructor(){super(EL.ID,m("submenu.empty","(empty)"),void 0,!1)}}EL.ID="vs.actions.empty";function l_(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>Zp(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var xA;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(xA||(xA={}));var Ae;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(ie.error);const[,g,p]=f,_=["codicon","codicon-"+g];return p&&_.push("codicon-modifier-"+p.substring(1)),_}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function s(h){return"."+t(h).join(".")}n.asCSSSelector=s;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||xA.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=r.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=d;function u(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}n.isEqual=u})(Ae||(Ae={}));const fs=at("commandService"),Gt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const r=[];for(const l of n.description.args)r.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return Tue(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Ds,this._commands.set(t,i));const s=i.unshift(n),o=Ze(()=>{s();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return Gt.registerCommand(n,(t,...i)=>t.get(fs).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return dt.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};Gt.registerCommand("noop",()=>{});function Pk(...n){switch(n.length){case 1:return m("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return m("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return m("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const Zfe=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Xfe=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Sa{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw i4(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(Pk("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Pk("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Pk("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Sa._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Zfe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Xfe);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}}Sa._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));Sa._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Bn=new Map;Bn.set("false",!1);Bn.set("true",!0);Bn.set("isMac",gt);Bn.set("isLinux",Zn);Bn.set("isWindows",Ms);Bn.set("isWeb",Am);Bn.set("isMacNative",gt&&!Am);Bn.set("isEdge",Gue);Bn.set("isFirefox",jue);Bn.set("isChrome",L$);Bn.set("isSafari",que);const Qfe=Object.prototype.hasOwnProperty,Jfe={regexParsingWithErrorRecovery:!0},ege=m("contextkey.parser.error.emptyString","Empty context key expression"),tge=m("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),ige=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),xF=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),nge=m("contextkey.parser.error.unexpectedToken","Unexpected token"),sge=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),oge=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),rge=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let eU=class T0{constructor(e=Jfe){this._config=e,this._scanner=new Sa,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:ege,offset:0,lexeme:"",additionalInfo:tge});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),s=i.type===17?sge:void 0;throw this._parsingErrors.push({message:nge,offset:i.offset,lexeme:Sa.getLexeme(i),additionalInfo:s}),T0._parseError}return t}catch(t){if(t!==T0._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:xe.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:xe.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ds.INSTANCE;case 12:return this._advance(),Rs.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,xF),t==null?void 0:t.negate()}case 17:return this._advance(),kf.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),xe.true();case 12:return this._advance(),xe.false();case 0:{this._advance();const t=this._expr();return this._consume(1,xF),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const o=s.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",s)}return mb.create(t,l)}switch(s.type){case 10:case 19:{const o=[s.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(r===null)throw this._errExpectedButGot("REGEX",s);return mb.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,ige);const s=this._value();return xe.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return xe.equals(t,s);switch(s){case"true":return xe.has(t);case"false":return xe.not(t);default:return xe.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return xe.notEquals(t,s);switch(s){case"true":return xe.not(t);case"false":return xe.has(t);default:return xe.notEquals(t,s)}}case 5:return this._advance(),PL.create(t,this._value());case 6:return this._advance(),OL.create(t,this._value());case 7:return this._advance(),ML.create(t,this._value());case 8:return this._advance(),RL.create(t,this._value());case 13:return this._advance(),xe.in(t,this._value());default:return xe.has(t)}}case 20:throw this._parsingErrors.push({message:oge,offset:e.offset,lexeme:"",additionalInfo:rge}),T0._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const s=m("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,Sa.getLexeme(t)),o=t.offset,r=Sa.getLexeme(t);return this._parsingErrors.push({message:s,offset:o,lexeme:r,additionalInfo:i}),I0._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};F$._parseError=new Error;class xe{static false(){return us.INSTANCE}static true(){return Ps.INSTANCE}static has(e){return Df.create(e)}static equals(e,t){return h1.create(e,t)}static notEquals(e,t){return SL.create(e,t)}static regex(e,t){return gb.create(e,t)}static in(e,t){return yL.create(e,t)}static notIn(e,t){return CL.create(e,t)}static not(e){return kf.create(e)}static and(...e){return rh.create(e,null,!0)}static or(...e){return Tl.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}xe._parser=new F$({regexParsingWithErrorRecovery:!1});function Hfe(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function a_(n,e){return n.cmp(e)}class us{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 Ps.INSTANCE}}us.INSTANCE=new us;class Ps{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 us.INSTANCE}}Ps.INSTANCE=new Ps;class Df{static create(e,t=null){const i=Bn.get(e);return typeof i=="boolean"?i?Ps.INSTANCE:us.INSTANCE:new Df(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:W$(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bn.get(this.key);return typeof e=="boolean"?e?Ps.INSTANCE:us.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=kf.create(this.key,this)),this.negated}}class h1{static create(e,t,i=null){if(typeof t=="boolean")return t?Df.create(e,i):kf.create(e,i);const s=Bn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Ps.INSTANCE:us.INSTANCE:new h1(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:Ef(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=Bn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ps.INSTANCE:us.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=SL.create(this.key,this.value,this)),this.negated}}class yL{static create(e,t){return new yL(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:Ef(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?Nfe.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=CL.create(this.key,this.valueKey)),this.negated}}class CL{static create(e,t){return new CL(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=yL.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}}class SL{static create(e,t,i=null){if(typeof t=="boolean")return t?kf.create(e,i):Df.create(e,i);const s=Bn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?us.INSTANCE:Ps.INSTANCE:new SL(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Ef(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=Bn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?us.INSTANCE:Ps.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=h1.create(this.key,this.value,this)),this.negated}}class kf{static create(e,t=null){const i=Bn.get(e);return typeof i=="boolean"?i?us.INSTANCE:Ps.INSTANCE:new kf(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:W$(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Bn.get(this.key);return typeof e=="boolean"?e?us.INSTANCE:Ps.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Df.create(this.key,this)),this.negated}}function xL(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):us.INSTANCE}class LL{static create(e,t,i=null){return xL(t,s=>new LL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=EL.create(this.key,this.value,this)),this.negated}}class DL{static create(e,t,i=null){return xL(t,s=>new DL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=kL.create(this.key,this.value,this)),this.negated}}class kL{static create(e,t,i=null){return xL(t,s=>new kL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new EL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=LL.create(this.key,this.value,this)),this.negated}}class gb{static create(e,t){return new gb(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l4.create(this)),this.negated}}class l4{static create(e){return new l4(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function B$(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=s[s.length-1];if(r.type!==9)break;s.pop();const a=s.pop(),l=s.length===0,c=Tl.create(r.expr.map(d=>rh.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(a_))}if(s.length===1)return s[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Tl.create(e,this,!0)}return this.negated}}class Tl{static create(e,t,i){return Tl._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const o of fF(t))for(const r of fF(i))s.push(rh.create([o,r],null,!1));e.unshift(Tl.create(s,null,!1))}this.negated=Tl.create(e,this,!0)}return this.negated}}class me extends Df{static all(){return me._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?me._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&me._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return h1.create(this.key,e)}}me._info=[];const Je=at("contextKeyService");function W$(n,e){return ne?1:0}function Ef(n,e,t,i){return nt?1:ei?1:0}function pA(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?hF(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(pA(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return hF(e.expr,n.expr);for(const t of n.expr)if(pA(t,e))return!0;return!1}return n.equals(e)}function hF(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new Ak([gw(t,e),gw(i,e)]):new Ak([gw(t,e)])}else{const t=[];for(let i=0;i{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(qfe)),this._cachedMergedKeybindings.slice(0)}}const Os=new d4,jfe={EditorModes:"platform.keybindingsRegistry"};mn.add(jfe.EditorModes,Os);function qfe(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var Gfe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gF=function(n,e){return function(t,i){e(t,i,n)}},Kfe=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);st===e}}Nl._all=new Map;const or=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ehe({merge:Nl.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Nl.for(A.CommandPalette)),Ke(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Nl.for(A.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new ks,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Nl.for(n)),Ke(()=>{i(),this._onDidChangeMenu.fire(Nl.for(n))})}appendMenuItems(n){const e=new fe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===A.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)A0(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class eS extends vL{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let qa=My=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r){var a,l;this.hideActions=s,this._commandService=r,this.id=e.id,this.label=My.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Ae.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Ae.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new My(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&Ae.asClassName(c)}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};qa=My=Gfe([gF(4,Je),gF(5,gs)],qa);class Nm{constructor(e){this.desc=e}}function Fs(n){const e=new fe,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=Kfe(i,["f1","menu","keybinding","description"]);if(e.add(qt.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(o))for(const c of o)e.add(or.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(or.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(or.appendMenuItem(A.CommandPalette,{command:l,when:l.precondition})),e.add(or.addCommand(l))),Array.isArray(r))for(const c of r)e.add(Os.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?xe.and(l.precondition,c.when):c.when})));else r&&e.add(Os.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?xe.and(l.precondition,r.when):r.when})));return e}const cc=at("telemetryService"),dc=at("logService");var yn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(yn||(yn={}));const H$=yn.Info;class z$ extends K{constructor(){super(...arguments),this.level=H$,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==yn.Off&&this.level<=e}}class Zfe extends z${constructor(e=H$,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(yn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(yn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(yn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(yn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(yn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class Xfe extends z${constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function Qfe(n){switch(n){case yn.Trace:return"trace";case yn.Debug:return"debug";case yn.Info:return"info";case yn.Warning:return"warn";case yn.Error:return"error";case yn.Off:return"off"}}new me("logLevel",Qfe(yn.Info));const u4={clipboard:{writeText:Yg||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Yg||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Yg||Sfe()?0:navigator.keyboard||oc?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function Jfe(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return Al.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(mr)switch(e){case 59:return 85;case 60:if(Zn)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(gt)return 57;break}else if(kh){if(gt&&e===93)return 57;if(!gt&&e===92)return 57}return b$[e]||0}const ege=gt?256:2048,tge=512,ige=1024,nge=gt?2048:256;class Wt{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=Jfe(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=ege),this.altKey&&(t|=tge),this.shiftKey&&(t|=ige),this.metaKey&&(t|=nge),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ef(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let pF=!1,Xm=null;function sge(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return pF=!0,null}catch{return pF=!0,null}return n.parent}class oge{static getSameOriginWindowChain(){if(!Xm){Xm=[];let e=window,t;do t=sge(e),t?Xm.push({window:e,iframeElement:e.frameElement||null}):Xm.push({window:e,iframeElement:null}),e=t;while(e)}return Xm.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0;const o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,s+=r.window.scrollX,r.window===t||!r.iframeElement)break;const a=r.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class rr{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=oge.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class tf{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?mr&&!gt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")oc&&Rs?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?mr&&!gt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:$$,setPrototypeOf:mF,isFrozen:rge,getPrototypeOf:age,getOwnPropertyDescriptor:lge}=Object;let{freeze:Qs,seal:Jr,create:cge}=Object,{apply:_A,construct:bA}=typeof Reflect<"u"&&Reflect;_A||(_A=function(e,t,i){return e.apply(t,i)});Qs||(Qs=function(e){return e});Jr||(Jr=function(e){return e});bA||(bA=function(e,t){return new e(...t)});const dge=_r(Array.prototype.forEach),_F=_r(Array.prototype.pop),Qm=_r(Array.prototype.push),Ry=_r(String.prototype.toLowerCase),Nk=_r(String.prototype.toString),uge=_r(String.prototype.match),Ir=_r(String.prototype.replace),hge=_r(String.prototype.indexOf),fge=_r(String.prototype.trim),Ao=_r(RegExp.prototype.test),Jm=gge(TypeError);function _r(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),vge=Jr(/\${[\w\W]*}/gm),wge=Jr(/^data-[\-\w.\u00B7-\uFFFF]/),yge=Jr(/^aria-[\-\w]+$/),U$=Jr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cge=Jr(/^(?:\w+script|data):/i),Sge=Jr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j$=Jr(/^html$/i);var CF=Object.freeze({__proto__:null,MUSTACHE_EXPR:_ge,ERB_EXPR:bge,TMPLIT_EXPR:vge,DATA_ATTR:wge,ARIA_ATTR:yge,IS_ALLOWED_URI:U$,IS_SCRIPT_OR_DATA:Cge,ATTR_WHITESPACE:Sge,DOCTYPE_NAME:j$});const xge=()=>typeof window>"u"?null:window,Lge=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function q$(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xge();const e=qe=>q$(qe);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:s}=n;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=n,g=l.prototype,p=pw(g,"cloneNode"),_=pw(g,"nextSibling"),v=pw(g,"childNodes"),b=pw(g,"parentNode");if(typeof r=="function"){const qe=s.createElement("template");qe.content&&qe.content.ownerDocument&&(s=qe.content.ownerDocument)}let w,y="";const{implementation:S,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:D}=s,{importNode:k}=t;let O={};e.isSupported=typeof $$=="function"&&typeof b=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:R,ERB_EXPR:P,TMPLIT_EXPR:M,DATA_ATTR:$,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:ce}=CF;let{IS_ALLOWED_URI:ge}=CF,se=null;const Se=Ct({},[...bF,...Mk,...Rk,...Pk,...vF]);let Ie=null;const pe=Ct({},[...wF,...Ok,...yF,...mw]);let ee=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gt=null,xt=null,It=!0,je=!0,ei=!1,De=!0,Be=!1,he=!1,ue=!1,xi=!1,Lt=!1,Et=!1,pi=!1,Zo=!0,_u=!1;const OD="user-content-";let Z=!0,j=!1,U={},I=null;const T=Ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let W=null;const F=Ct({},["audio","video","img","source","image","track"]);let X=null;const ae=Ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Le="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let Pe=Ve,At=!1,Dt=null;const Ne=Ct({},[Ce,Le,Ve],Nk);let ai;const li=["application/xhtml+xml","text/html"],Xo="text/html";let wt,Fi=null;const bu=s.createElement("form"),vu=function(q){return q instanceof RegExp||q instanceof Function},Lr=function(q){if(!(Fi&&Fi===q)){if((!q||typeof q!="object")&&(q={}),q=Qf(q),ai=li.indexOf(q.PARSER_MEDIA_TYPE)===-1?ai=Xo:ai=q.PARSER_MEDIA_TYPE,wt=ai==="application/xhtml+xml"?Nk:Ry,se="ALLOWED_TAGS"in q?Ct({},q.ALLOWED_TAGS,wt):Se,Ie="ALLOWED_ATTR"in q?Ct({},q.ALLOWED_ATTR,wt):pe,Dt="ALLOWED_NAMESPACES"in q?Ct({},q.ALLOWED_NAMESPACES,Nk):Ne,X="ADD_URI_SAFE_ATTR"in q?Ct(Qf(ae),q.ADD_URI_SAFE_ATTR,wt):ae,W="ADD_DATA_URI_TAGS"in q?Ct(Qf(F),q.ADD_DATA_URI_TAGS,wt):F,I="FORBID_CONTENTS"in q?Ct({},q.FORBID_CONTENTS,wt):T,Gt="FORBID_TAGS"in q?Ct({},q.FORBID_TAGS,wt):{},xt="FORBID_ATTR"in q?Ct({},q.FORBID_ATTR,wt):{},U="USE_PROFILES"in q?q.USE_PROFILES:!1,It=q.ALLOW_ARIA_ATTR!==!1,je=q.ALLOW_DATA_ATTR!==!1,ei=q.ALLOW_UNKNOWN_PROTOCOLS||!1,De=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=q.SAFE_FOR_TEMPLATES||!1,he=q.WHOLE_DOCUMENT||!1,Lt=q.RETURN_DOM||!1,Et=q.RETURN_DOM_FRAGMENT||!1,pi=q.RETURN_TRUSTED_TYPE||!1,xi=q.FORCE_BODY||!1,Zo=q.SANITIZE_DOM!==!1,_u=q.SANITIZE_NAMED_PROPS||!1,Z=q.KEEP_CONTENT!==!1,j=q.IN_PLACE||!1,ge=q.ALLOWED_URI_REGEXP||U$,Pe=q.NAMESPACE||Ve,ee=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&vu(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&vu(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(je=!1),Et&&(Lt=!0),U&&(se=Ct({},[...vF]),Ie=[],U.html===!0&&(Ct(se,bF),Ct(Ie,wF)),U.svg===!0&&(Ct(se,Mk),Ct(Ie,Ok),Ct(Ie,mw)),U.svgFilters===!0&&(Ct(se,Rk),Ct(Ie,Ok),Ct(Ie,mw)),U.mathMl===!0&&(Ct(se,Pk),Ct(Ie,yF),Ct(Ie,mw))),q.ADD_TAGS&&(se===Se&&(se=Qf(se)),Ct(se,q.ADD_TAGS,wt)),q.ADD_ATTR&&(Ie===pe&&(Ie=Qf(Ie)),Ct(Ie,q.ADD_ATTR,wt)),q.ADD_URI_SAFE_ATTR&&Ct(X,q.ADD_URI_SAFE_ATTR,wt),q.FORBID_CONTENTS&&(I===T&&(I=Qf(I)),Ct(I,q.FORBID_CONTENTS,wt)),Z&&(se["#text"]=!0),he&&Ct(se,["html","head","body"]),se.table&&(Ct(se,["tbody"]),delete Gt.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Jm('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Jm('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=q.TRUSTED_TYPES_POLICY,y=w.createHTML("")}else w===void 0&&(w=Lge(f,i)),w!==null&&typeof y=="string"&&(y=w.createHTML(""));Qs&&Qs(q),Fi=q}},_c=Ct({},["mi","mo","mn","ms","mtext"]),wu=Ct({},["foreignobject","desc","title","annotation-xml"]),yu=Ct({},["title","style","font","a","script"]),Uf=Ct({},Mk);Ct(Uf,Rk),Ct(Uf,pge);const Cu=Ct({},Pk);Ct(Cu,mge);const FD=function(q){let _e=b(q);(!_e||!_e.tagName)&&(_e={namespaceURI:Pe,tagName:"template"});const Te=Ry(q.tagName),ci=Ry(_e.tagName);return Dt[q.namespaceURI]?q.namespaceURI===Le?_e.namespaceURI===Ve?Te==="svg":_e.namespaceURI===Ce?Te==="svg"&&(ci==="annotation-xml"||_c[ci]):!!Uf[Te]:q.namespaceURI===Ce?_e.namespaceURI===Ve?Te==="math":_e.namespaceURI===Le?Te==="math"&&wu[ci]:!!Cu[Te]:q.namespaceURI===Ve?_e.namespaceURI===Le&&!wu[ci]||_e.namespaceURI===Ce&&!_c[ci]?!1:!Cu[Te]&&(yu[Te]||!Uf[Te]):!!(ai==="application/xhtml+xml"&&Dt[q.namespaceURI]):!1},la=function(q){Qm(e.removed,{element:q});try{q.parentNode.removeChild(q)}catch{q.remove()}},zm=function(q,_e){try{Qm(e.removed,{attribute:_e.getAttributeNode(q),from:_e})}catch{Qm(e.removed,{attribute:null,from:_e})}if(_e.removeAttribute(q),q==="is"&&!Ie[q])if(Lt||Et)try{la(_e)}catch{}else try{_e.setAttribute(q,"")}catch{}},$m=function(q){let _e,Te;if(xi)q=""+q;else{const Qo=uge(q,/^[\r\n\t ]+/);Te=Qo&&Qo[0]}ai==="application/xhtml+xml"&&Pe===Ve&&(q=''+q+"");const ci=w?w.createHTML(q):q;if(Pe===Ve)try{_e=new h().parseFromString(ci,ai)}catch{}if(!_e||!_e.documentElement){_e=S.createDocument(Pe,"template",null);try{_e.documentElement.innerHTML=At?y:ci}catch{}}const Hn=_e.body||_e.documentElement;return q&&Te&&Hn.insertBefore(s.createTextNode(Te),Hn.childNodes[0]||null),Pe===Ve?D.call(_e,he?"html":"body")[0]:he?_e.documentElement:Hn},V1=function(q){return L.call(q.ownerDocument||q,q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},YK=function(q){return q instanceof u&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof d)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},H1=function(q){return typeof a=="object"?q instanceof a:q&&typeof q=="object"&&typeof q.nodeType=="number"&&typeof q.nodeName=="string"},rl=function(q,_e,Te){O[q]&&dge(O[q],ci=>{ci.call(e,_e,Te,Fi)})},m3=function(q){let _e;if(rl("beforeSanitizeElements",q,null),YK(q))return la(q),!0;const Te=wt(q.nodeName);if(rl("uponSanitizeElement",q,{tagName:Te,allowedTags:se}),q.hasChildNodes()&&!H1(q.firstElementChild)&&(!H1(q.content)||!H1(q.content.firstElementChild))&&Ao(/<[/\w]/g,q.innerHTML)&&Ao(/<[/\w]/g,q.textContent))return la(q),!0;if(!se[Te]||Gt[Te]){if(!Gt[Te]&&b3(Te)&&(ee.tagNameCheck instanceof RegExp&&Ao(ee.tagNameCheck,Te)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Te)))return!1;if(Z&&!I[Te]){const ci=b(q)||q.parentNode,Hn=v(q)||q.childNodes;if(Hn&&ci){const Qo=Hn.length;for(let zi=Qo-1;zi>=0;--zi)ci.insertBefore(p(Hn[zi],!0),_(q))}}return la(q),!0}return q instanceof l&&!FD(q)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&Ao(/<\/no(script|embed|frames)/i,q.innerHTML)?(la(q),!0):(Be&&q.nodeType===3&&(_e=q.textContent,_e=Ir(_e,R," "),_e=Ir(_e,P," "),_e=Ir(_e,M," "),q.textContent!==_e&&(Qm(e.removed,{element:q.cloneNode()}),q.textContent=_e)),rl("afterSanitizeElements",q,null),!1)},_3=function(q,_e,Te){if(Zo&&(_e==="id"||_e==="name")&&(Te in s||Te in bu))return!1;if(!(je&&!xt[_e]&&Ao($,_e))){if(!(It&&Ao(Y,_e))){if(!Ie[_e]||xt[_e]){if(!(b3(q)&&(ee.tagNameCheck instanceof RegExp&&Ao(ee.tagNameCheck,q)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(q))&&(ee.attributeNameCheck instanceof RegExp&&Ao(ee.attributeNameCheck,_e)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(_e))||_e==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Ao(ee.tagNameCheck,Te)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Te))))return!1}else if(!X[_e]){if(!Ao(ge,Ir(Te,ce,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&q!=="script"&&hge(Te,"data:")===0&&W[q])){if(!(ei&&!Ao(ne,Ir(Te,ce,"")))){if(Te)return!1}}}}}}return!0},b3=function(q){return q.indexOf("-")>0},v3=function(q){let _e,Te,ci,Hn;rl("beforeSanitizeAttributes",q,null);const{attributes:Qo}=q;if(!Qo)return;const zi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie};for(Hn=Qo.length;Hn--;){_e=Qo[Hn];const{name:ca,namespaceURI:BD}=_e;if(Te=ca==="value"?_e.value:fge(_e.value),ci=wt(ca),zi.attrName=ci,zi.attrValue=Te,zi.keepAttr=!0,zi.forceKeepAttr=void 0,rl("uponSanitizeAttribute",q,zi),Te=zi.attrValue,zi.forceKeepAttr||(zm(ca,q),!zi.keepAttr))continue;if(!De&&Ao(/\/>/i,Te)){zm(ca,q);continue}Be&&(Te=Ir(Te,R," "),Te=Ir(Te,P," "),Te=Ir(Te,M," "));const w3=wt(q.nodeName);if(_3(w3,ci,Te)){if(_u&&(ci==="id"||ci==="name")&&(zm(ca,q),Te=OD+Te),w&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!BD)switch(f.getAttributeType(w3,ci)){case"TrustedHTML":{Te=w.createHTML(Te);break}case"TrustedScriptURL":{Te=w.createScriptURL(Te);break}}try{BD?q.setAttributeNS(BD,ca,Te):q.setAttribute(ca,Te),_F(e.removed)}catch{}}}rl("afterSanitizeAttributes",q,null)},ZK=function qe(q){let _e;const Te=V1(q);for(rl("beforeSanitizeShadowDOM",q,null);_e=Te.nextNode();)rl("uponSanitizeShadowNode",_e,null),!m3(_e)&&(_e.content instanceof o&&qe(_e.content),v3(_e));rl("afterSanitizeShadowDOM",q,null)};return e.sanitize=function(qe){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e,Te,ci,Hn;if(At=!qe,At&&(qe=""),typeof qe!="string"&&!H1(qe))if(typeof qe.toString=="function"){if(qe=qe.toString(),typeof qe!="string")throw Jm("dirty is not a string, aborting")}else throw Jm("toString is not a function");if(!e.isSupported)return qe;if(ue||Lr(q),e.removed=[],typeof qe=="string"&&(j=!1),j){if(qe.nodeName){const ca=wt(qe.nodeName);if(!se[ca]||Gt[ca])throw Jm("root node is forbidden and cannot be sanitized in-place")}}else if(qe instanceof a)_e=$m(""),Te=_e.ownerDocument.importNode(qe,!0),Te.nodeType===1&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?_e=Te:_e.appendChild(Te);else{if(!Lt&&!Be&&!he&&qe.indexOf("<")===-1)return w&&pi?w.createHTML(qe):qe;if(_e=$m(qe),!_e)return Lt?null:pi?y:""}_e&&xi&&la(_e.firstChild);const Qo=V1(j?qe:_e);for(;ci=Qo.nextNode();)m3(ci)||(ci.content instanceof o&&ZK(ci.content),v3(ci));if(j)return qe;if(Lt){if(Et)for(Hn=x.call(_e.ownerDocument);_e.firstChild;)Hn.appendChild(_e.firstChild);else Hn=_e;return(Ie.shadowroot||Ie.shadowrootmode)&&(Hn=k.call(t,Hn,!0)),Hn}let zi=he?_e.outerHTML:_e.innerHTML;return he&&se["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Ao(j$,_e.ownerDocument.doctype.name)&&(zi=" -`+zi),Be&&(zi=Ir(zi,R," "),zi=Ir(zi,P," "),zi=Ir(zi,M," ")),w&&pi?w.createHTML(zi):zi},e.setConfig=function(qe){Lr(qe),ue=!0},e.clearConfig=function(){Fi=null,ue=!1},e.isValidAttribute=function(qe,q,_e){Fi||Lr({});const Te=wt(qe),ci=wt(q);return _3(Te,ci,_e)},e.addHook=function(qe,q){typeof q=="function"&&(O[qe]=O[qe]||[],Qm(O[qe],q))},e.removeHook=function(qe){if(O[qe])return _F(O[qe])},e.removeHooks=function(qe){O[qe]&&(O[qe]=[])},e.removeAllHooks=function(){O={}},e}var sl=q$();sl.version;sl.isSupported;const G$=sl.sanitize;sl.setConfig;sl.clearConfig;sl.isValidAttribute;const K$=sl.addHook,Y$=sl.removeHook;sl.removeHooks;sl.removeAllHooks;var it;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(it||(it={}));const Dge="tkn";class kge{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${it.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return pt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${Dge}=${encodeURIComponent(o)}`),$e.from({scheme:Em?this._preferredWebSchema:it.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:r})}}const Z$=new kge;class mb{uriToBrowserUri(e){return e.scheme===it.vscodeRemote?Z$.rewrite(e):e.scheme===it.file&&(Yg||yue&&dr.origin===`${it.vscodeFileResource}://${mb.FALLBACK_AUTHORITY}`)?e.with({scheme:it.vscodeFileResource,authority:e.authority||mb.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}mb.FALLBACK_AUTHORITY="vscode-app";const X$=new mb;var SF;(function(n){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"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:$e.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=s})(SF||(SF={}));const{registerWindow:O4e,getWindows:Ege,onDidCreateWindow:F4e}=function(){const n=[],e=new B;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new fe;return i.add(Ke(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Do(n){for(;n.firstChild;)n.firstChild.remove()}function h4(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Ige{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function G(n,e,t,i){return new Ige(n,e,t,i)}function Q$(n){return function(e){return n(new rr(e))}}function Age(n){return function(e){return n(new Wt(e))}}const Hi=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=Q$(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Age(i)),G(e,t,o,s)},Tge=function(e,t,i){const s=Q$(t);return Nge(e,s,i)};function Nge(n,e,t){return G(n,Bd&&u4.pointerEvents?le.POINTER_DOWN:le.MOUSE_DOWN,e,t)}let J$,$o;class Fk{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){pt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(Fk.sort),e.shift().execute();i=!1};$o=(o,r=0)=>{const a=new Fk(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},J$=(o,r)=>{if(i){const a=new Fk(o,r);return e.push(a),a}else return $o(o,r)}})();function IL(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function AL(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new Zt(n.clientWidth,n.clientHeight);if(Bd&&(i!=null&&i.visualViewport))return new Zt(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new Zt(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Zt(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Zt(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class hi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=IL(e),o=s?s.getPropertyValue(t):"0";return hi.convertToPixels(e,o)}static getBorderLeftWidth(e){return hi.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return hi.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return hi.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return hi.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return hi.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return hi.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return hi.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return hi.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return hi.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return hi.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return hi.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return hi.getDimension(e,"margin-bottom","marginBottom")}}class Zt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Zt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Zt?e:new Zt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Zt.None=new Zt(0,0);function eU(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=tU(n)?null:IL(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=hi.getBorderLeftWidth(n),t+=hi.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Nn(n){var e,t,i,s;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((s=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&s!==void 0?s:0),width:o.width,height:o.height}}function Mge(n){let e=n,t=1;do{const i=IL(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ys(n){const e=hi.getMarginLeft(n)+hi.getMarginRight(n);return n.offsetWidth+e}function Bk(n){const e=hi.getBorderLeftWidth(n)+hi.getBorderRightWidth(n),t=hi.getPaddingLeft(n)+hi.getPaddingRight(n);return n.offsetWidth-e-t}function Rge(n){const e=hi.getBorderTopWidth(n)+hi.getBorderBottomWidth(n),t=hi.getPaddingTop(n)+hi.getPaddingBottom(n);return n.offsetHeight-e-t}function ah(n){const e=hi.getMarginTop(n)+hi.getMarginBottom(n);return n.offsetHeight+e}function Cn(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function Pge(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function Wk(n,e,t){return!!Pge(n,e,t)}function tU(n){return n&&!!n.host&&!!n.mode}function vA(n){return!!Zp(n)}function Zp(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return tU(n)?n:null}function Gr(){let n=Oge().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function Oge(){var n;return(n=[document,...Ege().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function br(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let Vk=null;function iU(){return Vk||(Vk=br()),Vk}function Fge(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function wA(n,e,t=iU()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function xF(n,e=iU()){if(!e)return;const t=Fge(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function f4(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const le={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:kh?"webkitAnimationStart":"animationstart",ANIMATION_END:kh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:kh?"webkitAnimationIteration":"animationiteration"};function Bge(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const ze={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function Wge(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function Vge(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class tS extends K{static hasFocusWithin(e){if(f4(e)){const t=Zp(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Cn(i,e)}else return Cn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=tS.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{tS.hasFocusWithin(e)!==t&&(t?o():s())},this._register(G(e,le.FOCUS,s,!0)),this._register(G(e,le.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(G(e,le.FOCUS_IN,()=>this._refreshStateHandler())),this._register(G(e,le.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Vd(n){return new tS(n)}function re(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function nU(n,e){return n.insertBefore(e,n.firstChild),e}function ds(n,...e){n.innerText="",re(n,...e)}const Hge=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var _b;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(_b||(_b={}));function sU(n,e,t,...i){const s=Hge.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==_b.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function we(n,e,...t){return sU(_b.HTML,n,e,...t)}we.SVG=function(n,e,...t){return sU(_b.SVG,n,e,...t)};function zge(n,...e){n?Ih(...e):qc(...e)}function Ih(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function qc(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function LF(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function oU(n){window.open(n,"_blank","noopener")}function $ge(n){const e=()=>{n(),t=$o(e)};let t=$o(e);return Ke(()=>t.dispose())}Z$.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Hd(n){return n?`url('${X$.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function DF(n){return`'${n.replace(/'/g,"%27")}'`}function Ah(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Ah(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function Uge(n,e=!1){const t=document.createElement("a");return K$("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ke(()=>{Y$("afterSanitizeAttributes")})}const jge=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Gc extends B{constructor(){super(),this._subscriptions=new fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(G(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Wt(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(G(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(G(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(G(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(G(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(G(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Gc.instance||(Gc.instance=new Gc),Gc.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class qge extends K{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(G(this.element,le.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(G(this.element,le.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(G(this.element,le.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(G(this.element,le.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(G(this.element,le.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const Gge=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function dn(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=Gge.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),i)for(const c of i)c instanceof HTMLElement?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,h]of Object.entries(d))r.style.setProperty(kF(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(kF(c),d.toString());return l.root=r,l}function kF(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class TL{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=xe.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Os.registerKeybindingRule(s)}}qt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){or.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class g4 extends TL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Je).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return vr.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Yt extends vr{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=A.EditorContext),s.title||(s.title=e.label),s.when=xe.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Yt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(cc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class aU extends Yt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;const l=o.get(Je),c=o.get(dc);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,s,...t)})}}function Mm(n,e){qt.registerCommand(n,function(t,...i){const s=t.get(bt),[o,r]=i;Ls($e.isUri(o)),Ls(V.isIPosition(r));const a=t.get(fs).getModel(o);if(a){const l=V.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(au).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,V.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function ke(n){return Ro.INSTANCE.registerEditorCommand(n),n}function Ye(n){const e=new n;return Ro.INSTANCE.registerEditorAction(e),e}function lU(n){return Ro.INSTANCE.registerEditorAction(n),n}function Yge(n){Ro.INSTANCE.registerEditorAction(n)}function Cr(n,e,t){Ro.INSTANCE.registerEditorContribution(n,e,t)}var Jg;(function(n){function e(r){return Ro.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return Ro.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Ro.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return Ro.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return Ro.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(Jg||(Jg={}));const Zge={EditorCommonContributions:"editor.contributions"};class Ro{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Ro.INSTANCE=new Ro;mn.add(Zge.EditorCommonContributions,Ro.INSTANCE);function f1(n){return n.register(),n}const cU=f1(new g4({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:A.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));f1(new rU(cU,{id:"default:undo",precondition:void 0}));const dU=f1(new g4({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:A.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));f1(new rU(dU,{id:"default:redo",precondition:void 0}));const Xge=f1(new g4({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:A.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:A.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),uU=Symbol("MicrotaskDelay");var To=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},T0=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};function yA(n){return!!n&&typeof n.then=="function"}function uc(n){const e=new yr,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new Am)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function Qge(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class Jge{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}const epe=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},tpe=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class cu{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{var s;this.deferred=null,(s=this.doResolve)===null||s===void 0||s.call(this,null)};return this.deferred=t===uU?tpe(i):epe(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new Am),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class hU{constructor(e){this.delayer=new cu(e),this.throttler=new Jge}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function bb(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new Am)})}):uc(t=>bb(n,t))}function iS(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=Ke(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}class hc{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class g1{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class Ci{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Kc;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Kc=n=>{a$(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Kc=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class ipe{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Kc(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class fU{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Am)}}var CA;(function(n){function e(i){return To(this,void 0,void 0,function*(){let s;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o})}n.settled=e;function t(i){return new Promise((s,o)=>To(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(CA||(CA={}));class ln{static fromArray(e){return new ln(t=>{t.emitMany(e)})}static fromPromise(e){return new ln(t=>To(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new ln(t=>To(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>To(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new ln(t=>To(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return To(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=T0(i);r=yield o.next(),a=r.done,!a;s=!0){d=r.value,s=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!s&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new B,queueMicrotask(()=>To(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>To(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(eTo(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=T0(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;i.emitOne(t(u))}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}map(e){return ln.map(this,e)}static filter(e,t){return new ln(i=>To(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=T0(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;t(u)&&i.emitOne(u)}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}filter(e){return ln.filter(this,e)}static coalesce(e){return ln.filter(e,t=>!!t)}coalesce(){return ln.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return To(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=T0(e);s=yield i.next(),o=s.done,!o;t=!0){l=s.value,t=!1;const d=l;c.push(d)}}catch(d){r={error:d}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(r)throw r.error}}return c})}toPromise(){return ln.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ln.EMPTY=ln.fromArray([]);class npe extends ln{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function spe(n){const e=new yr,t=n(e.token);return new npe(e,i=>To(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new Am)});try{try{for(var c=!0,d=T0(t),u;u=yield d.next(),s=u.done,!s;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!s&&(r=d.return)&&(yield r.call(d))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const ope="$initialize";let EF=!1;function SA(n){Em&&(EF||(EF=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class rpe{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class IF{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class ape{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class lpe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class cpe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class dpe{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new rpe(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new ape(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new cpe(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new IF(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=ZO(s.detail)),this._send(new IF(this._workerId,t,void 0,ZO(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new lpe(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{s==null||s(d)})),this._protocol=new dpe({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(pU(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(gU(d)){const h=i[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=HR(i);this._onModuleLoaded=this._protocol.sendMessage(ope,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{s=u,this._onModuleLoaded.then(h=>{d(hpe(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function gU(n){return n[0]==="o"&&n[1]==="n"&&Mc(n.charCodeAt(2))}function pU(n){return/^onDynamic/.test(n)&&Mc(n.charCodeAt(9))}function hpe(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(pU(r)){o[r]=s(r);continue}if(gU(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function If(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){pt(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){pt(s);return}}const AF=If("defaultWorkerFactory",{createScriptURL:n=>n});function fpe(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(AF?AF.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function gpe(n){return typeof n.then=="function"}class ppe{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=fpe(i);gpe(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){s(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(s=>{try{s.postMessage(e,t)}catch(o){pt(o),pt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class NL{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++NL.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new ppe(e,s,this._label||"anonymous"+s,t,o=>{SA(o),this._webWorkerFailedBeforeError=o,i(o)})}}NL.LAST_WORKER_ID=0;var ss;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(ss||(ss={}));class Hk{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(r-1)===s;)r--;return new _pe(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class _pe{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function fa(n){return(n&3)!==0}class Xp{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Hk(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Hk({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Hk({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Xp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Xp.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}}Xp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> - `;Xp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const TF=typeof Buffer<"u";let zk;class p4{static wrap(e){return TF&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new p4(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return TF?this.buffer.toString():(zk||(zk=new TextDecoder),zk.decode(this.buffer))}}function bpe(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function vpe(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Pr(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function Or(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function NF(n,e){return n[e]}function MF(n,e,t){n[t]=e}let $k;function mU(){return $k||($k=new TextDecoder("UTF-16LE")),$k}let Uk;function wpe(){return Uk||(Uk=new TextDecoder("UTF-16BE")),Uk}let jk;function _U(){return jk||(jk=xue()?mU():wpe()),jk}function ype(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Cpe(n,e,t):mU().decode(i)}function Cpe(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},s=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:l})}return o}class xpe{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Spe(t);this.brackets=i.map((s,o)=>new nS(e,o,s.open,s.close,Lpe(s.open,s.close,i,o),Dpe(s.open,s.close,i,o))),this.forwardRegex=kpe(this.brackets),this.reversedRegex=Epe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function bU(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function vU(n,e){return n.length-e.length}function PL(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function Lpe(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return _U().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class tr{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=s+r;return new N(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=m4(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=s+r;return new N(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class Ape{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return Qh(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(fa(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=tr.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function _w(n){return n.global&&(n.lastIndex=0),!0}class Tpe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&_w(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&_w(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&_w(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&_w(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class xg{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=xg._createOpenBracketRegExp(t[0]),s=xg._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let o=0,r=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function Mpe(n){return n.replace(/[\[\]]/g,"")}const ki=at("languageService");class wa{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const CU=[];function ht(n,e,t){e instanceof wa||(e=new wa(e,[],!!t)),CU.push([n,e])}function PF(){return CU}const Ml=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),FL={JSONContribution:"base.contributions.json"};function Rpe(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class Ppe{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[Rpe(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Ope=new Ppe;mn.add(FL.JSONContribution,Ope);const Af={Configuration:"base.contributions.configuration"},t0="vscode://schemas/settings/resourceLanguage",OF=mn.as(FL.JSONContribution);class Fpe{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},OF.registerSchema(t0,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),OF.registerSchema(t0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const s=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),zd.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const f of Object.keys(o[a]))c.set(f,r);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});const u=Mpe(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:t0,defaultDefaultValue:d,source:Ms(r)?void 0:r,defaultValueSource:r};s.push(...sS(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(s)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,t=!0,i,s,o=3,r){var a;o=go(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&Vpe(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),zd.test(d)?u.scope=void 0:(u.scope=go(u.scope)?o:u.scope,u.restricted=go(u.restricted)?!!(s!=null&&s.includes(d)):u.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,i,s,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:m("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:t0};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),m("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i==null?void 0:i.value,o=i==null?void 0:i.source;Us(s)&&(s=t.defaultDefaultValue,o=void 0),Us(s)&&(s=Wpe(t.type)),t.default=s,t.defaultValueSource=o}}const SU="\\[([^\\]]+)\\]",FF=new RegExp(SU,"g"),Bpe=`^(${SU})+$`,zd=new RegExp(Bpe);function sS(n){const e=[];if(zd.test(n)){let t=FF.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=FF.exec(n)}}return Qh(e)}function Wpe(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Py=new Fpe;mn.add(Af.Configuration,Py);function Vpe(n,e){var t,i,s,o;return n.trim()?zd.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):Py.getConfigurationProperties()[n]!==void 0?m("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&Py.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?m("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(s=e.policy)===null||s===void 0?void 0:s.name,Py.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const Hpe={ModesRegistry:"editor.modesRegistry"};class zpe{constructor(){this._onDidChangeLanguages=new B,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new jpe(this,a,l),closing:l}}),o=new rF(a=>{const l=new Set,c=new Set;return{info:new qpe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?BF(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function BF(n){return n.filter(([e,t])=>e!==""&&t!=="")}class xU{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class jpe extends xU{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class qpe extends xU{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Gpe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},WF=function(n,e){return function(t,i){e(t,i,n)}};class qk{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const no=at("languageConfigurationService");let LA=class extends K{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Xpe),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(DA));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new qk(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new qk(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new qk(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Kpe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};LA=Gpe([WF(0,Jt),WF(1,ki)],LA);function Kpe(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new tp(n,{});s=new tp(n,{})}const o=Ype(s.languageId,t),r=DU([s.underlyingConfig,o]);return new tp(s.languageId,r)}const DA={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Ype(n,e){const t=e.getValue(DA.brackets,{overrideIdentifier:n}),i=e.getValue(DA.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:VF(t),colorizedBracketPairs:VF(i)}}function VF(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function LU(n,e,t){const i=n.getLineContent(e);let s=Vs(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function ep(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return ML(i,s)}class Zpe{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new HF(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ke(()=>{for(let s=0;se.configuration)))}}function DU(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class HF{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class zF{constructor(e){this.languageId=e}}class Xpe extends K{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register(Vo,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new Zpe(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new zF(e)),Ke(()=>{o.dispose(),this._onDidChange.fire(new zF(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class tp{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new xg(this.underlyingConfig):null,this.comments=tp._handleComments(this.underlyingConfig),this.characterPair=new Xp(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||UR,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Tpe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Upe(e,this.underlyingConfig)}getWordDefinition(){return d$(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new xpe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Ape(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new mpe(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ht(no,LA,1);class kc{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function Qpe(n){return BL(n,0)}function BL(n,e){switch(typeof n){case"object":return n===null?Vl(349,e):Array.isArray(n)?eme(n,e):tme(n,e);case"string":return _4(n,e);case"boolean":return Jpe(n,e);case"number":return Vl(n,e);case"undefined":return Vl(937,e);default:return Vl(617,e)}}function Vl(n,e){return(e<<5)-e+n|0}function Jpe(n,e){return Vl(n?433:863,e)}function _4(n,e){e=Vl(149417,e);for(let t=0,i=n.length;tBL(i,t),e)}function tme(n,e){return e=Vl(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=_4(i,t),BL(n[i],t)),e)}function Gk(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function $F(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):ime((n>>>0).toString(16),e/4)}class WL{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(tn(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),i0(this._h0)+i0(this._h1)+i0(this._h2)+i0(this._h3)+i0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,$F(this._buff,this._buffLen),this._buffLen>56&&(this._step(),$F(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=WL._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,Gk(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=s&o|~s&r,c=1518500249):u<40?(l=s^o^r,c=1859775393):u<60?(l=s&o|s&r|o&r,c=2400959708):(l=s^o^r,c=3395469782),d=Gk(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=Gk(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}WL._bigBlock32=new DataView(new ArrayBuffer(320));class UF{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new kc(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Rl{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Rl._getElements(e),[a,l,c]=Rl._getElements(t);this._hasStrings=r&&c,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Rl._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let u;return i<=s?(Jf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new kc(e,0,i,s-i+1)]):e<=t?(Jf.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new kc(e,t-e+1,i,0)]):(Jf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Jf.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,r,a,o),c=r[0],d=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,c,i,d,o);let h=[];return o[0]?h=[new kc(c+1,t-(c+1)+1,d+1,s-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,s,o),this.ConcatenateChanges(u,h)}return[new kc(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b){let w=null,y=null,S=new jF,L=t,x=i,D=f[0]-_[0]-s,k=-1073741824,O=this.m_forwardHistory.length-1;do{const R=D+e;R===L||R=0&&(c=this.m_forwardHistory[O],e=c[0],L=1,x=c.length-1)}while(--O>=-1);if(w=S.getReverseChanges(),b[0]){let R=f[0]+1,P=_[0]+1;if(w!==null&&w.length>0){const M=w[w.length-1];R=Math.max(R,M.getOriginalEnd()),P=Math.max(P,M.getModifiedEnd())}y=[new kc(R,h-R+1,P,p-P+1)]}else{S=new jF,L=r,x=a,D=f[0]-_[0]-l,k=1073741824,O=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const R=D+o;R===L||R=d[R+1]?(u=d[R+1]-1,g=u-D-l,u>k&&S.MarkNextChange(),k=u+1,S.AddOriginalElement(u+1,g+1),D=R+1-o):(u=d[R-1],g=u-D-l,u>k&&S.MarkNextChange(),k=u,S.AddModifiedElement(u+1,g+1),D=R-1-o),O>=0&&(d=this.m_reverseHistory[O],o=d[0],L=1,x=d.length-1)}while(--O>=-1);y=S.getChanges()}return this.ConcatenateChanges(w,y)}ComputeRecursionPoint(e,t,i,s,o,r,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(s-i),p=g+1,_=new Int32Array(p),v=new Int32Array(p),b=s-i,w=t-e,y=e-i,S=t-s,x=(w-b)%2===0;_[b]=e,v[w]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let k=0,O=0;d=this.ClipDiagonalBound(b-D,D,b,p),u=this.ClipDiagonalBound(b+D,D,b,p);for(let P=d;P<=u;P+=2){P===d||Pk+O&&(k=l,O=c),!x&&Math.abs(P-w)<=D-1&&l>=v[P])return o[0]=l,r[0]=c,M<=v[P]&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):null}const R=(k-e+(O-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,R))return a[0]=!0,o[0]=k,r[0]=O,R>0&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):(e++,i++,[new kc(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(w-D,D,w,p),f=this.ClipDiagonalBound(w+D,D,w,p);for(let P=h;P<=f;P+=2){P===h||P=v[P+1]?l=v[P+1]-1:l=v[P-1],c=l-(P-w)-S;const M=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[P]=l,x&&Math.abs(P-b)<=D&&l<=_[P])return o[0]=l,r[0]=c,M>=_[P]&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):null}if(D<=1447){let P=new Int32Array(u-d+2);P[0]=b-d+1,eg.Copy2(_,d,P,1,u-d+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=w-h+1,eg.Copy2(v,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const u=e[t-1];s=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,f=i.modifiedStart-u;if(hc&&(c=p,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return eg.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],eg.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return eg.Copy(e,0,s,0,e.length),eg.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(Jf.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Jf.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new kc(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function tg(n){return n<0?0:n>4294967295?4294967295:n|0}class sme{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=tg(e);const i=this.values,s=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=tg(e),t=tg(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=tg(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new kU(s,e-r)}}class ome{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new kU(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=gL(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class ame{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new ame(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let Kk=null;function cme(){return Kk===null&&(Kk=new lme([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Kk}let n0=null;function dme(){if(n0===null){n0=new p1(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=cme()){const i=dme(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,_=!1;for(;c=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}kA.INSTANCE=new kA;class hme extends p1{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const Jp=fme(n=>new hme(n));var Uo;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Uo||(Uo={}));var ip;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(ip||(ip={}));var Ys;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Ys||(Ys={}));var em;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(em||(em={}));class Oy{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&So(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class vb{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function gme(n){return n&&typeof n.read=="function"}class Yk{constructor(e,t,i,s,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class pme{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class mme{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function _me(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const bme=999;class Ou{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=vme(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=I$(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 pme(t,this.wordSeparators?Jp(this.wordSeparators):null,i?this.searchString:null)}}function vme(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function Hu(n,e,t){if(!t)return new vb(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class bw{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Lg(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new N(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new qF(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=Hu(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,s),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,s,o){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,s,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const d=new Lg(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=Hu(new N(i,u.index+1+s,i,u.index+1+u[0].length+s),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Lg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new V(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new N(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new qF(l):null;i.reset(t.column-1);const d=i.next(l);return d?Hu(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new V(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,s);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,s);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?Hu(new N(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Lg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new N(1,1,t.lineNumber,t.column),i,s,10*bme);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new V(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,s);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,s);if(h)return h}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=Hu(new N(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function wme(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function yme(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==0)return!0}return!1}function b4(n,e,t,i,s){return wme(n,e,t,i,s)&&yme(n,e,t,i,s)}class Lg{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 s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){XC(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||b4(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class Cme{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new GF(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Sme(Array.from(a))}`,"g");const c=new Lg(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),w=b.length;c.reset(0);do if(h=c.next(b),h){let y=h.index,S=h.index+h[0].length;if(y>0){const k=b.charCodeAt(y-1);tn(k)&&y--}if(S+1=k){u=!0;break e}d.push(new N(_,y+1,_,S+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new GF(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=Jh.getLocales().filter(l=>!Jh.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Sme(n,e){return`[${pr(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class GF{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Jh.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of ud.codePoints)KF(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=n4(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!ud.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!KF(e)&&ud.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function KF(n){return n===" "||n===` -`||n===" "}class Fy{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class EU{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Ge{static addRange(e,t){let i=0;for(;it))return new Ge(e,t)}static ofLength(e){return new Ge(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new $i(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Ge(this.start+e,this.endExclusive+e)}deltaStart(e){return new Ge(this.start+e,this.endExclusive)}deltaEnd(e){return new Ge(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function EA(n,e,t){const i=xme(n,e);if(i!==-1)return n[i]}function xme(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function wb(n,e){const t=yb(n,e);return t===-1?void 0:n[t]}function yb(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function kme(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function Eme(n,e){return Dme(n,(t,i)=>-e(t,i))}function Ime(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}let Ze=class Ec{static fromRange(e){return new Ec(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new xa(e[0].slice());for(let i=1;it)throw new $i(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=yb(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=wb(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new Ze(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new xa(t)}subtractFrom(e){const t=Cb(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=yb(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new xa([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Ze(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class Ga{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new jo(new Ze(o,l.original.startLineNumber),new Ze(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new jo(new Ze(o,t+1),new Ze(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ga(this.modified,this.original)}join(e){return new Ga(this.original.join(e.original),this.modified.join(e.modified))}}class jo extends Ga{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new jo(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class $d{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new $d(this.modifiedRange,this.originalRange)}}const Ame=3;class Tme{computeDiff(e,t,i){var s;const r=new Rme(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new Ze(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Ze(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Ze(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Ze(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new jo(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new $d(new N(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new N(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new jo(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return pb(()=>V$(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class np{constructor(e,t,i,s,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new np(s,o,r,a,l,c,d,u)}}function Mme(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=IU(f,g,o,!0).changes;a&&(p=Mme(p)),h=[];for(let _=0,v=p.length;_1&&p>1;){const _=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(_!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,g,r+1,1,p)}{let g=AA(h,1),p=AA(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(un.fromOffsetPairs(s?s.getEndExclusives():Ta.zero,o?o.getStarts():new Ta(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new un(new Ge(e.offset1,t.offset1),new Ge(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new un(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new un(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new un(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new un(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new un(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new un(t,i)}getStarts(){return new Ta(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ta(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Ta{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Ta.zero=new Ta(0,0);Ta.max=new Ta(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Sb{isValid(){return!0}}Sb.instance=new Sb;class Pme{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new $i("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&r.get(g-1,p-1)===3&&(b+=a.get(g-1,p-1)),b+=s?s(g,p):1):b=-1;const w=Math.max(_,v,b);if(w===b){const y=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,y+1),r.set(g,p,3)}else w===_?(a.set(g,p,0),r.set(g,p,1)):w===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,w)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new un(new Ge(g+1,c),new Ge(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new Yl(l,!1)}}class AU{compute(e,t,i=Sb.instance){if(e.length===0||t.length===0)return Yl.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||y>o.length)continue;const S=r(w,y);l.set(d,S);const L=w===v?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new XF(L,w,y,S-w):L),l.get(d)===s.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=s.length,g=o.length;for(;;){const p=u?u.x+u.length:0,_=u?u.y+u.length:0;if((p!==f||_!==g)&&h.push(new un(new Ge(p,f),new Ge(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new Yl(h,!1)}}class XF{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class Fme{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 Bme{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}}var QF,JF;class Wme{constructor(e,t){this.uri=e,this.value=t}}function Vme(n){return Array.isArray(n)}class Tn{constructor(e,t){if(this[QF]="ResourceMap",e instanceof Tn)this.map=new Map(e.map),this.toKey=t??Tn.defaultToKey;else if(Vme(e)){this.map=new Map,this.toKey=t??Tn.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e??Tn.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Wme(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(QF=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Tn.defaultToKey=n=>n.toString();class Hme{constructor(){this[JF]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}[(JF=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class w4 extends Hme{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class zme{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class TU{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class aS{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Ge(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=t9(e>0?this.elements[e-1]:-1),i=t9(ei<=e);return new V(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return N.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!Xk(this.elements[e]))return;let t=e;for(;t>0&&Xk(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=Lme(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Ge(s,o)}}function Xk(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const $me={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function e9(n){return $me[n]}function t9(n){return n===10?7:n===13?6:TA(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function Ume(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=jme(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=qme(l,i,s,e,t,o);return fI(r,c),r=Gme(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` -`).length>=10),r=Kme(n,r),r}function jme(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new tm(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new tm(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),s.push(new Ga(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function qme(n,e,t,i,s,o){const r=[],a=new TU;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,ld));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const y of f)if(y.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){y.originalLineRange=new Ze(y.originalLineRange.startLineNumber,b.endLineNumberExclusive),y.modifiedLineRange=new Ze(y.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(y);return}const w={modifiedLineRange:_,originalLineRange:b};l.push(w),v.push(w)}),f=v}if(!o.isValid())return[]}l.sort(t$(cr(h=>h.modifiedLineRange.length,ld)));const c=new xa,d=new xa;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(p);for(const v of _.ranges){if(v.length<3)continue;const b=v,w=v.delta(-f);r.push(new Ga(w,b)),c.addRange(b),d.addRange(w)}}r.sort(cr(h=>h.original.startLineNumber,ld));const u=new m1(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=wb(n,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||x>s.length||c.contains(x)||d.contains(L)||!i9(i[L-1],s[x-1],o))break}y>0&&(d.addRange(new Ze(f.original.startLineNumber-y,f.original.startLineNumber)),c.addRange(new Ze(f.modified.startLineNumber-y,f.modified.startLineNumber)));let S;for(S=0;Si.length||x>s.length||c.contains(x)||d.contains(L)||!i9(i[L-1],s[x-1],o))break}S>0&&(d.addRange(new Ze(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),c.addRange(new Ze(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(y>0||S>0)&&(r[h]=new Ga(new Ze(f.original.startLineNumber-y,f.original.endLineNumberExclusive+S),new Ze(f.modified.startLineNumber-y,f.modified.endLineNumberExclusive+S)))}return r}function i9(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new AU().compute(new aS([n],new Ge(0,1),!1),new aS([e],new Ge(0,1),!1),t);let o=0;const r=un.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{TA(n.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;he.length?n:e);return o/l>.6&&l>10}function Gme(n){if(n.length===0)return n;n.sort(cr(t=>t.original.startLineNumber,ld));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function Kme(n,e){const t=new m1(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function Zme(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+ac&&(c=g,l=d)}return n.delta(l)}function Xme(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new un(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function Qme(n,e,t){const i=[];let s;function o(){if(!s)return;const a=s.s1Range.length-s.deleted;s.s2Range.length-s.added,Math.max(s.deleted,s.added)+(s.count-1)>a&&i.push(new un(s.s1Range,s.s2Range)),s=void 0}for(const a of t){let l=function(f,g){var p,_,v,b;if(!s||!s.s1Range.containsRange(f)||!s.s2Range.containsRange(g))if(s&&!(s.s1Range.endExclusive0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function e0e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(s++<10&&o);return i}function t0e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const v=n.getText(p).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),w=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),S=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),x=g.seq1Range.length,D=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,O=2*40+50;function R(P){return Math.min(P,O)}return Math.pow(Math.pow(R(b*40+w),1.5)+Math.pow(R(y*40+S),1.5),1.5)+Math.pow(Math.pow(R(L*40+x),1.5)+Math.pow(R(D*40+k),1.5),1.5)>Math.pow(Math.pow(O,1.5),1.5)*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(s++<10&&o);const r=[];return oue(i,(a,l,c)=>{let d=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new Ge(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Ge(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=un.fromOffsetPairs(a?a.getEndExclusives():Ta.zero,c?c.getStarts():Ta.max),_=d.intersect(p);r.push(_)}),r}class s9{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:o9(this.lines[e-1]),i=e===this.lines.length?0:o9(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function o9(n){let e=0;for(;eS===L))return new Fy([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Fy([new jo(new Ze(1,e.length+1),new Ze(1,t.length+1),[new $d(new N(1,1,e.length,e[0].length+1),new N(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Sb.instance:new Pme(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let L=r.get(S);return L===void 0&&(L=r.size,r.set(S,L)),L}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),d=new s9(l,e),u=new s9(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(S,L)=>e[S]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u))();let f=h.diffs,g=h.hitTimeout;f=NA(d,u,f),f=e0e(d,u,f);const p=[],_=S=>{if(o)for(let L=0;LS.seq1Range.start-v===S.seq2Range.start-b);const L=S.seq1Range.start-v;_(L),v=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const x=this.refineDiff(e,t,S,s,o);x.hitTimeout&&(g=!0);for(const D of x.mappings)p.push(D)}_(e.length-v);const w=r9(p,e,t);let y=[];return i.computeMoves&&(y=this.computeMoves(w,e,t,l,c,s,o)),pb(()=>{function S(x,D){if(x.lineNumber<1||x.lineNumber>D.length)return!1;const k=D[x.lineNumber-1];return!(x.column<1||x.column>k.length+1)}function L(x,D){return!(x.startLineNumber<1||x.startLineNumber>D.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>D.length+1)}for(const x of w){if(!x.innerChanges)return!1;for(const D of x.innerChanges)if(!(S(D.modifiedRange.getStartPosition(),t)&&S(D.modifiedRange.getEndPosition(),t)&&S(D.originalRange.getStartPosition(),e)&&S(D.originalRange.getEndPosition(),e)))return!1;if(!L(x.modified,t)||!L(x.original,e))return!1}return!0}),new Fy(w,y,g)}computeMoves(e,t,i,s,o,r,a){return Ume(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new un(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=r9(u.mappings,t,i,!0);return new EU(d,h)})}refineDiff(e,t,i,s,o){const r=new aS(e,i.seq1Range,o),a=new aS(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let c=l.diffs;return c=NA(r,a,c),c=Qme(r,a,c),c=Xme(r,a,c),c=t0e(r,a,c),{mappings:c.map(u=>new $d(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function r9(n,e,t,i=!1){const s=[];for(const o of Zz(n.map(r=>i0e(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new jo(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return pb(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:V$(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new Ze(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Ze(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new jo(o,r,[n])}const a9={getLegacy:()=>new Tme,getDefault:()=>new NU};function hd(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ut{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=hd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class ir{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=hd(Math.max(Math.min(1,t),0),3),this.l=hd(Math.max(Math.min(1,i),0),3),this.a=hd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,c=0;const d=(a+r)/2,u=r-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),r){case t:l=(i-s)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,l;if(i===0)r=a=l=s;else{const c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;r=ir._hue2rgb(d,c,t+1/3),a=ir._hue2rgb(d,c,t),l=ir._hue2rgb(d,c,t-1/3)}return new ut(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class Dg{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=hd(Math.max(Math.min(1,t),0),3),this.v=hd(Math.max(Math.min(1,i),0),3),this.a=hd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-s)/a%6+6)%6:o===i?c=(s-t)/a+2:c=(t-i)/a+4,new Dg(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),l=s-r;let[c,d,u]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,u=a):t<240?(d=a,u=r):t<300?(c=a,u=r):t<=360&&(c=r,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new ut(c,d,u,o)}}class H{static fromHex(e){return H.Format.CSS.parseHex(e)||H.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:ir.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Dg.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ut)this.rgba=e;else if(e instanceof ir)this._hsla=e,this.rgba=ir.toRGBA(e);else if(e instanceof Dg)this._hsva=e,this.rgba=Dg.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ut.equals(this.rgba,e.rgba)&&ir.equals(this.hsla,e.hsla)&&Dg.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=H._relativeLuminanceForComponent(this.rgba.r),t=H._relativeLuminanceForComponent(this.rgba.g),i=H._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return hd(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const s of i){const o=s.filter(c=>c!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=l9(s0(n,s),o0(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=l9(s0(n,s),o0(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=c9(s0(n,s),o0(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=c9(s0(n,s),o0(a,c),!0)}else r==="#"&&(l=n0e(s0(n,s),r+a));l&&e.push(l)}return e}function o0e(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:s0e(n)}var Cc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class r0e extends rme{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}class fd{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new r0e($e.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return Cc(this,void 0,void 0,function*(){const s=this._getModel(e);return s?Cme.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return Cc(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:fd.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?a9.getDefault():a9.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return Cc(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return N.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lfd._diffLimit){o.push({range:l,text:c});continue}const h=nme(u,c,i),f=s.offsetAt(N.lift(l).getStartPosition());for(const g of h){const p=s.positionAt(f+g.originalStart),_=s.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};s.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return Cc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?ume(t):null})}computeDefaultDocumentColors(e){return Cc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?o0e(t):null})}textualSuggest(e,t,i,s){return Cc(this,void 0,void 0,function*(){const o=new ou,r=new RegExp(i,s),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>fd._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return Cc(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(HR(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}fd._diffLimit=1e5;fd._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=E$());const RU=at("textResourceConfigurationService"),PU=at("textResourcePropertiesService"),nt=at("ILanguageFeaturesService");var a0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},r0=function(n,e){return function(t,i){e(t,i,n)}},lS=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const d9=60*1e3,u9=5*60*1e3;function zu(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let MA=class extends K{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new c0e(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>zu(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new l0e(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return zu(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return lS(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new EU(new Ga(new Ze(l[0],l[1]),new Ze(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new jo(new Ze(c[0],c[1]),new Ze(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new $d(new N(u[0],u[1],u[2],u[3]),new N(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(Gl(t)){if(!zu(this._modelService,e))return Promise.resolve(t);const s=ou.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,bb(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return zu(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return zu(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};MA=a0e([r0(0,fs),r0(1,RU),r0(2,dc),r0(3,no),r0(4,nt)],MA);class l0e{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return lS(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const s=[];if(i.wordBasedSuggestionsMode==="currentDocument")zu(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())zu(this._modelService,u.uri)&&(u===e?s.unshift(u.uri):(i.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&s.push(u.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new N(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):N.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class c0e extends K{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new g1).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(u9/2)),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>u9&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new OU(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class d0e extends K{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new g1;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(d9/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)Pt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>d9&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new fe;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ke(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Pt(t)}}class h9{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Qk{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class OU extends K{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new NL(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new upe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Qk(this)))}catch(e){SA(e),this._worker=new h9(new fd(new Qk(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(SA(e),this._worker=new h9(new fd(new Qk(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new d0e(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return lS(this,void 0,void 0,function*(){return this._disposed?Promise.reject(vhe()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return lS(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return s.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function u0e(n,e,t){return new h0e(n,e,t)}class h0e extends OU{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?HR(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const VL={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},xb=new class{clone(){return this}equals(n){return this===n}};function FU(n,e){return new XR([new db(0,"",n)],e)}function C4(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new _L(t,e===null?xb:e)}class $s{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),s&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;");let r="";return s&4&&(r+=" underline"),s&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class on{static createEmpty(e,t){const i=on.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new on(s,e,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 on?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=$s.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return $s.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return $s.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return $s.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return $s.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return $s.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return on.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new S4(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];o.push(s.length,c),r=l.offset}s+=l.text,o.push(s.length,l.tokenMetadata),i++}else break}return new on(new Uint32Array(o),s,this._languageIdCodec)}}on.defaultTokenMetadata=(32768|2<<24)>>>0;class S4{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof S4?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class ar{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[l++]=new ar(Math.max(1,c.startColumn-s+1),Math.min(r+1,c.endColumn-s+1),c.className,c.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:s;o[r++]=new ar(u,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ar._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class f0e{static normalize(e,t){if(t.length===0)return[];const i=[],s=new cS;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);tn(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);tn(p)&&d--}const f=c-1,g=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(g,u,h)}return s.consumeLowerThan(1073741824,o,i),i}}class nn{constructor(e,t,i,s){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class BU{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Rm{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,w){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ar.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=w&&w.sort((L,x)=>L.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=ya.getPartIndex(t),s=ya.getCharIndex(t);return new WU(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<<16|i<<0)>>>0;let o=0,r=this.length-1;for(;o+1>>1,_=this._data[p];if(_===s)return p;_>s?r=p:o=p}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===s)return o;if(l===s)return r;const c=ya.getPartIndex(a),d=ya.getCharIndex(a),u=ya.getPartIndex(l);let h;c!==u?h=t:h=ya.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class RA{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function x4(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,s=0;for(const r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(s|=1,t++),r.type===2&&(s|=2,i++));e.appendString("");const o=new ya(1,t+i);return o.setColumnInfo(1,t,0,0),new RA(o,!1,s)}return e.appendString(""),new RA(new ya(0,0),!1,0)}return C0e(m0e(n),e)}class g0e{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function HL(n){const e=new RL(1e4),t=x4(n,e);return new g0e(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class p0e{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=_}}function m0e(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(o[r++]=new nn(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?fb(n.substring(a,s)):!1;o[r++]=new nn(s,u,0,f);break}const h=e?fb(n.substring(a,d)):!1;o[r++]=new nn(d,u,0,h),a=d}return o}function b0e(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(s[o++]=new nn(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new nn(c,d,u,h))}else s[o++]=l;i=c}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function v0e(n,e){const t=[];let i=new nn(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new nn(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new nn(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new nn(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function w0e(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,u=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,f=[];let g=0,p=0,_=i[p].type,v=i[p].containsRTL,b=i[p].endIndex;const w=i.length;let y=!1,S=Ks(e),L;S===-1?(y=!0,S=t,L=t):L=Lf(e);let x=!1,D=0,k=c&&c[D],O=a%r;for(let P=o;P=k.endOffset&&(D++,k=c&&c[D]);let $;if(PL)$=!0;else if(M===9)$=!0;else if(M===32)if(d)if(x)$=!0;else{const Y=P+1P),$&&u&&($=y||P>L),$&&v&&P>=S&&P<=L&&($=!1),x){if(!$||!l&&O>=r){if(h){const Y=g>0?f[g-1].endIndex:o;for(let ne=Y+1;ne<=P;ne++)f[g++]=new nn(ne,"mtkw",1,!1)}else f[g++]=new nn(P,"mtkw",1,!1);O=O%r}}else(P===b||$&&P>o)&&(f[g++]=new nn(P,_,0,v),O=O%r);for(M===9?O=r:Wd(M)?O+=2:O++,x=$;P===b&&(p++,p0?e.charCodeAt(t-1):0,M=t>1?e.charCodeAt(t-2):0;P===32&&M!==32&&M!==9||(R=!0)}else R=!0;if(R)if(h){const P=g>0?f[g-1].endIndex:o;for(let M=P+1;M<=t;M++)f[g++]=new nn(M,"mtkw",1,!1)}else f[g++]=new nn(t,"mtkw",1,!1);else f[g++]=new nn(t,_,0,v);return f}function y0e(n,e,t,i){i.sort(ar.compare);const s=f0e.normalize(n,i),o=s.length;let r=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=b.startOffset,a[l++]=new nn(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new nn(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let k=0,O=c.length;k=d&&(Se+=pe)}}for(ne&&(e.appendString(' style="width:'),e.appendString(String(g*ge)),e.appendString('px"')),e.appendASCIICharCode(62);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let pe=2;pe<=Ie;pe++)e.appendCharCode(160)}else Se=2,Ie=1,e.appendCharCode(p),e.appendCharCode(8204);L+=Se,x+=Ie,y>=d&&(S+=Ie)}}else for(e.appendASCIICharCode(62);y=d&&(S+=Se)}ce?D++:D=0,y>=r&&!w&&R.isPseudoAfter()&&(w=!0,b.setColumnInfo(y+1,k,L,x)),e.appendString("")}return w||b.setColumnInfo(r+1,c.length-1,L,x),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",x0e(l))),e.appendString("")),e.appendString(""),new RA(b,f,s)}function S0e(n){return n.toString(16).toUpperCase().padStart(4,"0")}function x0e(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class g9{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class L0e{constructor(e,t){this.tabSize=e,this.data=t}}class L4{constructor(e,t,i,s,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class ko{constructor(e,t,i,s,o,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=ko.isBasicASCII(i,r),this.containsRTL=ko.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?n4(e):!0}static containsRTL(e,t,i){return!t&&i?fb(e):!1}}class c_{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class D0e{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new c_(new N(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class HU{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Lb{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ki(e.data,t.data)}static equalsArr(e,t){return Ki(e,t,Lb.equals)}}function k0e(n){return Array.isArray(n)}function E0e(n){return!k0e(n)}function zU(n){return typeof n=="string"}function p9(n){return!zU(n)}function fg(n){return!n}function gd(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function m9(n){return n.replace(/[&<>'"_]/g,"-")}function I0e(n,e){console.log(`${n.languageId}: ${e}`)}function Bt(n,e){return new Error(`${n.languageId}: ${e}`)}function Wc(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,c,d,u,h,f,g,p){return fg(c)?fg(d)?!fg(u)&&u0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function A0e(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var T0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},N0e=function(n,e){return function(t,i){e(t,i,n)}},PA;const $U=5;class Db{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new sp(e,t);let i=sp.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new sp(e,t),this._entries[i]=s,s)}}Db._INSTANCE=new Db($U);class sp{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return sp._equals(this,e)}push(e){return Db.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Db.create(this.parent,e)}}class kg{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new kg(this.languageId,this.state)}}class Vc{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new d_(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new d_(e,t);const i=sp.getStackElementId(e);let s=this._entries[i];return s||(s=new d_(e,null),this._entries[i]=s,s)}}Vc._INSTANCE=new Vc($U);class d_{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Vc.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof d_)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class M0e{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new db(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=vi.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const l=a.tokenize(e,t,r);if(s!==0)for(const c of l.tokens)this._tokens.push(new db(c.offset+s,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new XR(this._tokens,e)}}class dS{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=vi.get(t);if(i){if(i instanceof PA){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}vi.isResolved(t)||e.push(vi.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=Db.create(null,this._lexer.start);return Vc.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return FU(this._languageId,i);const s=new M0e,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return C4(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new dS(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=vw(this._lexer,t.stack.state),!i))throw Bt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!p9(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex;const l=r.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(s===-1||c0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const l=e.substring(r);return this._myTokenize(l,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[v];if(!k&&(k=vw(this._lexer,v),!k))throw Bt(this._lexer,"tokenizer state is not defined: "+v);const O=a.substr(u);for(const R of k)if((u===0||!R.matchOnlyAtLineStart)&&(b=O.match(R.regex),b)){w=b[0],y=R.action;break}}if(b||(b=[""],w=""),y||(u=this._lexer.maxStack)throw Bt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(y.next==="@pop"){if(d.depth<=1)throw Bt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(y.next==="@popall")d=d.popall();else{let k=Wc(this._lexer,y.next,w,b,v);if(k[0]==="@"&&(k=k.substr(1)),vw(this._lexer,k))d=d.push(k);else throw Bt(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(S))}}y.log&&typeof y.log=="string"&&I0e(this._lexer,this._lexer.languageId+": "+Wc(this._lexer,y.log,w,b,v))}if(x===null)throw Bt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const D=k=>{const O=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,R=this._getNestedEmbeddedLanguageData(O);if(u0)throw Bt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==x.length+1)throw Bt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let k=0;for(let O=1;On});class D4{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=d=>{var u;const h=(u=Jk==null?void 0:Jk.createHTML(d))!==null&&u!==void 0?u:d;i.innerHTML=h};return this.colorize(t,l||"",a,s).then(c,d=>console.error(d))}static colorize(e,t,i,s){return P0e(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),o4(t)&&(t=t.substr(1));const a=xf(t);if(!e.isRegisteredLanguageId(i))return _9(a,r,o);const l=yield vi.getOrCreate(i);return l?O0e(a,r,l,o):_9(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=ko.isBasicASCII(e,t),a=ko.containsRTL(e,r,i);return HL(new Rm(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function O0e(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=F0e(n,e,t,i);if(t instanceof kb){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function _9(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=n.length;r")}return i.join("")}function F0e(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const b9=2e4;let $u,By,OA,Wy,FA;function B0e(n){$u=document.createElement("div"),$u.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),$u.appendChild(i),i};By=e(),OA=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),$u.appendChild(i),i};Wy=t(),FA=t(),n.appendChild($u)}function _1(n){$u&&(By.textContent!==n?(Do(OA),uS(By,n)):(Do(By),uS(OA,n)))}function Eb(n){$u&&(Wy.textContent!==n?(Do(FA),uS(Wy,n)):(Do(Wy),uS(FA,n)))}function uS(n,e){Do(n),e.length>b9&&(e=e.substr(0,b9)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const k4=at("markerDecorationsService");var W0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},V0e=function(n,e){return function(t,i){e(t,i,n)}};let Ib=class{constructor(e,t){}dispose(){}};Ib.ID="editor.contrib.markerDecorations";Ib=W0e([V0e(1,k4)],Ib);Cr(Ib.ID,Ib,0);class UU extends K{constructor(e,t){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{requestAnimationFrame(()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{e=r&&r[0]&&r[0].contentRect?r[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}class pd{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=pd._read(e,this.key),i=o=>pd._read(e,o),s=(o,r)=>pd._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}}pd.items=[];function du(n,e){pd.items.push(new pd(n,e))}function Go(n,e){du(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function H0e(n){pd.items.forEach(e=>e.apply(n))}Go("wordWrap",[[!0,"on"],[!1,"off"]]);Go("lineNumbers",[[!0,"on"],[!1,"off"]]);Go("cursorBlinking",[["visible","solid"]]);Go("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Go("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Go("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Go("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Go("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Go("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Go("autoIndent",[[!1,"advanced"],[!0,"full"]]);Go("matchBrackets",[[!0,"always"],[!1,"never"]]);Go("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Go("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);du("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});du("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});du("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const z0e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};du("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(z0e))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});du("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});du("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});du("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class $0e{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const hS=new $0e,uu=at("accessibilityService"),U0e=new me("accessibilityModeEnabled",!1);var j0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q0e=function(n,e){return function(t,i){e(t,i,n)}};let BA=class extends K{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new f$,this.isSimpleWidget=e,this._containerObserver=this._register(new UU(i,t.dimension)),this._rawOptions=v9(t),this._validatedOptions=Hc.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Bc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(hS.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(fA.onDidChange(()=>this._recomputeOptions())),this._register(JC.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Hc.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Eh.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:hS.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Hc.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:K0e(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:kh||mr,pixelRatio:JC.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return fA.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=v9(e);Hc.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Hc.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=G0e(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};BA=j0e([q0e(3,uu)],BA);function G0e(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function K0e(){let n="";return!oc&&!P$&&(n+="no-user-select "),oc&&(n+="no-minimap-shadow ",n+="enable-user-select "),gt&&(n+="mac "),n}class Y0e{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Z0e{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class Hc{static validateOptions(e){const t=new Y0e;for(const i of yg){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new Z0e;for(const s of yg)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ki(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Hc._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of yg){const r=!Hc._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new h$(i):null}static applyUpdate(e,t){let i=!1;for(const s of yg)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function v9(n){const e=yl(n);return H0e(e),e}function Si(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}var X0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Mt;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Mt||(Mt={}));class Tt extends K{constructor(){super(),this.dispatched=!1,this.targets=new ks,this.ignoreTargets=new ks,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(G(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(G(document,"touchend",e=>this.onTouchEnd(e))),this._register(G(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Tt.isTouchDevice())return K.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);const t=Tt.INSTANCE.targets.push(e);return Ke(t)}static ignoreTarget(e){if(!Tt.isTouchDevice())return K.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);const t=Tt.INSTANCE.ignoreTargets.push(e);return Ke(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Tt.HOLD_DELAY&&Math.abs(a.initialPageX-Io(a.rollingPageX))<30&&Math.abs(a.initialPageY-Io(a.rollingPageY))<30){const c=this.newGestureEvent(Mt.Contextmenu,a.initialTarget);c.pageX=Io(a.rollingPageX),c.pageY=Io(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=Io(a.rollingPageX),d=Io(a.rollingPageY),u=Io(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=d-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/u,h>0?1:-1,c,Math.abs(f)/u,f>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Mt.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Mt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Mt.Change||e.type===Mt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,s,o,r,a,l){this.handle=$o(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Tt.SCROLL_FRICTION*d,r+=Tt.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Mt.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,i,s,o+u,r,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Tt.SCROLL_FRICTION=-.005;Tt.HOLD_DELAY=700;Tt.CLEAR_TAP_COUNT_TIME=400;X0e([Si],Tt,"isTouchDevice",null);class zL{constructor(){this._hooks=new fe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ke(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(G(r,le.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(G(r,le.POINTER_UP,a=>this.stopMonitoring(!0)))}}function E4(n){return`--vscode-${n.replace(/\./g,"-")}`}function oe(n){return`var(${E4(n)})`}function Q0e(n,e){return`var(${E4(n)}, ${e})`}const jU={ColorContribution:"base.contributions.colors"};class J0e{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return Tr(s,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const $L=new J0e;mn.add(jU.ColorContribution,$L);function E(n,e,t,i,s){return $L.registerColor(n,e,t,i,s)}const J=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const e_e=E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));E("descriptionForeground",{light:"#717171",dark:ye(J,.7),hcDark:ye(J,.7),hcLight:ye(J,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Yc=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),vo=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Xe=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),$t=E("contrastActiveBorder",{light:null,dark:null,hcDark:vo,hcLight:vo},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));E("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},m("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."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:H.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const t_e=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));E("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:H.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:H.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const Hl=E("widget.shadow",{dark:ye(H.black,.36),light:ye(H.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),qU=E("widget.border",{dark:null,light:null,hcDark:Xe,hcLight:Xe},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),i_e=E("input.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("inputBoxBackground","Input box background.")),n_e=E("input.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("inputBoxForeground","Input box foreground.")),s_e=E("input.border",{dark:null,light:null,hcDark:Xe,hcLight:Xe},m("inputBoxBorder","Input box border.")),I4=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Xe,hcLight:Xe},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const lh=E("inputOption.activeBackground",{dark:ye(vo,.4),light:ye(vo,.2),hcDark:H.transparent,hcLight:H.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),A4=E("inputOption.activeForeground",{dark:H.white,light:H.black,hcDark:J,hcLight:J},m("inputOption.activeForeground","Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:ye(J,.5),dark:ye(J,.5),hcDark:ye(J,.7),hcLight:ye(J,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const o_e=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:H.black,hcLight:H.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),r_e=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),a_e=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Xe,hcLight:Xe},m("inputValidationInfoBorder","Input validation border color for information severity.")),l_e=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:H.black,hcLight:H.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),c_e=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),d_e=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Xe,hcLight:Xe},m("inputValidationWarningBorder","Input validation border color for warning severity.")),u_e=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:H.black,hcLight:H.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),h_e=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),f_e=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Xe,hcLight:Xe},m("inputValidationErrorBorder","Input validation border color for error severity.")),Na=E("dropdown.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("dropdownBackground","Dropdown background.")),g_e=E("dropdown.listBackground",{dark:null,light:null,hcDark:H.black,hcLight:H.white},m("dropdownListBackground","Dropdown list background.")),zl=E("dropdown.foreground",{dark:"#F0F0F0",light:J,hcDark:H.white,hcLight:J},m("dropdownForeground","Dropdown foreground.")),Eg=E("dropdown.border",{dark:Na,light:"#CECECE",hcDark:Xe,hcLight:Xe},m("dropdownBorder","Dropdown border.")),N0=E("button.foreground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:H.white},m("buttonForeground","Button foreground color.")),p_e=E("button.separator",{dark:ye(N0,.4),light:ye(N0,.4),hcDark:ye(N0,.4),hcLight:ye(N0,.4)},m("buttonSeparator","Button separator color.")),M0=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),m_e=E("button.hoverBackground",{dark:Kr(M0,.2),light:Tf(M0,.2),hcDark:M0,hcLight:M0},m("buttonHoverBackground","Button background color when hovering.")),__e=E("button.border",{dark:Xe,light:Xe,hcDark:Xe,hcLight:Xe},m("buttonBorder","Button border color.")),b_e=E("button.secondaryForeground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:J},m("buttonSecondaryForeground","Secondary button foreground color.")),WA=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:H.white},m("buttonSecondaryBackground","Secondary button background color.")),v_e=E("button.secondaryHoverBackground",{dark:Kr(WA,.2),light:Tf(WA,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),Vy=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:H.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),w_e=E("badge.foreground",{dark:H.white,light:"#333",hcDark:H.white,hcLight:H.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),y_e=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),R0=E("scrollbarSlider.background",{dark:H.fromHex("#797979").transparent(.4),light:H.fromHex("#646464").transparent(.4),hcDark:ye(Xe,.6),hcLight:ye(Xe,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),P0=E("scrollbarSlider.hoverBackground",{dark:H.fromHex("#646464").transparent(.7),light:H.fromHex("#646464").transparent(.7),hcDark:ye(Xe,.8),hcLight:ye(Xe,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),O0=E("scrollbarSlider.activeBackground",{dark:H.fromHex("#BFBFBF").transparent(.4),light:H.fromHex("#000000").transparent(.6),hcDark:Xe,hcLight:Xe},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),C_e=E("progressBar.background",{dark:H.fromHex("#0E70C0"),light:H.fromHex("#0E70C0"),hcDark:Xe,hcLight:Xe},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));E("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ma=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),S_e=E("editorError.border",{dark:null,light:null,hcDark:H.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));E("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const wo=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Ab=E("editorWarning.border",{dark:null,light:null,hcDark:H.fromHex("#FFCC00").transparent(.8),hcLight:H.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));E("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Es=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Tb=E("editorInfo.border",{dark:null,light:null,hcDark:H.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),x_e=E("editorHint.foreground",{dark:H.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:H.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));E("sash.hoverBorder",{dark:vo,light:vo,hcDark:vo,hcLight:vo},m("sashActiveBorder","Border color of active sashes."));const Gi=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:H.black,hcLight:H.white},m("editorBackground","Editor background color.")),hu=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:H.white,hcLight:J},m("editorForeground","Editor default foreground color."));E("editorStickyScroll.background",{light:Gi,dark:Gi,hcDark:Gi,hcLight:Gi},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const Vi=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:H.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Ra=E("editorWidget.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Ig=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Xe,hcLight:Xe},m("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),L_e=E("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},m("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),w9=E("quickInput.background",{dark:Vi,light:Vi,hcDark:Vi,hcLight:Vi},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),D_e=E("quickInput.foreground",{dark:Ra,light:Ra,hcDark:Ra,hcLight:Ra},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),k_e=E("quickInputTitle.background",{dark:new H(new ut(255,255,255,.105)),light:new H(new ut(0,0,0,.06)),hcDark:"#000000",hcLight:H.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),GU=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),E_e=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),I_e=E("keybindingLabel.background",{dark:new H(new ut(128,128,128,.17)),light:new H(new ut(221,221,221,.4)),hcDark:H.transparent,hcLight:H.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),A_e=E("keybindingLabel.foreground",{dark:H.fromHex("#CCCCCC"),light:H.fromHex("#555555"),hcDark:H.white,hcLight:J},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),T_e=E("keybindingLabel.border",{dark:new H(new ut(51,51,51,.6)),light:new H(new ut(204,204,204,.4)),hcDark:new H(new ut(111,195,223)),hcLight:Xe},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),N_e=E("keybindingLabel.bottomBorder",{dark:new H(new ut(68,68,68,.6)),light:new H(new ut(187,187,187,.4)),hcDark:new H(new ut(111,195,223)),hcLight:J},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Zc=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),M_e=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:H.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),KU=E("editor.inactiveSelectionBackground",{light:ye(Zc,.5),dark:ye(Zc,.5),hcDark:ye(Zc,.7),hcLight:ye(Zc,.5)},m("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),T4=E("editor.selectionHighlightBackground",{light:E9(Zc,Gi,.3,.6),dark:E9(Zc,Gi,.3,.6),hcDark:null,hcLight:null},m("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:$t,hcLight:$t},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const R_e=E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),Pa=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),P_e=E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),O_e=E("editor.findMatchBorder",{light:null,dark:null,hcDark:$t,hcLight:$t},m("editorFindMatchBorder","Border color of the current search match.")),Xc=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:$t,hcLight:$t},m("findMatchHighlightBorder","Border color of the other search matches.")),F_e=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:ye($t,.4),hcLight:ye($t,.4)},m("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("searchEditor.findMatchBackground",{light:ye(Pa,.66),dark:ye(Pa,.66),hcDark:Pa,hcLight:Pa},m("searchEditor.queryMatch","Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:ye(Xc,.66),dark:ye(Xc,.66),hcDark:Xc,hcLight:Xc},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));E("search.resultsInfoForeground",{light:J,dark:ye(J,.65),hcDark:J,hcLight:J},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const y9=E("editorHoverWidget.background",{light:Vi,dark:Vi,hcDark:Vi,hcLight:Vi},m("hoverBackground","Background color of the editor hover."));E("editorHoverWidget.foreground",{light:Ra,dark:Ra,hcDark:Ra,hcLight:Ra},m("hoverForeground","Foreground color of the editor hover."));const B_e=E("editorHoverWidget.border",{light:Ig,dark:Ig,hcDark:Ig,hcLight:Ig},m("hoverBorder","Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:Kr(y9,.2),light:Tf(y9,.05),hcDark:Vi,hcLight:Vi},m("statusBarBackground","Background color of the editor hover status bar."));E("editorLink.activeForeground",{dark:"#4E94CE",light:H.blue,hcDark:H.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links."));const Qc=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:H.white,hcLight:H.black},m("editorInlayHintForeground","Foreground color of inline hints")),Jc=E("editorInlayHint.background",{dark:ye(Vy,.1),light:ye(Vy,.1),hcDark:ye(H.white,.1),hcLight:ye(Vy,.1)},m("editorInlayHintBackground","Background color of inline hints"));E("editorInlayHint.typeForeground",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types"));E("editorInlayHint.typeBackground",{dark:Jc,light:Jc,hcDark:Jc,hcLight:Jc},m("editorInlayHintBackgroundTypes","Background color of inline hints for types"));E("editorInlayHint.parameterForeground",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters"));E("editorInlayHint.parameterBackground",{dark:Jc,light:Jc,hcDark:Jc,hcLight:Jc},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const VA=new H(new ut(155,185,85,.2)),HA=new H(new ut(255,0,0,.2)),W_e=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),V_e=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.insertedLineBackground",{dark:VA,light:VA,hcDark:null,hcLight:null},m("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:HA,light:HA,hcDark:null,hcLight:null},m("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const H_e=E("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),z_e=E("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:Xe,hcLight:Xe},m("diffEditorBorder","Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const $_e=E("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),U_e=E("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),j_e=E("list.focusOutline",{dark:vo,light:vo,hcDark:$t,hcLight:$t},m("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),q_e=E("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),$l=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Oa=E("list.activeSelectionForeground",{dark:H.white,light:H.white,hcDark:null,hcLight:null},m("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),F0=E("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),G_e=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),K_e=E("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Y_e=E("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Z_e=E("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),X_e=E("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),YU=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:H.white.transparent(.1),hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),ZU=E("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Q_e=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),ww=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:vo,hcLight:vo},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree."));E("list.focusHighlightForeground",{dark:ww,light:Ebe($l,ww,"#BBE7FF"),hcDark:ww,hcLight:ww},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const J_e=E("listFilterWidget.background",{light:Tf(Vi,0),dark:Kr(Vi,0),hcDark:Vi,hcLight:Vi},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),ebe=E("listFilterWidget.outline",{dark:H.transparent,light:H.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),tbe=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Xe,hcLight:Xe},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),ibe=E("listFilterWidget.shadow",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:Pa,light:Pa,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));E("list.filterMatchBorder",{dark:Xc,light:Xc,hcDark:Xe,hcLight:$t},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const B0=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),nbe=E("tree.inactiveIndentGuidesStroke",{dark:ye(B0,.4),light:ye(B0,.4),hcDark:ye(B0,.4),hcLight:ye(B0,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),sbe=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),obe=E("tree.tableOddRowsBackground",{dark:ye(J,.04),light:ye(J,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const rbe=E("checkbox.background",{dark:Na,light:Na,hcDark:Na,hcLight:Na},m("checkbox.background","Background color of checkbox widget."));E("checkbox.selectBackground",{dark:Vi,light:Vi,hcDark:Vi,hcLight:Vi},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const abe=E("checkbox.foreground",{dark:zl,light:zl,hcDark:zl,hcLight:zl},m("checkbox.foreground","Foreground color of checkbox widget.")),lbe=E("checkbox.border",{dark:Eg,light:Eg,hcDark:Eg,hcLight:Eg},m("checkbox.border","Border color of checkbox widget."));E("checkbox.selectBorder",{dark:Yc,light:Yc,hcDark:Yc,hcLight:Yc},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const C9=E("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),zA=E("quickInputList.focusForeground",{dark:Oa,light:Oa,hcDark:Oa,hcLight:Oa},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),XU=E("quickInputList.focusIconForeground",{dark:F0,light:F0,hcDark:F0,hcLight:F0},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),$A=E("quickInputList.focusBackground",{dark:Nb(C9,$l),light:Nb(C9,$l),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),cbe=E("menu.border",{dark:null,light:null,hcDark:Xe,hcLight:Xe},m("menuBorder","Border color of menus.")),dbe=E("menu.foreground",{dark:zl,light:zl,hcDark:zl,hcLight:zl},m("menuForeground","Foreground color of menu items.")),ube=E("menu.background",{dark:Na,light:Na,hcDark:Na,hcLight:Na},m("menuBackground","Background color of menu items.")),hbe=E("menu.selectionForeground",{dark:Oa,light:Oa,hcDark:Oa,hcLight:Oa},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),fbe=E("menu.selectionBackground",{dark:$l,light:$l,hcDark:$l,hcLight:$l},m("menuSelectionBackground","Background color of the selected menu item in menus.")),gbe=E("menu.selectionBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},m("menuSelectionBorder","Border color of the selected menu item in menus.")),pbe=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Xe,hcLight:Xe},m("menuSeparatorBackground","Color of a separator menu item in menus.")),UA=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:$t,hcLight:$t},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:Kr(UA,.1),light:Tf(UA,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));E("editor.snippetTabstopHighlightBackground",{dark:new H(new ut(124,124,124,.3)),light:new H(new ut(10,50,100,.2)),hcDark:new H(new ut(124,124,124,.3)),hcLight:new H(new ut(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new H(new ut(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const mbe=E("breadcrumb.foreground",{light:ye(J,.8),dark:ye(J,.8),hcDark:ye(J,.8),hcLight:ye(J,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),_be=E("breadcrumb.background",{light:Gi,dark:Gi,hcDark:Gi,hcLight:Gi},m("breadcrumbsBackground","Background color of breadcrumb items.")),S9=E("breadcrumb.focusForeground",{light:Tf(J,.2),dark:Kr(J,.1),hcDark:Kr(J,.1),hcLight:Kr(J,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),bbe=E("breadcrumb.activeSelectionForeground",{light:Tf(J,.2),dark:Kr(J,.1),hcDark:Kr(J,.1),hcLight:Kr(J,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));E("breadcrumbPicker.background",{light:Vi,dark:Vi,hcDark:Vi,hcLight:Vi},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const QU=.5,x9=H.fromHex("#40C8AE").transparent(QU),L9=H.fromHex("#40A6FF").transparent(QU),D9=H.fromHex("#606060").transparent(.4),lr=.4,im=1,Ag=E("merge.currentHeaderBackground",{dark:x9,light:x9,hcDark:null,hcLight:null},m("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",{dark:ye(Ag,lr),light:ye(Ag,lr),hcDark:ye(Ag,lr),hcLight:ye(Ag,lr)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Tg=E("merge.incomingHeaderBackground",{dark:L9,light:L9,hcDark:null,hcLight:null},m("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",{dark:ye(Tg,lr),light:ye(Tg,lr),hcDark:ye(Tg,lr),hcLight:ye(Tg,lr)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Ng=E("merge.commonHeaderBackground",{dark:D9,light:D9,hcDark:null,hcLight:null},m("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",{dark:ye(Ng,lr),light:ye(Ng,lr),hcDark:ye(Ng,lr),hcLight:ye(Ng,lr)},m("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const nm=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:ye(Ag,im),light:ye(Ag,im),hcDark:nm,hcLight:nm},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:ye(Tg,im),light:ye(Tg,im),hcDark:nm,hcLight:nm},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:ye(Ng,im),light:ye(Ng,im),hcDark:nm,hcLight:nm},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const N4=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},m("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),W0=E("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Mg=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),UL=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),k9=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),vbe=E("minimap.infoHighlight",{dark:Es,light:Es,hcDark:Tb,hcLight:Tb},m("minimapInfo","Minimap marker color for infos.")),wbe=E("minimap.warningHighlight",{dark:wo,light:wo,hcDark:Ab,hcLight:Ab},m("overviewRuleWarning","Minimap marker color for warnings.")),ybe=E("minimap.errorHighlight",{dark:new H(new ut(255,18,18,.7)),light:new H(new ut(255,18,18,.7)),hcDark:new H(new ut(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),Cbe=E("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),Sbe=E("minimap.foregroundOpacity",{dark:H.fromHex("#000f"),light:H.fromHex("#000f"),hcDark:H.fromHex("#000f"),hcLight:H.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",{light:ye(R0,.5),dark:ye(R0,.5),hcDark:ye(R0,.5),hcLight:ye(R0,.5)},m("minimapSliderBackground","Minimap slider background color."));E("minimapSlider.hoverBackground",{light:ye(P0,.5),dark:ye(P0,.5),hcDark:ye(P0,.5),hcLight:ye(P0,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));E("minimapSlider.activeBackground",{light:ye(O0,.5),dark:ye(O0,.5),hcDark:ye(O0,.5),hcLight:ye(O0,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const xbe=E("problemsErrorIcon.foreground",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},m("problemsErrorIconForeground","The color used for the problems error icon.")),Lbe=E("problemsWarningIcon.foreground",{dark:wo,light:wo,hcDark:wo,hcLight:wo},m("problemsWarningIconForeground","The color used for the problems warning icon.")),Dbe=E("problemsInfoIcon.foreground",{dark:Es,light:Es,hcDark:Es,hcLight:Es},m("problemsInfoIconForeground","The color used for the problems info icon."));E("charts.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("chartsForeground","The foreground color used in charts."));E("charts.lines",{dark:ye(J,.5),light:ye(J,.5),hcDark:ye(J,.5),hcLight:ye(J,.5)},m("chartsLines","The color used for horizontal lines in charts."));E("charts.red",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},m("chartsRed","The red color used in chart visualizations."));E("charts.blue",{dark:Es,light:Es,hcDark:Es,hcLight:Es},m("chartsBlue","The blue color used in chart visualizations."));E("charts.yellow",{dark:wo,light:wo,hcDark:wo,hcLight:wo},m("chartsYellow","The yellow color used in chart visualizations."));E("charts.orange",{dark:Mg,light:Mg,hcDark:Mg,hcLight:Mg},m("chartsOrange","The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function kbe(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Tr(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Tr(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Tr(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Tr(n.background,e);return r?(o=Tr(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Tr(n.value,e)}case 4:for(const r of n.values){const a=Tr(r,e);if(a)return a}return;case 6:return Tr(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Tr(n.value,e);if(!r)return;const a=Tr(n.background,e);return a?r.isDarkerThan(a)?H.getLighterColor(r,a,n.factor).transparent(n.transparency):H.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw c4()}}function Tf(n,e){return{op:0,value:n,factor:e}}function Kr(n,e){return{op:1,value:n,factor:e}}function ye(n,e){return{op:2,value:n,factor:e}}function Nb(...n){return{op:4,values:n}}function Ebe(n,e,t){return{op:6,if:n,then:e,else:t}}function E9(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Tr(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?H.fromHex(n):e.getColor(n);if(n instanceof H)return n;if(typeof n=="object")return kbe(n,e)}}const JU="vscode://schemas/workbench-colors",ej=mn.as(FL.JSONContribution);ej.registerSchema(JU,$L.getColorSchema());const I9=new Ci(()=>ej.notifySchemaChanged(JU),200);$L.onDidChangeSchema(()=>{I9.isScheduled()||I9.schedule()});class jL{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new tj(this.x-window.scrollX,this.y-window.scrollY)}}class tj{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new jL(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Ibe{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class Abe{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function M4(n){const e=Nn(n);return new Ibe(e.left,e.top,e.width,e.height)}function R4(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new Abe(o,r)}class Ud extends rr{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new jL(this.posx,this.posy),this.editorPos=M4(i),this.relativePos=R4(i,this.editorPos,this.pos)}}class Tbe{constructor(e){this._editorViewDomNode=e}_create(e){return new Ud(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return G(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return G(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return G(e,le.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return G(e,le.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return G(e,le.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return G(e,"mousemove",i=>t(this._create(i)))}}class Nbe{constructor(e){this._editorViewDomNode=e}_create(e){return new Ud(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return G(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return G(e,le.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return G(e,le.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return G(e,"pointermove",i=>t(this._create(i)))}}class Mbe extends K{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new zL),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Hi(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new Ud(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class b1 extends K{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,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),s=Math.min(l,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=1073741824);let c=e.children[t].firstChild,d=e.children[s].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Fo;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Fo||(Fo={}));function Zl(n){return n===Fo.HIGH_CONTRAST_DARK||n===Fo.HIGH_CONTRAST_LIGHT}function GL(n){return n===Fo.DARK||n===Fo.HIGH_CONTRAST_DARK}const Bbe=function(){return Yg?!0:!(Zn||mr||oc)}();let op=!0;class T9{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class La{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=_t(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Zl(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=ar.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(Zl(r.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const d=x4(c,s);s.appendString("");let u=null;return op&&Bbe&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new yw(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=nj(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof yw:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof yw?this._renderedViewLine.monospaceAssumptionsAreValid():op}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof yw&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new A9(!0,[new Th(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new A9(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}La.CLASS_NAME="view-line";class yw{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),op=!1)}return op}toSlowRenderedLine(){return nj(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new Th(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const s=Math.floor((t-1)/300)-1,o=(s+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=Hy.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return sj(this._characterMapping,e,t)}}class ij{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new Th(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new Th(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=Hy.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=Hy.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new Th(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Hy.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return sj(this._characterMapping,e,t)}}class Wbe extends ij{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class sm{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(66),this.stickyTabStops=s.get(115),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return sm.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new V(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new V(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,vn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class P4 extends $be{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=Ka.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=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 s=t.isInContentArea?8:5;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return ro.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,s,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,s,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!ro.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new V(1,1),N9);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new V(o,r),N9)}if(i){if(ro.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=e2(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new V(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=e2(t.mouseContentHorizontalOffset-r),l=new V(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=vn._doHitTest(e,t);return s.type===1?vn.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(ro.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(ro.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new V(s,o))}}return null}static _hitTestScrollbar(e,t){if(ro.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return vn._getMouseColumn(s,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=e2(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(s,v)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(s);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let _=null;for(let v=1;vo)){const a=Math.floor((s+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new jL(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Zp(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=Ube(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new Ic;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===La.CLASS_NAME?Uu.createFromDOMInfo(e,r,s.startOffset):new Ic(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===La.CLASS_NAME?Uu.createFromDOMInfo(e,o,o.textContent.length):new Ic(o)}return new Ic}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===La.CLASS_NAME?Uu.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Ic(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===La.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return Uu.createFromDOMInfo(e,l,0)}else if(a===La.CLASS_NAME)return Uu.createFromDOMInfo(e,i.offsetNode,0)}return new Ic(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=Mb.atomicPosition(i,e.column-1,s,2);return o!==-1?new V(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Ic;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(s||!o.equals(i.position))&&(i=new oj(o,i.spanNode,s))}return i}}function Ube(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=window.getComputedStyle(s,null).getPropertyValue("font-style"),a=window.getComputedStyle(s,null).getPropertyValue("font-variant"),l=window.getComputedStyle(s,null).getPropertyValue("font-weight"),c=window.getComputedStyle(s,null).getPropertyValue("font-size"),d=window.getComputedStyle(s,null).getPropertyValue("line-height"),u=window.getComputedStyle(s,null).getPropertyValue("font-family"),h=`${r} ${a} ${l} ${c}/${d} ${u}`,f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=ch.getInstance();for(let b=0;bt(new rr(i))))}onmousedown(e,t){this._register(G(e,le.MOUSE_DOWN,i=>t(new rr(i))))}onmouseover(e,t){this._register(G(e,le.MOUSE_OVER,i=>t(new rr(i))))}onmouseleave(e,t){this._register(G(e,le.MOUSE_LEAVE,i=>t(new rr(i))))}onkeydown(e,t){this._register(G(e,le.KEY_DOWN,i=>t(new Wt(i))))}onkeyup(e,t){this._register(G(e,le.KEY_UP,i=>t(new Wt(i))))}oninput(e,t){this._register(G(e,le.INPUT,t))}onblur(e,t){this._register(G(e,le.BLUR,t))}onfocus(e,t){this._register(G(e,le.FOCUS,t))}ignoreGesture(e){return Tt.ignoreTarget(e)}};const om=11;class jbe extends oa{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ae.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=om+"px",this.domNode.style.height=om+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new zL),this._register(Hi(this.bgDomNode,le.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Hi(this.domNode,le.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new g1),this._pointerdownScheduleRepeatTimer=this._register(new hc)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class qbe extends K{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new hc)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Gbe=140;class rj extends oa{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new qbe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new zL),this._shouldRender=!0,this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(G(this.domNode.domNode,le.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new jbe(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=_t(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(G(this.slider.domNode,le.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Nn(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Rs&&a>Gbe){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Kbe=20;class rm{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new rm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Kbe,Math.floor(i*a/s))),d=(a-c)/(s-i),u=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=rm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new tf(null,1,0))}),this._createArrow({className:"scra",icon:ie.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new tf(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Zbe extends rj{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new rm(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-om)/2,a=(t.verticalScrollbarSize-om)/2;this._createArrow({className:"scra",icon:ie.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tf(null,0,1))}),this._createArrow({className:"scra",icon:ie.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tf(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class fS{constructor(e,t,i,s,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,s=s|0,o=o|0,r=r|0,a=a|0),this.rawScrollLeft=s,this.rawScrollTop=a,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=o,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new fS(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new fS(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class v1 extends K{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new fS(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Rb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=Rb.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class M9{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function t2(n,e){const t=e-n;return function(i){return n+t*Jbe(i)}}function Xbe(n,e,t){return function(i){return i2.5*i){let o,r;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}gS.INSTANCE=new gS;class O4 extends oa{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=ive(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Zbe(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Ybe(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_t(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_t(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_t(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new hc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Pt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,gt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new tf(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Pt(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new tf(s))};this._mouseWheelToDispose.push(G(this._listenOnDomNode,le.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=gS.INSTANCE;i.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!gt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(r){const u=R9*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=R9*a,h=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,h)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let o=s;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),eve)}}class aj extends O4{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new v1({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>$o(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class F4 extends O4{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class B4 extends O4{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new v1({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>$o(s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function ive(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,gt&&(e.className+=" mac"),e}class W4 extends b1{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new vn(this._context,i),this._mouseDownOperation=this._register(new nve(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const s=new Tbe(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=G(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Ud(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(G(this.viewHelper.viewDomNode,le.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=gS.INSTANCE;let t=0,i=Bc.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new tf(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=Bc.getZoomLevel(),u=c.deltaY>0?1:-1;Bc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Bc.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(Bc.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(G(this.viewHelper.viewDomNode,le.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return gt?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new tj(e,t).toPageCoordinates(),o=M4(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=R4(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=Zp(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class nve extends K{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Mbe(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new sve(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new KL,this._currentSelection=new lt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);r&&r instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=s.getCurrentScrollTop()+e.relativePos.y,c=sm.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return qn.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return qn.createOutsideEditor(o,new V(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return qn.createOutsideEditor(o,new V(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return qn.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new V(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class sve extends K{constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new ove(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class ove extends K{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=$o(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=M4(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new jL(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=R4(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=qn.createOutsideEditor(this._position.mouseColumn,new V(a,1),"above",this._position.outsideDistance):l=qn.createOutsideEditor(this._position.mouseColumn,new V(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=$o(()=>this._execute())}}class KL{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>KL.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}KL.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class rt{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var ed;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),s=Object.assign({},e);let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,_()}n.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(u)}n.onInput=d;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}n.onKeyUp=h;function f(){v()}n.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(p),_())}n.onRenderStart=g;function p(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",s),o++,w())}function b(x,D){const k=performance.getEntriesByName(x)[0].duration;D.total+=k,D.min=Math.min(D.min,k),D.max=Math.max(D.max,k)}function w(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function y(){if(o===0)return;const x={keydown:S(e),input:S(t),render:S(i),total:S(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,x}n.getAndClearMeasurements=y;function S(x){return{average:x.total/o,max:x.max,min:x.min}}function L(x){x.total=0,x.min=Number.MAX_VALUE,x.max=0}})(ed||(ed={}));class cn{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new cn(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new cn(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,s,o,r,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(s=this.selection)===null||s===void 0?void 0:s.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(ZC(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(dA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,l=e.selectionEnd-s,c=t.selectionStart-s,d=t.selectionEnd-s;if(c===d){const h=e.selectionStart-s;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(ZC(e.value,t.value),e.selectionEnd),s=Math.min(dA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}cn.EMPTY=new cn("",0,0,null,void 0);class Rg{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new N(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=Rg._getPageOfLine(t.startLineNumber,i),a=Rg._getRangeForPage(r,i),l=Rg._getPageOfLine(t.endLineNumber,i),c=Rg._getRangeForPage(l,i);let d=a.intersectRanges(new N(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=N.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new N(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=N.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return s&&_.length>2*500&&(_=_.substring(0,500)+String.fromCharCode(8230)+_.substring(_.length-500,_.length)),new cn(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var pS;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(pS||(pS={}));class mS{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)}}mS.INSTANCE=new mS;class rve{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}}class ave extends K{get textAreaState(){return this._textAreaState}constructor(e,t,i,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Ci(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Ci(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=cn.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(r=>{const a=new Wt(r);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(r=>{const a=new Wt(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new rve;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===r.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:r.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:r.data});return}this._onCompositionStart.fire({data:r.data})})),this._register(this._textArea.onCompositionUpdate(r=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(r)})),this._register(this._textArea.onCompositionEnd(r=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=cn.readFromTextArea(this._textArea,this._textAreaState),l=cn.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(tn(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(r=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(r),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(r=>{this._ensureClipboardGetsEditorSelection(r)})),this._register(this._textArea.onPaste(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),r.preventDefault(),!r.clipboardData)return;let[a,l]=P9.getTextData(r.clipboardData);a&&(l=l||mS.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const r=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!r&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return G(this._textArea.ownerDocument,"selectionchange",t=>{if(ed.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new lt(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};mS.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,i),e.preventDefault(),e.clipboardData&&P9.setTextData(e.clipboardData,t.text,t.html,i)}}const P9={getTextData(n){const e=n.getData(Ml.text);let t=null;const i=n.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&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Ml.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class lve extends K{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new rt(this._actual,"keydown")).event,this.onKeyUp=this._register(new rt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new rt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new rt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new rt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new rt(this._actual,"beforeinput")).event,this.onInput=this._register(new rt(this._actual,"input")).event,this.onCut=this._register(new rt(this._actual,"cut")).event,this.onCopy=this._register(new rt(this._actual,"copy")).event,this.onPaste=this._register(new rt(this._actual,"paste")).event,this.onFocus=this._register(new rt(this._actual,"focus")).event,this.onBlur=this._register(new rt(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>ed.onKeyDown())),this._register(this.onBeforeInput(()=>ed.onBeforeInput())),this._register(this.onInput(()=>ed.onInput())),this._register(this.onKeyUp(()=>ed.onKeyUp())),this._register(G(this._actual,pS.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Zp(this._actual);return e?e.activeElement===this._actual:h4(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,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 s=this._actual;let o=null;const r=Zp(s);r?o=r.activeElement:o=s.ownerDocument.activeElement;const a=o===s,l=s.selectionStart,c=s.selectionEnd;if(a&&l===t&&c===i){mr&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),mr&&window.parent!==window&&s.focus();return}try{const d=Wge(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),Vge(s,d)}catch{}}}class cve extends W4{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(G(this.viewHelper.linesContentDomNode,Mt.Tap,o=>this.onTap(o))),this._register(G(this.viewHelper.linesContentDomNode,Mt.Change,o=>this.onChange(o))),this._register(G(this.viewHelper.linesContentDomNode,Mt.Contextmenu,o=>this._onContextMenu(new Ud(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(G(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new Nbe(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Ud(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class dve extends W4{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(G(this.viewHelper.linesContentDomNode,Mt.Tap,s=>this.onTap(s))),this._register(G(this.viewHelper.linesContentDomNode,Mt.Change,s=>this.onChange(s))),this._register(G(this.viewHelper.linesContentDomNode,Mt.Contextmenu,s=>this._onContextMenu(new Ud(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Ud(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(pS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class uve extends K{constructor(e,t,i){super(),Bd&&u4.pointerEvents?this.handler=this._register(new cve(e,t,i)):window.TouchEvent?this.handler=this._register(new dve(e,t,i)):this.handler=this._register(new W4(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Nf extends b1{}const oo=at("themeService");function sn(n){return{id:n}}function jA(n){switch(n){case Fo.DARK:return"vs-dark";case Fo.HIGH_CONTRAST_DARK:return"hc-black";case Fo.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const lj={ThemingContribution:"base.contributions.theming"};class hve{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ke(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const cj=new hve;mn.add(lj.ThemingContribution,cj);function Sr(n){return cj.onColorThemeChange(n)}class fve extends K{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const dj=E("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),O9=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Xe},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);E("editor.symbolHighlightBackground",{dark:Pa,light:Pa,hcDark:null,hcLight:null},m("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const uj=E("editorCursor.foreground",{dark:"#AEAFAD",light:H.black,hcDark:H.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),gve=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Ul=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),pve=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:H.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),Cw=E("editorIndentGuide.background",{dark:Ul,light:Ul,hcDark:Ul,hcLight:Ul},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Sw=E("editorIndentGuide.activeBackground",{dark:Ul,light:Ul,hcDark:Ul,hcLight:Ul},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),w1=E("editorIndentGuide.background1",{dark:Cw,light:Cw,hcDark:Cw,hcLight:Cw},m("editorIndentGuides1","Color of the editor indentation guides (1).")),mve=E("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),_ve=E("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),bve=E("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),vve=E("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),wve=E("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),y1=E("editorIndentGuide.activeBackground1",{dark:Sw,light:Sw,hcDark:Sw,hcLight:Sw},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),yve=E("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Cve=E("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Sve=E("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),xve=E("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Lve=E("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),xw=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:$t,hcLight:$t},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",{dark:xw,light:xw,hcDark:xw,hcLight:xw},m("editorActiveLineNumber","Color of editor active line number"));const Dve=E("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:H.lightgrey,hcDark:H.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Xe,hcLight:Xe},m("editorBracketMatchBorder","Color for matching brackets boxes"));const kve=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),Eve=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",{dark:Gi,light:Gi,hcDark:Gi,hcLight:Gi},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:Xe},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Ive=E("editorUnnecessaryCode.opacity",{dark:H.fromHex("#000a"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:H.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));E("editorGhostText.foreground",{dark:H.fromHex("#ffffff56"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const Lw=new H(new ut(0,122,204,.6)),Ave=E("editorOverviewRuler.rangeHighlightForeground",{dark:Lw,light:Lw,hcDark:Lw,hcLight:Lw},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Tve=E("editorOverviewRuler.errorForeground",{dark:new H(new ut(255,18,18,.7)),light:new H(new ut(255,18,18,.7)),hcDark:new H(new ut(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),Nve=E("editorOverviewRuler.warningForeground",{dark:wo,light:wo,hcDark:Ab,hcLight:Ab},m("overviewRuleWarning","Overview ruler marker color for warnings.")),Mve=E("editorOverviewRuler.infoForeground",{dark:Es,light:Es,hcDark:Tb,hcLight:Tb},m("overviewRuleInfo","Overview ruler marker color for infos.")),hj=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),fj=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),gj=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),pj=E("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),mj=E("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),_j=E("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Rve=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new H(new ut(255,18,18,.8)),light:new H(new ut(255,18,18,.8)),hcDark:new H(new ut(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Pve=E("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Ove=E("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Fve=E("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Bve=E("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Wve=E("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Vve=E("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Hve=E("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),zve=E("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),$ve=E("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Uve=E("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),jve=E("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),qve=E("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Sr((n,e)=>{const t=n.getColor(Gi),i=n.getColor(dj),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class C1 extends Nf{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new V(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Zn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=s;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){r[l]="";continue}let d="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){r[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),r[l]=`
${c}
`}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}C1.CLASS_NAME="line-numbers";Sr((n,e)=>{const t=n.getColor(pve),i=n.getColor(Dve);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class nf extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=_t(document.createElement("div")),this._domNode.setClassName(nf.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=_t(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(nf.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}nf.CLASS_NAME="glyph-margin";nf.OUTER_CLASS_NAME="margin";const rp="monaco-mouse-cursor-text";class Gve{constructor(){this._onDidChange=new B,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 u_=new Gve,gi=at("keybindingService");var Kve=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yve=function(n,e){return function(t,i){e(t,i,n)}};class Zve{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new V(this.modelLineNumber,this.distanceToModelLineStart+1),i=new V(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const i2=mr;let qA=class extends so{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new V(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,r=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new lt(1,1,1,1)],this._modelSelections=[new lt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=_t(document.createElement("textarea")),Ka.write(this.textArea,6),this.textArea.setClassName(`inputarea ${rp}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=_t(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,h)=>this._context.viewModel.getValueInRange(u,h),getValueLengthInRange:(u,h)=>this._context.viewModel.getValueLengthInRange(u,h),modifyPosition:(u,h)=>this._context.viewModel.modifyPosition(u,h)},c={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Rs),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(u)?u:null,p=Array.isArray(u)?u.join(h):u;let _,v=null;if(this._copyWithSyntaxHighlighting&&p.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(_=b.html,v=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:_,mode:v}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(gt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new cn(g,g.length,g.length,N.fromPositions(f),0)}const h=500;if(gt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new cn(f,g,g,N.fromPositions(h),0)}return cn.EMPTY}return Rg.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(u,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,h,f)},d=this._register(new lve(this.textArea.domNode));this._textAreaInput=this._register(new ave(c,d,bo,{isAndroid:cF,isChrome:r4,isFirefox:mr,isSafari:oc})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let h=!1,f=null,g=null;u.metadata&&(h=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,f=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,g=u.metadata.mode),this._viewController.paste(u.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const v=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=v.lastIndexOf(` -`),w=v.substring(b+1),y=w.lastIndexOf(" "),S=w.length-y-1,L=f.getStartPosition(),x=Math.min(L.column-1,S),D=L.column-1-x,k=w.substring(0,w.length-x),{tabSize:O}=this._context.viewModel.model.getOptions(),R=Xve(this.textArea.domNode.ownerDocument,k,this._fontInfo,O);return{distanceToModelLineStart:D,widthOfHiddenTextBefore:R}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf(` -`),w=b===-1?v:v.substring(0,b),y=w.indexOf(" "),S=y===-1?w.length:w.length-y-1,L=f.getEndPosition(),x=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,S);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-x}})();this._context.viewModel.revealRange("keyboard",!0,N.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Zve(this._context,f.startLineNumber,g,p,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${rp} 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 ${rp}`),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(u_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=Jp(t);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);s.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=Jp(this._context.configuration.options.get(129));let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==0||o>50)return t.substring(s-1,e.column-1);o++,s--}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(!tn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,s;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||s===void 0?void 0:s.getAriaLabel(),c=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?m("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.",c,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===yf.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(143).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=i2?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!u_.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new V(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const s=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&s&&o&&o.left>=this._scrollLeft&&s.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+s.left-this._scrollLeft,h=o.left-s.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),_=g===p,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(vi.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(gt){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:i2?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` -`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:i2?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Mn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?H.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 s=this._context.configuration.options;s.get(57)?i.setClassName("monaco-editor-background textAreaCover "+nf.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+C1.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};qA=Kve([Yve(3,gi)],qA);function Xve(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Mn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}function Qve(n,e,t){let i=0;for(let o=0;o!0,e1e=()=>!1,t1e=n=>n===" "||n===" ";class ig{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,s){var o;this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(143),l=r.get(50);this.readOnly=r.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(127),this.wordSeparators=r.get(129),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(76),this.multiCursorPaste=r.get(78),this.multiCursorLimit=r.get(79),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=ML(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return bj(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return t1e;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Jve;case"never":return e1e}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Ui.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Ui.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}class ot{static fromModelState(e){return new i1e(e)}static fromViewState(e){return new n1e(e)}static fromModelSelection(e){const t=lt.liftSelection(e),i=new hn(N.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return ot.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,ju.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new V(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-A$(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new V(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Mb.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new V(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?St.leftPositionAtomicSoftTabs(t,i,e.tabSize):St.leftPosition(t,i);return new n2(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(St.clipPositionColumn(l,t),0),d=St.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new V(e.lineNumber,St.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-Ui.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new V(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new n2(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,4)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=St.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new V(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const f=h.charAt(u.column-2),g=s.get(f);if(!g)return!1;if(Ac(f)){if(i==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let _=!1;for(const v of g)v.open===f&&v.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,w=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Ks(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Ui.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new N(s.lineNumber,d,s.lineNumber,s.column)}}return N.fromPositions(sf.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=mfe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new V(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>V.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new N(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new ws(g,"")}else s[r]=null;else s[r]=new ws(l,"")}return new bs(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class _i{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let o=i.column-2;o>=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===0){if(s===2)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=e.length;for(let r=s;r=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=_i._findPreviousWordOnLine(e,t,new V(o,r));if(s===0)return new V(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=_i._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=_i._findPreviousWordOnLine(e,t,new V(o,a.start+1));return new V(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=_i._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new V(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new V(i,r);if(a===45&&l!==45)return new V(i,r);if((Cg(a)||fw(a))&&Mc(l))return new V(i,r);if(Mc(a)&&Mc(l)&&r+1=l.start+1&&(l=_i._findNextWordOnLine(e,t,new V(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new V(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?c=1:(l--,c=s.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=_i._findPreviousWordOnLine(i,s,new V(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new N(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new V(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new N(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new N(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(s,h-2);)h--;return a(h,f)},c=_i._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=_i._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=_i._moveWordPartLeft(e,i);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=h.start+1&&(h=_i._findNextWordOnLine(i,s,new V(l,h.end+1))),h?c=h.start+1:cc&&(d=c,u=e.model.getLineMaxColumn(d)),ot.fromModelState(new hn(new N(r.lineNumber,1,d,u),2,0,new V(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),ot.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return ot.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return ot.fromModelState(_i.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new ot(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return ot.fromViewState(new hn(new N(i,s,i,s),0,0,new V(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new V(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return ot.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case 1:return r===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case 2:return r===2?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case 3:return r===2?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case 4:return r===2?t.map(a=>ot.fromViewState(St.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(St.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>ot.fromViewState(St.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(St.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:oot.fromViewState(St.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;oot.fromViewState(St.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;onew ML(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=OL.create(this.key,this.value,this)),this.negated}}class RL{static create(e,t,i=null){return NL(t,s=>new RL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=PL.create(this.key,this.value,this)),this.negated}}class PL{static create(e,t,i=null){return NL(t,s=>new PL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new OL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Ef(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ML.create(this.key,this.value,this)),this.negated}}class mb{static create(e,t){return new mb(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v4.create(this)),this.negated}}class v4{static create(e){return new v4(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function tU(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=s[s.length-1];if(r.type!==9)break;s.pop();const a=s.pop(),l=s.length===0,c=Ml.create(r.expr.map(d=>dh.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(c_))}if(s.length===1)return s[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Ml.create(e,this,!0)}return this.negated}}class Ml{static create(e,t,i){return Ml._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const o of DF(t))for(const r of DF(i))s.push(dh.create([o,r],null,!1));e.unshift(Ml.create(s,null,!1))}this.negated=Ml.create(e,this,!0)}return this.negated}}class _e extends Df{static all(){return _e._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?_e._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&_e._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return v1.create(this.key,e)}}_e._info=[];const tt=at("contextKeyService");function iU(n,e){return ne?1:0}function Ef(n,e,t,i){return nt?1:ei?1:0}function LA(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?LF(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(LA(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return LF(e.expr,n.expr);for(const t of n.expr)if(LA(t,e))return!0;return!1}return n.equals(e)}function LF(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new Ok([yw(t,e),yw(i,e)]):new Ok([yw(t,e)])}else{const t=[];for(let i=0;i{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(hge)),this._cachedMergedKeybindings.slice(0)}}const Ps=new y4,uge={EditorModes:"platform.keybindingsRegistry"};mn.add(uge.EditorModes,Ps);function hge(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var fge=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kF=function(n,e){return function(t,i){e(t,i,n)}},gge=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);st===e}}Rl._all=new Map;const or=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Khe({merge:Rl.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Rl.for(A.CommandPalette)),Ze(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Rl.for(A.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new Ds,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Rl.for(n)),Ze(()=>{i(),this._onDidChangeMenu.fire(Rl.for(n))})}appendMenuItems(n){const e=new fe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===A.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)N0(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class sS extends kL{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let qa=Vy=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r){var a,l;this.hideActions=s,this._commandService=r,this.id=e.id,this.label=Vy.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Ae.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Ae.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Vy(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&Ae.asClassName(c)}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};qa=Vy=fge([kF(4,tt),kF(5,fs)],qa);class Rm{constructor(e){this.desc=e}}function Os(n){const e=new fe,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=gge(i,["f1","menu","keybinding","description"]);if(e.add(Gt.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(o))for(const c of o)e.add(or.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(or.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(or.appendMenuItem(A.CommandPalette,{command:l,when:l.precondition})),e.add(or.addCommand(l))),Array.isArray(r))for(const c of r)e.add(Ps.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?xe.and(l.precondition,c.when):c.when})));else r&&e.add(Ps.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?xe.and(l.precondition,r.when):r.when})));return e}const hc=at("telemetryService"),fc=at("logService");var yn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(yn||(yn={}));const sU=yn.Info;class oU extends Y{constructor(){super(...arguments),this.level=sU,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==yn.Off&&this.level<=e}}class mge extends oU{constructor(e=sU,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(yn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(yn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(yn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(yn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(yn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class _ge extends oU{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function bge(n){switch(n){case yn.Trace:return"trace";case yn.Debug:return"debug";case yn.Info:return"info";case yn.Warning:return"warn";case yn.Error:return"error";case yn.Off:return"off"}}new _e("logLevel",bge(yn.Info));const C4={clipboard:{writeText:Zg||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Zg||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Zg||$fe()?0:navigator.keyboard||lc?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function vge(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return Nl.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(_r)switch(e){case 59:return 85;case 60:if(Zn)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(gt)return 57;break}else if(Eh){if(gt&&e===93)return 57;if(!gt&&e===92)return 57}return P$[e]||0}const wge=gt?256:2048,yge=512,Cge=1024,Sge=gt?2048:256;class Wt{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=vge(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=wge),this.altKey&&(t|=yge),this.shiftKey&&(t|=Cge),this.metaKey&&(t|=Sge),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ef(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let EF=!1,Jm=null;function xge(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return EF=!0,null}catch{return EF=!0,null}return n.parent}class Lge{static getSameOriginWindowChain(){if(!Jm){Jm=[];let e=window,t;do t=xge(e),t?Jm.push({window:e,iframeElement:e.frameElement||null}):Jm.push({window:e,iframeElement:null}),e=t;while(e)}return Jm.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0;const o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,s+=r.window.scrollX,r.window===t||!r.iframeElement)break;const a=r.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class rr{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=Lge.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class tf{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?_r&&!gt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")lc&&Ms?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?_r&&!gt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:rU,setPrototypeOf:IF,isFrozen:Dge,getPrototypeOf:kge,getOwnPropertyDescriptor:Ege}=Object;let{freeze:Qs,seal:ea,create:Ige}=Object,{apply:kA,construct:EA}=typeof Reflect<"u"&&Reflect;kA||(kA=function(e,t,i){return e.apply(t,i)});Qs||(Qs=function(e){return e});ea||(ea=function(e){return e});EA||(EA=function(e,t){return new e(...t)});const Age=br(Array.prototype.forEach),AF=br(Array.prototype.pop),e0=br(Array.prototype.push),Hy=br(String.prototype.toLowerCase),Bk=br(String.prototype.toString),Tge=br(String.prototype.match),Ar=br(String.prototype.replace),Nge=br(String.prototype.indexOf),Mge=br(String.prototype.trim),Eo=br(RegExp.prototype.test),t0=Rge(TypeError);function br(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),Wge=ea(/\${[\w\W]*}/gm),Vge=ea(/^data-[\-\w.\u00B7-\uFFFF]/),Hge=ea(/^aria-[\-\w]+$/),aU=ea(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zge=ea(/^(?:\w+script|data):/i),$ge=ea(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lU=ea(/^html$/i);var PF=Object.freeze({__proto__:null,MUSTACHE_EXPR:Fge,ERB_EXPR:Bge,TMPLIT_EXPR:Wge,DATA_ATTR:Vge,ARIA_ATTR:Hge,IS_ALLOWED_URI:aU,IS_SCRIPT_OR_DATA:zge,ATTR_WHITESPACE:$ge,DOCTYPE_NAME:lU});const Uge=()=>typeof window>"u"?null:window,jge=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function cU(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uge();const e=Ke=>cU(Ke);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:s}=n;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=n,g=l.prototype,p=Cw(g,"cloneNode"),_=Cw(g,"nextSibling"),v=Cw(g,"childNodes"),b=Cw(g,"parentNode");if(typeof r=="function"){const Ke=s.createElement("template");Ke.content&&Ke.content.ownerDocument&&(s=Ke.content.ownerDocument)}let w,y="";const{implementation:S,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:D}=s,{importNode:k}=t;let P={};e.isSupported=typeof rU=="function"&&typeof b=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:R,TMPLIT_EXPR:M,DATA_ATTR:W,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:ce}=PF;let{IS_ALLOWED_URI:ge}=PF,se=null;const Se=Ct({},[...TF,...Wk,...Vk,...Hk,...NF]);let Ie=null;const pe=Ct({},[...MF,...zk,...RF,...Sw]);let ee=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Kt=null,xt=null,It=!0,Ge=!0,ti=!1,De=!0,Ve=!1,he=!1,ue=!1,Di=!1,Lt=!1,Et=!1,mi=!1,Zo=!0,Cu=!1;const UD="user-content-";let Z=!0,j=!1,U={},I=null;const T=Ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let V=null;const F=Ct({},["audio","video","img","source","image","track"]);let X=null;const ae=Ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Le="http://www.w3.org/2000/svg",ze="http://www.w3.org/1999/xhtml";let Pe=ze,At=!1,Dt=null;const Ne=Ct({},[Ce,Le,ze],Bk);let li;const ci=["application/xhtml+xml","text/html"],Xo="text/html";let wt,Fi=null;const Su=s.createElement("form"),xu=function(q){return q instanceof RegExp||q instanceof Function},Dr=function(q){if(!(Fi&&Fi===q)){if((!q||typeof q!="object")&&(q={}),q=Qf(q),li=ci.indexOf(q.PARSER_MEDIA_TYPE)===-1?li=Xo:li=q.PARSER_MEDIA_TYPE,wt=li==="application/xhtml+xml"?Bk:Hy,se="ALLOWED_TAGS"in q?Ct({},q.ALLOWED_TAGS,wt):Se,Ie="ALLOWED_ATTR"in q?Ct({},q.ALLOWED_ATTR,wt):pe,Dt="ALLOWED_NAMESPACES"in q?Ct({},q.ALLOWED_NAMESPACES,Bk):Ne,X="ADD_URI_SAFE_ATTR"in q?Ct(Qf(ae),q.ADD_URI_SAFE_ATTR,wt):ae,V="ADD_DATA_URI_TAGS"in q?Ct(Qf(F),q.ADD_DATA_URI_TAGS,wt):F,I="FORBID_CONTENTS"in q?Ct({},q.FORBID_CONTENTS,wt):T,Kt="FORBID_TAGS"in q?Ct({},q.FORBID_TAGS,wt):{},xt="FORBID_ATTR"in q?Ct({},q.FORBID_ATTR,wt):{},U="USE_PROFILES"in q?q.USE_PROFILES:!1,It=q.ALLOW_ARIA_ATTR!==!1,Ge=q.ALLOW_DATA_ATTR!==!1,ti=q.ALLOW_UNKNOWN_PROTOCOLS||!1,De=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=q.SAFE_FOR_TEMPLATES||!1,he=q.WHOLE_DOCUMENT||!1,Lt=q.RETURN_DOM||!1,Et=q.RETURN_DOM_FRAGMENT||!1,mi=q.RETURN_TRUSTED_TYPE||!1,Di=q.FORCE_BODY||!1,Zo=q.SANITIZE_DOM!==!1,Cu=q.SANITIZE_NAMED_PROPS||!1,Z=q.KEEP_CONTENT!==!1,j=q.IN_PLACE||!1,ge=q.ALLOWED_URI_REGEXP||aU,Pe=q.NAMESPACE||ze,ee=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&xu(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&xu(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ve&&(Ge=!1),Et&&(Lt=!0),U&&(se=Ct({},[...NF]),Ie=[],U.html===!0&&(Ct(se,TF),Ct(Ie,MF)),U.svg===!0&&(Ct(se,Wk),Ct(Ie,zk),Ct(Ie,Sw)),U.svgFilters===!0&&(Ct(se,Vk),Ct(Ie,zk),Ct(Ie,Sw)),U.mathMl===!0&&(Ct(se,Hk),Ct(Ie,RF),Ct(Ie,Sw))),q.ADD_TAGS&&(se===Se&&(se=Qf(se)),Ct(se,q.ADD_TAGS,wt)),q.ADD_ATTR&&(Ie===pe&&(Ie=Qf(Ie)),Ct(Ie,q.ADD_ATTR,wt)),q.ADD_URI_SAFE_ATTR&&Ct(X,q.ADD_URI_SAFE_ATTR,wt),q.FORBID_CONTENTS&&(I===T&&(I=Qf(I)),Ct(I,q.FORBID_CONTENTS,wt)),Z&&(se["#text"]=!0),he&&Ct(se,["html","head","body"]),se.table&&(Ct(se,["tbody"]),delete Kt.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw t0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw t0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=q.TRUSTED_TYPES_POLICY,y=w.createHTML("")}else w===void 0&&(w=jge(f,i)),w!==null&&typeof y=="string"&&(y=w.createHTML(""));Qs&&Qs(q),Fi=q}},wc=Ct({},["mi","mo","mn","ms","mtext"]),Lu=Ct({},["foreignobject","desc","title","annotation-xml"]),Du=Ct({},["title","style","font","a","script"]),Uf=Ct({},Wk);Ct(Uf,Vk),Ct(Uf,Pge);const ku=Ct({},Hk);Ct(ku,Oge);const jD=function(q){let be=b(q);(!be||!be.tagName)&&(be={namespaceURI:Pe,tagName:"template"});const Te=Hy(q.tagName),di=Hy(be.tagName);return Dt[q.namespaceURI]?q.namespaceURI===Le?be.namespaceURI===ze?Te==="svg":be.namespaceURI===Ce?Te==="svg"&&(di==="annotation-xml"||wc[di]):!!Uf[Te]:q.namespaceURI===Ce?be.namespaceURI===ze?Te==="math":be.namespaceURI===Le?Te==="math"&&Lu[di]:!!ku[Te]:q.namespaceURI===ze?be.namespaceURI===Le&&!Lu[di]||be.namespaceURI===Ce&&!wc[di]?!1:!ku[Te]&&(Du[Te]||!Uf[Te]):!!(li==="application/xhtml+xml"&&Dt[q.namespaceURI]):!1},ca=function(q){e0(e.removed,{element:q});try{q.parentNode.removeChild(q)}catch{q.remove()}},Um=function(q,be){try{e0(e.removed,{attribute:be.getAttributeNode(q),from:be})}catch{e0(e.removed,{attribute:null,from:be})}if(be.removeAttribute(q),q==="is"&&!Ie[q])if(Lt||Et)try{ca(be)}catch{}else try{be.setAttribute(q,"")}catch{}},jm=function(q){let be,Te;if(Di)q=""+q;else{const Qo=Tge(q,/^[\r\n\t ]+/);Te=Qo&&Qo[0]}li==="application/xhtml+xml"&&Pe===ze&&(q=''+q+"");const di=w?w.createHTML(q):q;if(Pe===ze)try{be=new h().parseFromString(di,li)}catch{}if(!be||!be.documentElement){be=S.createDocument(Pe,"template",null);try{be.documentElement.innerHTML=At?y:di}catch{}}const Hn=be.body||be.documentElement;return q&&Te&&Hn.insertBefore(s.createTextNode(Te),Hn.childNodes[0]||null),Pe===ze?D.call(be,he?"html":"body")[0]:he?be.documentElement:Hn},G1=function(q){return L.call(q.ownerDocument||q,q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},hY=function(q){return q instanceof u&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof d)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},K1=function(q){return typeof a=="object"?q instanceof a:q&&typeof q=="object"&&typeof q.nodeType=="number"&&typeof q.nodeName=="string"},rl=function(q,be,Te){P[q]&&Age(P[q],di=>{di.call(e,be,Te,Fi)})},k3=function(q){let be;if(rl("beforeSanitizeElements",q,null),hY(q))return ca(q),!0;const Te=wt(q.nodeName);if(rl("uponSanitizeElement",q,{tagName:Te,allowedTags:se}),q.hasChildNodes()&&!K1(q.firstElementChild)&&(!K1(q.content)||!K1(q.content.firstElementChild))&&Eo(/<[/\w]/g,q.innerHTML)&&Eo(/<[/\w]/g,q.textContent))return ca(q),!0;if(!se[Te]||Kt[Te]){if(!Kt[Te]&&I3(Te)&&(ee.tagNameCheck instanceof RegExp&&Eo(ee.tagNameCheck,Te)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Te)))return!1;if(Z&&!I[Te]){const di=b(q)||q.parentNode,Hn=v(q)||q.childNodes;if(Hn&&di){const Qo=Hn.length;for(let zi=Qo-1;zi>=0;--zi)di.insertBefore(p(Hn[zi],!0),_(q))}}return ca(q),!0}return q instanceof l&&!jD(q)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&Eo(/<\/no(script|embed|frames)/i,q.innerHTML)?(ca(q),!0):(Ve&&q.nodeType===3&&(be=q.textContent,be=Ar(be,O," "),be=Ar(be,R," "),be=Ar(be,M," "),q.textContent!==be&&(e0(e.removed,{element:q.cloneNode()}),q.textContent=be)),rl("afterSanitizeElements",q,null),!1)},E3=function(q,be,Te){if(Zo&&(be==="id"||be==="name")&&(Te in s||Te in Su))return!1;if(!(Ge&&!xt[be]&&Eo(W,be))){if(!(It&&Eo(G,be))){if(!Ie[be]||xt[be]){if(!(I3(q)&&(ee.tagNameCheck instanceof RegExp&&Eo(ee.tagNameCheck,q)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(q))&&(ee.attributeNameCheck instanceof RegExp&&Eo(ee.attributeNameCheck,be)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(be))||be==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Eo(ee.tagNameCheck,Te)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Te))))return!1}else if(!X[be]){if(!Eo(ge,Ar(Te,ce,""))){if(!((be==="src"||be==="xlink:href"||be==="href")&&q!=="script"&&Nge(Te,"data:")===0&&V[q])){if(!(ti&&!Eo(ne,Ar(Te,ce,"")))){if(Te)return!1}}}}}}return!0},I3=function(q){return q.indexOf("-")>0},A3=function(q){let be,Te,di,Hn;rl("beforeSanitizeAttributes",q,null);const{attributes:Qo}=q;if(!Qo)return;const zi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie};for(Hn=Qo.length;Hn--;){be=Qo[Hn];const{name:da,namespaceURI:qD}=be;if(Te=da==="value"?be.value:Mge(be.value),di=wt(da),zi.attrName=di,zi.attrValue=Te,zi.keepAttr=!0,zi.forceKeepAttr=void 0,rl("uponSanitizeAttribute",q,zi),Te=zi.attrValue,zi.forceKeepAttr||(Um(da,q),!zi.keepAttr))continue;if(!De&&Eo(/\/>/i,Te)){Um(da,q);continue}Ve&&(Te=Ar(Te,O," "),Te=Ar(Te,R," "),Te=Ar(Te,M," "));const T3=wt(q.nodeName);if(E3(T3,di,Te)){if(Cu&&(di==="id"||di==="name")&&(Um(da,q),Te=UD+Te),w&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!qD)switch(f.getAttributeType(T3,di)){case"TrustedHTML":{Te=w.createHTML(Te);break}case"TrustedScriptURL":{Te=w.createScriptURL(Te);break}}try{qD?q.setAttributeNS(qD,da,Te):q.setAttribute(da,Te),AF(e.removed)}catch{}}}rl("afterSanitizeAttributes",q,null)},fY=function Ke(q){let be;const Te=G1(q);for(rl("beforeSanitizeShadowDOM",q,null);be=Te.nextNode();)rl("uponSanitizeShadowNode",be,null),!k3(be)&&(be.content instanceof o&&Ke(be.content),A3(be));rl("afterSanitizeShadowDOM",q,null)};return e.sanitize=function(Ke){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be,Te,di,Hn;if(At=!Ke,At&&(Ke=""),typeof Ke!="string"&&!K1(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw t0("dirty is not a string, aborting")}else throw t0("toString is not a function");if(!e.isSupported)return Ke;if(ue||Dr(q),e.removed=[],typeof Ke=="string"&&(j=!1),j){if(Ke.nodeName){const da=wt(Ke.nodeName);if(!se[da]||Kt[da])throw t0("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof a)be=jm(""),Te=be.ownerDocument.importNode(Ke,!0),Te.nodeType===1&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?be=Te:be.appendChild(Te);else{if(!Lt&&!Ve&&!he&&Ke.indexOf("<")===-1)return w&&mi?w.createHTML(Ke):Ke;if(be=jm(Ke),!be)return Lt?null:mi?y:""}be&&Di&&ca(be.firstChild);const Qo=G1(j?Ke:be);for(;di=Qo.nextNode();)k3(di)||(di.content instanceof o&&fY(di.content),A3(di));if(j)return Ke;if(Lt){if(Et)for(Hn=x.call(be.ownerDocument);be.firstChild;)Hn.appendChild(be.firstChild);else Hn=be;return(Ie.shadowroot||Ie.shadowrootmode)&&(Hn=k.call(t,Hn,!0)),Hn}let zi=he?be.outerHTML:be.innerHTML;return he&&se["!doctype"]&&be.ownerDocument&&be.ownerDocument.doctype&&be.ownerDocument.doctype.name&&Eo(lU,be.ownerDocument.doctype.name)&&(zi=" +`+zi),Ve&&(zi=Ar(zi,O," "),zi=Ar(zi,R," "),zi=Ar(zi,M," ")),w&&mi?w.createHTML(zi):zi},e.setConfig=function(Ke){Dr(Ke),ue=!0},e.clearConfig=function(){Fi=null,ue=!1},e.isValidAttribute=function(Ke,q,be){Fi||Dr({});const Te=wt(Ke),di=wt(q);return E3(Te,di,be)},e.addHook=function(Ke,q){typeof q=="function"&&(P[Ke]=P[Ke]||[],e0(P[Ke],q))},e.removeHook=function(Ke){if(P[Ke])return AF(P[Ke])},e.removeHooks=function(Ke){P[Ke]&&(P[Ke]=[])},e.removeAllHooks=function(){P={}},e}var sl=cU();sl.version;sl.isSupported;const dU=sl.sanitize;sl.setConfig;sl.clearConfig;sl.isValidAttribute;const uU=sl.addHook,hU=sl.removeHook;sl.removeHooks;sl.removeAllHooks;var it;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(it||(it={}));const qge="tkn";class Gge{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${it.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return pt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${qge}=${encodeURIComponent(o)}`),je.from({scheme:Am?this._preferredWebSchema:it.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:r})}}const fU=new Gge;class bb{uriToBrowserUri(e){return e.scheme===it.vscodeRemote?fU.rewrite(e):e.scheme===it.file&&(Zg||Hue&&dr.origin===`${it.vscodeFileResource}://${bb.FALLBACK_AUTHORITY}`)?e.with({scheme:it.vscodeFileResource,authority:e.authority||bb.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}bb.FALLBACK_AUTHORITY="vscode-app";const gU=new bb;var OF;(function(n){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"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:je.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=s})(OF||(OF={}));const{registerWindow:iPe,getWindows:Kge,onDidCreateWindow:nPe}=function(){const n=[],e=new B;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new fe;return i.add(Ze(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Lo(n){for(;n.firstChild;)n.firstChild.remove()}function S4(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Yge{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function K(n,e,t,i){return new Yge(n,e,t,i)}function pU(n){return function(e){return n(new rr(e))}}function Zge(n){return function(e){return n(new Wt(e))}}const Hi=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=pU(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Zge(i)),K(e,t,o,s)},Xge=function(e,t,i){const s=pU(t);return Qge(e,s,i)};function Qge(n,e,t){return K(n,$d&&C4.pointerEvents?le.POINTER_DOWN:le.MOUSE_DOWN,e,t)}let mU,$o;class $k{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){pt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort($k.sort),e.shift().execute();i=!1};$o=(o,r=0)=>{const a=new $k(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},mU=(o,r)=>{if(i){const a=new $k(o,r);return e.push(a),a}else return $o(o,r)}})();function FL(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function BL(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new Xt(n.clientWidth,n.clientHeight);if($d&&(i!=null&&i.visualViewport))return new Xt(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new Xt(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Xt(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Xt(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class fi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=FL(e),o=s?s.getPropertyValue(t):"0";return fi.convertToPixels(e,o)}static getBorderLeftWidth(e){return fi.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return fi.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return fi.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return fi.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return fi.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return fi.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return fi.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return fi.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return fi.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return fi.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return fi.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return fi.getDimension(e,"margin-bottom","marginBottom")}}class Xt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Xt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Xt?e:new Xt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Xt.None=new Xt(0,0);function _U(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=bU(n)?null:FL(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=fi.getBorderLeftWidth(n),t+=fi.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Nn(n){var e,t,i,s;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((s=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&s!==void 0?s:0),width:o.width,height:o.height}}function Jge(n){let e=n,t=1;do{const i=FL(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ws(n){const e=fi.getMarginLeft(n)+fi.getMarginRight(n);return n.offsetWidth+e}function Uk(n){const e=fi.getBorderLeftWidth(n)+fi.getBorderRightWidth(n),t=fi.getPaddingLeft(n)+fi.getPaddingRight(n);return n.offsetWidth-e-t}function epe(n){const e=fi.getBorderTopWidth(n)+fi.getBorderBottomWidth(n),t=fi.getPaddingTop(n)+fi.getPaddingBottom(n);return n.offsetHeight-e-t}function uh(n){const e=fi.getMarginTop(n)+fi.getMarginBottom(n);return n.offsetHeight+e}function Cn(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function tpe(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function jk(n,e,t){return!!tpe(n,e,t)}function bU(n){return n&&!!n.host&&!!n.mode}function IA(n){return!!Qp(n)}function Qp(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return bU(n)?n:null}function Yr(){let n=ipe().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ipe(){var n;return(n=[document,...Kge().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function vr(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let qk=null;function vU(){return qk||(qk=vr()),qk}function npe(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function AA(n,e,t=vU()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function FF(n,e=vU()){if(!e)return;const t=npe(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function x4(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const le={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Eh?"webkitAnimationStart":"animationstart",ANIMATION_END:Eh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Eh?"webkitAnimationIteration":"animationiteration"};function spe(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Ue={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function ope(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function rpe(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class oS extends Y{static hasFocusWithin(e){if(x4(e)){const t=Qp(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Cn(i,e)}else return Cn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=oS.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{oS.hasFocusWithin(e)!==t&&(t?o():s())},this._register(K(e,le.FOCUS,s,!0)),this._register(K(e,le.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(K(e,le.FOCUS_IN,()=>this._refreshStateHandler())),this._register(K(e,le.FOCUS_OUT,()=>this._refreshStateHandler())))}}function jd(n){return new oS(n)}function re(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function wU(n,e){return n.insertBefore(e,n.firstChild),e}function cs(n,...e){n.innerText="",re(n,...e)}const ape=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var vb;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(vb||(vb={}));function yU(n,e,t,...i){const s=ape.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==vb.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function we(n,e,...t){return yU(vb.HTML,n,e,...t)}we.SVG=function(n,e,...t){return yU(vb.SVG,n,e,...t)};function lpe(n,...e){n?Ah(...e):Yc(...e)}function Ah(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Yc(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function BF(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function CU(n){window.open(n,"_blank","noopener")}function cpe(n){const e=()=>{n(),t=$o(e)};let t=$o(e);return Ze(()=>t.dispose())}fU.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function qd(n){return n?`url('${gU.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function WF(n){return`'${n.replace(/'/g,"%27")}'`}function Th(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Th(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function dpe(n,e=!1){const t=document.createElement("a");return uU("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ze(()=>{hU("afterSanitizeAttributes")})}const upe=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Zc extends B{constructor(){super(),this._subscriptions=new fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(K(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Wt(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(K(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(K(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(K(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Zc.instance||(Zc.instance=new Zc),Zc.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class hpe extends Y{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(K(this.element,le.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(K(this.element,le.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(K(this.element,le.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(K(this.element,le.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(K(this.element,le.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const fpe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function dn(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=fpe.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),i)for(const c of i)c instanceof HTMLElement?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,h]of Object.entries(d))r.style.setProperty(VF(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(VF(c),d.toString());return l.root=r,l}function VF(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class WL{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=xe.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Ps.registerKeybindingRule(s)}}Gt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){or.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class L4 extends WL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(tt).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return wr.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Zt extends wr{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=A.EditorContext),s.title||(s.title=e.label),s.when=xe.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Zt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(hc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class xU extends Zt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;const l=o.get(tt),c=o.get(fc);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,s,...t)})}}function Pm(n,e){Gt.registerCommand(n,function(t,...i){const s=t.get(bt),[o,r]=i;xs(je.isUri(o)),xs(H.isIPosition(r));const a=t.get(hs).getModel(o);if(a){const l=H.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(hu).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,H.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function ke(n){return Mo.INSTANCE.registerEditorCommand(n),n}function Xe(n){const e=new n;return Mo.INSTANCE.registerEditorAction(e),e}function LU(n){return Mo.INSTANCE.registerEditorAction(n),n}function ppe(n){Mo.INSTANCE.registerEditorAction(n)}function Sr(n,e,t){Mo.INSTANCE.registerEditorContribution(n,e,t)}var ep;(function(n){function e(r){return Mo.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return Mo.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Mo.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return Mo.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return Mo.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(ep||(ep={}));const mpe={EditorCommonContributions:"editor.contributions"};class Mo{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Mo.INSTANCE=new Mo;mn.add(mpe.EditorCommonContributions,Mo.INSTANCE);function w1(n){return n.register(),n}const DU=w1(new L4({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:A.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));w1(new SU(DU,{id:"default:undo",precondition:void 0}));const kU=w1(new L4({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:A.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));w1(new SU(kU,{id:"default:redo",precondition:void 0}));const _pe=w1(new L4({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:A.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:A.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),EU=Symbol("MicrotaskDelay");var Io=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},M0=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};function TA(n){return!!n&&typeof n.then=="function"}function gc(n){const e=new Cr,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new Nm)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function bpe(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class vpe{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}const wpe=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},ype=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class gu{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{var s;this.deferred=null,(s=this.doResolve)===null||s===void 0||s.call(this,null)};return this.deferred=t===EU?ype(i):wpe(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new Nm),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class IU{constructor(e){this.delayer=new gu(e),this.throttler=new vpe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function wb(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new Nm)})}):gc(t=>wb(n,t))}function rS(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=Ze(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}class pc{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class y1{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class xi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Xc;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Xc=n=>{x$(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Xc=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class Cpe{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Xc(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class AU{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Nm)}}var NA;(function(n){function e(i){return Io(this,void 0,void 0,function*(){let s;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o})}n.settled=e;function t(i){return new Promise((s,o)=>Io(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(NA||(NA={}));class ln{static fromArray(e){return new ln(t=>{t.emitMany(e)})}static fromPromise(e){return new ln(t=>Io(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new ln(t=>Io(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>Io(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new ln(t=>Io(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return Io(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=M0(i);r=yield o.next(),a=r.done,!a;s=!0){d=r.value,s=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!s&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new B,queueMicrotask(()=>Io(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>Io(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(eIo(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=M0(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;i.emitOne(t(u))}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}map(e){return ln.map(this,e)}static filter(e,t){return new ln(i=>Io(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=M0(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;t(u)&&i.emitOne(u)}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}filter(e){return ln.filter(this,e)}static coalesce(e){return ln.filter(e,t=>!!t)}coalesce(){return ln.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return Io(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=M0(e);s=yield i.next(),o=s.done,!o;t=!0){l=s.value,t=!1;const d=l;c.push(d)}}catch(d){r={error:d}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(r)throw r.error}}return c})}toPromise(){return ln.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ln.EMPTY=ln.fromArray([]);class Spe extends ln{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function xpe(n){const e=new Cr,t=n(e.token);return new Spe(e,i=>Io(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new Nm)});try{try{for(var c=!0,d=M0(t),u;u=yield d.next(),s=u.done,!s;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!s&&(r=d.return)&&(yield r.call(d))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const Lpe="$initialize";let HF=!1;function MA(n){Am&&(HF||(HF=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class Dpe{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class zF{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class kpe{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class Epe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Ipe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Ape{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new Dpe(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new kpe(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Ipe(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new zF(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=cF(s.detail)),this._send(new zF(this._workerId,t,void 0,cF(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new Epe(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{s==null||s(d)})),this._protocol=new Ape({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(NU(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(TU(d)){const h=i[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=QR(i);this._onModuleLoaded=this._protocol.sendMessage(Lpe,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{s=u,this._onModuleLoaded.then(h=>{d(Npe(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function TU(n){return n[0]==="o"&&n[1]==="n"&&Pc(n.charCodeAt(2))}function NU(n){return/^onDynamic/.test(n)&&Pc(n.charCodeAt(9))}function Npe(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(NU(r)){o[r]=s(r);continue}if(TU(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function If(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){pt(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){pt(s);return}}const $F=If("defaultWorkerFactory",{createScriptURL:n=>n});function Mpe(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker($F?$F.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Rpe(n){return typeof n.then=="function"}class Ppe{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=Mpe(i);Rpe(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){s(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(s=>{try{s.postMessage(e,t)}catch(o){pt(o),pt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class VL{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++VL.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Ppe(e,s,this._label||"anonymous"+s,t,o=>{MA(o),this._webWorkerFailedBeforeError=o,i(o)})}}VL.LAST_WORKER_ID=0;var ns;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(ns||(ns={}));class Gk{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(r-1)===s;)r--;return new Fpe(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class Fpe{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function ga(n){return(n&3)!==0}class Jp{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Gk(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Gk({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Gk({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Jp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Jp.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}}Jp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `;Jp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `;const UF=typeof Buffer<"u";let Kk;class D4{static wrap(e){return UF&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new D4(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return UF?this.buffer.toString():(Kk||(Kk=new TextDecoder),Kk.decode(this.buffer))}}function Bpe(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function Wpe(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Or(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function Fr(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function jF(n,e){return n[e]}function qF(n,e,t){n[t]=e}let Yk;function MU(){return Yk||(Yk=new TextDecoder("UTF-16LE")),Yk}let Zk;function Vpe(){return Zk||(Zk=new TextDecoder("UTF-16BE")),Zk}let Xk;function RU(){return Xk||(Xk=Uue()?MU():Vpe()),Xk}function Hpe(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?zpe(n,e,t):MU().decode(i)}function zpe(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},s=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:l})}return o}class Upe{constructor(e,t){this._richEditBracketsBrand=void 0;const i=$pe(t);this.brackets=i.map((s,o)=>new aS(e,o,s.open,s.close,jpe(s.open,s.close,i,o),qpe(s.open,s.close,i,o))),this.forwardRegex=Gpe(this.brackets),this.reversedRegex=Kpe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function PU(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function OU(n,e){return n.length-e.length}function $L(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function jpe(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return RU().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class tr{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=s+r;return new N(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=k4(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=s+r;return new N(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class Zpe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return Qh(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(ga(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=tr.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function xw(n){return n.global&&(n.lastIndex=0),!0}class Xpe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&xw(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&xw(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&xw(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&xw(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class xg{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=xg._createOpenBracketRegExp(t[0]),s=xg._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let o=0,r=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function Jpe(n){return n.replace(/[\[\]]/g,"")}const Ii=at("languageService");class wa{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const WU=[];function ht(n,e,t){e instanceof wa||(e=new wa(e,[],!!t)),WU.push([n,e])}function KF(){return WU}const Pl=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),jL={JSONContribution:"base.contributions.json"};function eme(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class tme{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[eme(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const ime=new tme;mn.add(jL.JSONContribution,ime);const Af={Configuration:"base.contributions.configuration"},n0="vscode://schemas/settings/resourceLanguage",YF=mn.as(jL.JSONContribution);class nme{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},YF.registerSchema(n0,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),YF.registerSchema(n0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const s=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),Gd.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const f of Object.keys(o[a]))c.set(f,r);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});const u=Jpe(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:n0,defaultDefaultValue:d,source:Ns(r)?void 0:r,defaultValueSource:r};s.push(...lS(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(s)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,t=!0,i,s,o=3,r){var a;o=go(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&rme(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),Gd.test(d)?u.scope=void 0:(u.scope=go(u.scope)?o:u.scope,u.restricted=go(u.restricted)?!!(s!=null&&s.includes(d)):u.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,i,s,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:m("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:n0};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),m("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i==null?void 0:i.value,o=i==null?void 0:i.source;$s(s)&&(s=t.defaultDefaultValue,o=void 0),$s(s)&&(s=ome(t.type)),t.default=s,t.defaultValueSource=o}}const VU="\\[([^\\]]+)\\]",ZF=new RegExp(VU,"g"),sme=`^(${VU})+$`,Gd=new RegExp(sme);function lS(n){const e=[];if(Gd.test(n)){let t=ZF.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=ZF.exec(n)}}return Qh(e)}function ome(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const zy=new nme;mn.add(Af.Configuration,zy);function rme(n,e){var t,i,s,o;return n.trim()?Gd.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):zy.getConfigurationProperties()[n]!==void 0?m("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&zy.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?m("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(s=e.policy)===null||s===void 0?void 0:s.name,zy.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const ame={ModesRegistry:"editor.modesRegistry"};class lme{constructor(){this._onDidChangeLanguages=new B,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new ume(this,a,l),closing:l}}),o=new vF(a=>{const l=new Set,c=new Set;return{info:new hme(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?XF(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function XF(n){return n.filter(([e,t])=>e!==""&&t!=="")}class HU{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class ume extends HU{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class hme extends HU{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var fme=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},QF=function(n,e){return function(t,i){e(t,i,n)}};class Qk{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const no=at("languageConfigurationService");let PA=class extends Y{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new _me),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(OA));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Qk(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Qk(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new Qk(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=gme(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};PA=fme([QF(0,ei),QF(1,Ii)],PA);function gme(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new ip(n,{});s=new ip(n,{})}const o=pme(s.languageId,t),r=$U([s.underlyingConfig,o]);return new ip(s.languageId,r)}const OA={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function pme(n,e){const t=e.getValue(OA.brackets,{overrideIdentifier:n}),i=e.getValue(OA.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:JF(t),colorizedBracketPairs:JF(i)}}function JF(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function zU(n,e,t){const i=n.getLineContent(e);let s=Ws(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function tp(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return HL(i,s)}class mme{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new e9(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ze(()=>{for(let s=0;se.configuration)))}}function $U(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class e9{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class t9{constructor(e){this.languageId=e}}class _me extends Y{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register(Vo,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new mme(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new t9(e)),Ze(()=>{o.dispose(),this._onDidChange.fire(new t9(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class ip{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new xg(this.underlyingConfig):null,this.comments=ip._handleComments(this.underlyingConfig),this.characterPair=new Jp(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||t4,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Xpe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new dme(e,this.underlyingConfig)}getWordDefinition(){return k$(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Upe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Zpe(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new Ope(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ht(no,PA,1);class Ic{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function bme(n){return qL(n,0)}function qL(n,e){switch(typeof n){case"object":return n===null?zl(349,e):Array.isArray(n)?wme(n,e):yme(n,e);case"string":return E4(n,e);case"boolean":return vme(n,e);case"number":return zl(n,e);case"undefined":return zl(937,e);default:return zl(617,e)}}function zl(n,e){return(e<<5)-e+n|0}function vme(n,e){return zl(n?433:863,e)}function E4(n,e){e=zl(149417,e);for(let t=0,i=n.length;tqL(i,t),e)}function yme(n,e){return e=zl(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=E4(i,t),qL(n[i],t)),e)}function Jk(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function i9(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):Cme((n>>>0).toString(16),e/4)}class GL{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(tn(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),s0(this._h0)+s0(this._h1)+s0(this._h2)+s0(this._h3)+s0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,i9(this._buff,this._buffLen),this._buffLen>56&&(this._step(),i9(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=GL._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,Jk(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=s&o|~s&r,c=1518500249):u<40?(l=s^o^r,c=1859775393):u<60?(l=s&o|s&r|o&r,c=2400959708):(l=s^o^r,c=3395469782),d=Jk(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=Jk(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}GL._bigBlock32=new DataView(new ArrayBuffer(320));class n9{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Ic(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Ol{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Ol._getElements(e),[a,l,c]=Ol._getElements(t);this._hasStrings=r&&c,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Ol._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let u;return i<=s?(Jf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Ic(e,0,i,s-i+1)]):e<=t?(Jf.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Ic(e,t-e+1,i,0)]):(Jf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Jf.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,r,a,o),c=r[0],d=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,c,i,d,o);let h=[];return o[0]?h=[new Ic(c+1,t-(c+1)+1,d+1,s-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,s,o),this.ConcatenateChanges(u,h)}return[new Ic(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b){let w=null,y=null,S=new s9,L=t,x=i,D=f[0]-_[0]-s,k=-1073741824,P=this.m_forwardHistory.length-1;do{const O=D+e;O===L||O=0&&(c=this.m_forwardHistory[P],e=c[0],L=1,x=c.length-1)}while(--P>=-1);if(w=S.getReverseChanges(),b[0]){let O=f[0]+1,R=_[0]+1;if(w!==null&&w.length>0){const M=w[w.length-1];O=Math.max(O,M.getOriginalEnd()),R=Math.max(R,M.getModifiedEnd())}y=[new Ic(O,h-O+1,R,p-R+1)]}else{S=new s9,L=r,x=a,D=f[0]-_[0]-l,k=1073741824,P=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=D+o;O===L||O=d[O+1]?(u=d[O+1]-1,g=u-D-l,u>k&&S.MarkNextChange(),k=u+1,S.AddOriginalElement(u+1,g+1),D=O+1-o):(u=d[O-1],g=u-D-l,u>k&&S.MarkNextChange(),k=u,S.AddModifiedElement(u+1,g+1),D=O-1-o),P>=0&&(d=this.m_reverseHistory[P],o=d[0],L=1,x=d.length-1)}while(--P>=-1);y=S.getChanges()}return this.ConcatenateChanges(w,y)}ComputeRecursionPoint(e,t,i,s,o,r,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(s-i),p=g+1,_=new Int32Array(p),v=new Int32Array(p),b=s-i,w=t-e,y=e-i,S=t-s,x=(w-b)%2===0;_[b]=e,v[w]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let k=0,P=0;d=this.ClipDiagonalBound(b-D,D,b,p),u=this.ClipDiagonalBound(b+D,D,b,p);for(let R=d;R<=u;R+=2){R===d||Rk+P&&(k=l,P=c),!x&&Math.abs(R-w)<=D-1&&l>=v[R])return o[0]=l,r[0]=c,M<=v[R]&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):null}const O=(k-e+(P-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,O))return a[0]=!0,o[0]=k,r[0]=P,O>0&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):(e++,i++,[new Ic(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(w-D,D,w,p),f=this.ClipDiagonalBound(w+D,D,w,p);for(let R=h;R<=f;R+=2){R===h||R=v[R+1]?l=v[R+1]-1:l=v[R-1],c=l-(R-w)-S;const M=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[R]=l,x&&Math.abs(R-b)<=D&&l<=_[R])return o[0]=l,r[0]=c,M>=_[R]&&1447>0&&D<=1447+1?this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a):null}if(D<=1447){let R=new Int32Array(u-d+2);R[0]=b-d+1,eg.Copy2(_,d,R,1,u-d+1),this.m_forwardHistory.push(R),R=new Int32Array(f-h+2),R[0]=w-h+1,eg.Copy2(v,h,R,1,f-h+1),this.m_reverseHistory.push(R)}}return this.WALKTRACE(b,d,u,y,w,h,f,S,_,v,l,t,o,c,s,r,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const u=e[t-1];s=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,f=i.modifiedStart-u;if(hc&&(c=p,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return eg.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],eg.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return eg.Copy(e,0,s,0,e.length),eg.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(Jf.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Jf.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Ic(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function tg(n){return n<0?0:n>4294967295?4294967295:n|0}class xme{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=tg(e);const i=this.values,s=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=tg(e),t=tg(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=tg(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new UU(s,e-r)}}class Lme{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new UU(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=CL(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class kme{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new kme(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let e2=null;function Ime(){return e2===null&&(e2=new Eme([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),e2}let o0=null;function Ame(){if(o0===null){o0=new C1(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=Ime()){const i=Ame(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,_=!1;for(;c=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}FA.INSTANCE=new FA;class Nme extends C1{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const tm=Mme(n=>new Nme(n));var Uo;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Uo||(Uo={}));var np;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(np||(np={}));var Ks;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Ks||(Ks={}));var im;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(im||(im={}));class $y{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Co(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class yb{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function Rme(n){return n&&typeof n.read=="function"}class t2{constructor(e,t,i,s,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class Pme{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class Ome{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Fme(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const Bme=999;class Hu{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Wme(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=q$(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 Pme(t,this.wordSeparators?tm(this.wordSeparators):null,i?this.searchString:null)}}function Wme(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function qu(n,e,t){if(!t)return new yb(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class Lw{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Lg(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new N(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new o9(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=qu(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,s),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,s,o){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,s,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const d=new Lg(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=qu(new N(i,u.index+1+s,i,u.index+1+u[0].length+s),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Lg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new H(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new N(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new o9(l):null;i.reset(t.column-1);const d=i.next(l);return d?qu(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new H(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,s);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,s);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?qu(new N(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Lg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new N(1,1,t.lineNumber,t.column),i,s,10*Bme);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new H(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,s);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,s);if(h)return h}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=qu(new N(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function Vme(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function Hme(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==0)return!0}return!1}function I4(n,e,t,i,s){return Vme(n,e,t,i,s)&&Hme(n,e,t,i,s)}class Lg{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 s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){tS(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||I4(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class zme{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new r9(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${$me(Array.from(a))}`,"g");const c=new Lg(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),w=b.length;c.reset(0);do if(h=c.next(b),h){let y=h.index,S=h.index+h[0].length;if(y>0){const k=b.charCodeAt(y-1);tn(k)&&y--}if(S+1=k){u=!0;break e}d.push(new N(_,y+1,_,S+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new r9(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=Jh.getLocales().filter(l=>!Jh.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function $me(n,e){return`[${mr(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class r9{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Jh.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of gd.codePoints)a9(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=g4(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!gd.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!a9(e)&&gd.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function a9(n){return n===" "||n===` +`||n===" "}class Uy{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class jU{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Ye{static addRange(e,t){let i=0;for(;it))return new Ye(e,t)}static ofLength(e){return new Ye(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new $i(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Ye(this.start+e,this.endExclusive+e)}deltaStart(e){return new Ye(this.start+e,this.endExclusive)}deltaEnd(e){return new Ye(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function BA(n,e,t){const i=Ume(n,e);if(i!==-1)return n[i]}function Ume(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function Cb(n,e){const t=Sb(n,e);return t===-1?void 0:n[t]}function Sb(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function Gme(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function Kme(n,e){return qme(n,(t,i)=>-e(t,i))}function Yme(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}let Qe=class Ac{static fromRange(e){return new Ac(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new xa(e[0].slice());for(let i=1;it)throw new $i(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=Sb(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=Cb(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new Qe(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new xa(t)}subtractFrom(e){const t=xb(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Sb(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new xa([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Qe(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class Ga{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new jo(new Qe(o,l.original.startLineNumber),new Qe(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new jo(new Qe(o,t+1),new Qe(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ga(this.modified,this.original)}join(e){return new Ga(this.original.join(e.original),this.modified.join(e.modified))}}class jo extends Ga{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new jo(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Kd{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Kd(this.modifiedRange,this.originalRange)}}const Zme=3;class Xme{computeDiff(e,t,i){var s;const r=new e0e(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new Qe(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Qe(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Qe(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Qe(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new jo(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new Kd(new N(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new N(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new jo(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return _b(()=>nU(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class sp{constructor(e,t,i,s,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new sp(s,o,r,a,l,c,d,u)}}function Jme(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=qU(f,g,o,!0).changes;a&&(p=Jme(p)),h=[];for(let _=0,v=p.length;_1&&p>1;){const _=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(_!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,g,r+1,1,p)}{let g=VA(h,1),p=VA(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(un.fromOffsetPairs(s?s.getEndExclusives():Ta.zero,o?o.getStarts():new Ta(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new un(new Ye(e.offset1,t.offset1),new Ye(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new un(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new un(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new un(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new un(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new un(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new un(t,i)}getStarts(){return new Ta(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ta(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Ta{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Ta.zero=new Ta(0,0);Ta.max=new Ta(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Lb{isValid(){return!0}}Lb.instance=new Lb;class t0e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new $i("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&r.get(g-1,p-1)===3&&(b+=a.get(g-1,p-1)),b+=s?s(g,p):1):b=-1;const w=Math.max(_,v,b);if(w===b){const y=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,y+1),r.set(g,p,3)}else w===_?(a.set(g,p,0),r.set(g,p,1)):w===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,w)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new un(new Ye(g+1,c),new Ye(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new Ql(l,!1)}}class GU{compute(e,t,i=Lb.instance){if(e.length===0||t.length===0)return Ql.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||y>o.length)continue;const S=r(w,y);l.set(d,S);const L=w===v?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new d9(L,w,y,S-w):L),l.get(d)===s.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=s.length,g=o.length;for(;;){const p=u?u.x+u.length:0,_=u?u.y+u.length:0;if((p!==f||_!==g)&&h.push(new un(new Ye(p,f),new Ye(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new Ql(h,!1)}}class d9{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class n0e{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 s0e{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}}var u9,h9;class o0e{constructor(e,t){this.uri=e,this.value=t}}function r0e(n){return Array.isArray(n)}class Tn{constructor(e,t){if(this[u9]="ResourceMap",e instanceof Tn)this.map=new Map(e.map),this.toKey=t??Tn.defaultToKey;else if(r0e(e)){this.map=new Map,this.toKey=t??Tn.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e??Tn.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new o0e(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(u9=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Tn.defaultToKey=n=>n.toString();class a0e{constructor(){this[h9]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}[(h9=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class T4 extends a0e{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class l0e{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class KU{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class uS{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Ye(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=g9(e>0?this.elements[e-1]:-1),i=g9(ei<=e);return new H(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return N.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!n2(this.elements[e]))return;let t=e;for(;t>0&&n2(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=jme(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Ye(s,o)}}function n2(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const c0e={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function f9(n){return c0e[n]}function g9(n){return n===10?7:n===13?6:HA(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function d0e(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=u0e(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=h0e(l,i,s,e,t,o);return SI(r,c),r=f0e(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` +`).length>=10),r=g0e(n,r),r}function u0e(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new nm(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new nm(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),s.push(new Ga(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function h0e(n,e,t,i,s,o){const r=[],a=new KU;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,ud));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const y of f)if(y.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){y.originalLineRange=new Qe(y.originalLineRange.startLineNumber,b.endLineNumberExclusive),y.modifiedLineRange=new Qe(y.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(y);return}const w={modifiedLineRange:_,originalLineRange:b};l.push(w),v.push(w)}),f=v}if(!o.isValid())return[]}l.sort(b$(cr(h=>h.modifiedLineRange.length,ud)));const c=new xa,d=new xa;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(p);for(const v of _.ranges){if(v.length<3)continue;const b=v,w=v.delta(-f);r.push(new Ga(w,b)),c.addRange(b),d.addRange(w)}}r.sort(cr(h=>h.original.startLineNumber,ud));const u=new S1(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=Cb(n,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||x>s.length||c.contains(x)||d.contains(L)||!p9(i[L-1],s[x-1],o))break}y>0&&(d.addRange(new Qe(f.original.startLineNumber-y,f.original.startLineNumber)),c.addRange(new Qe(f.modified.startLineNumber-y,f.modified.startLineNumber)));let S;for(S=0;Si.length||x>s.length||c.contains(x)||d.contains(L)||!p9(i[L-1],s[x-1],o))break}S>0&&(d.addRange(new Qe(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),c.addRange(new Qe(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(y>0||S>0)&&(r[h]=new Ga(new Qe(f.original.startLineNumber-y,f.original.endLineNumberExclusive+S),new Qe(f.modified.startLineNumber-y,f.modified.endLineNumberExclusive+S)))}return r}function p9(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new GU().compute(new uS([n],new Ye(0,1),!1),new uS([e],new Ye(0,1),!1),t);let o=0;const r=un.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{HA(n.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;he.length?n:e);return o/l>.6&&l>10}function f0e(n){if(n.length===0)return n;n.sort(cr(t=>t.original.startLineNumber,ud));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function g0e(n,e){const t=new S1(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function m0e(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+ac&&(c=g,l=d)}return n.delta(l)}function _0e(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new un(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function b0e(n,e,t){const i=[];let s;function o(){if(!s)return;const a=s.s1Range.length-s.deleted;s.s2Range.length-s.added,Math.max(s.deleted,s.added)+(s.count-1)>a&&i.push(new un(s.s1Range,s.s2Range)),s=void 0}for(const a of t){let l=function(f,g){var p,_,v,b;if(!s||!s.s1Range.containsRange(f)||!s.s2Range.containsRange(g))if(s&&!(s.s1Range.endExclusive0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function w0e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(s++<10&&o);return i}function y0e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const v=n.getText(p).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),w=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),S=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),x=g.seq1Range.length,D=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,P=2*40+50;function O(R){return Math.min(R,P)}return Math.pow(Math.pow(O(b*40+w),1.5)+Math.pow(O(y*40+S),1.5),1.5)+Math.pow(Math.pow(O(L*40+x),1.5)+Math.pow(O(D*40+k),1.5),1.5)>Math.pow(Math.pow(P,1.5),1.5)*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(s++<10&&o);const r=[];return Lue(i,(a,l,c)=>{let d=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new Ye(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Ye(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=un.fromOffsetPairs(a?a.getEndExclusives():Ta.zero,c?c.getStarts():Ta.max),_=d.intersect(p);r.push(_)}),r}class _9{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:b9(this.lines[e-1]),i=e===this.lines.length?0:b9(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function b9(n){let e=0;for(;eS===L))return new Uy([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Uy([new jo(new Qe(1,e.length+1),new Qe(1,t.length+1),[new Kd(new N(1,1,e.length,e[0].length+1),new N(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Lb.instance:new t0e(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let L=r.get(S);return L===void 0&&(L=r.size,r.set(S,L)),L}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),d=new _9(l,e),u=new _9(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(S,L)=>e[S]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u))();let f=h.diffs,g=h.hitTimeout;f=zA(d,u,f),f=w0e(d,u,f);const p=[],_=S=>{if(o)for(let L=0;LS.seq1Range.start-v===S.seq2Range.start-b);const L=S.seq1Range.start-v;_(L),v=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const x=this.refineDiff(e,t,S,s,o);x.hitTimeout&&(g=!0);for(const D of x.mappings)p.push(D)}_(e.length-v);const w=v9(p,e,t);let y=[];return i.computeMoves&&(y=this.computeMoves(w,e,t,l,c,s,o)),_b(()=>{function S(x,D){if(x.lineNumber<1||x.lineNumber>D.length)return!1;const k=D[x.lineNumber-1];return!(x.column<1||x.column>k.length+1)}function L(x,D){return!(x.startLineNumber<1||x.startLineNumber>D.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>D.length+1)}for(const x of w){if(!x.innerChanges)return!1;for(const D of x.innerChanges)if(!(S(D.modifiedRange.getStartPosition(),t)&&S(D.modifiedRange.getEndPosition(),t)&&S(D.originalRange.getStartPosition(),e)&&S(D.originalRange.getEndPosition(),e)))return!1;if(!L(x.modified,t)||!L(x.original,e))return!1}return!0}),new Uy(w,y,g)}computeMoves(e,t,i,s,o,r,a){return d0e(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new un(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=v9(u.mappings,t,i,!0);return new jU(d,h)})}refineDiff(e,t,i,s,o){const r=new uS(e,i.seq1Range,o),a=new uS(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let c=l.diffs;return c=zA(r,a,c),c=b0e(r,a,c),c=_0e(r,a,c),c=y0e(r,a,c),{mappings:c.map(u=>new Kd(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function v9(n,e,t,i=!1){const s=[];for(const o of f$(n.map(r=>C0e(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new jo(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return _b(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:nU(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new Qe(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Qe(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new jo(o,r,[n])}const w9={getLegacy:()=>new Xme,getDefault:()=>new YU};function pd(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ut{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=pd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class ir{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pd(Math.max(Math.min(1,t),0),3),this.l=pd(Math.max(Math.min(1,i),0),3),this.a=pd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,c=0;const d=(a+r)/2,u=r-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),r){case t:l=(i-s)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,l;if(i===0)r=a=l=s;else{const c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;r=ir._hue2rgb(d,c,t+1/3),a=ir._hue2rgb(d,c,t),l=ir._hue2rgb(d,c,t-1/3)}return new ut(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class Dg{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pd(Math.max(Math.min(1,t),0),3),this.v=pd(Math.max(Math.min(1,i),0),3),this.a=pd(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-s)/a%6+6)%6:o===i?c=(s-t)/a+2:c=(t-i)/a+4,new Dg(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),l=s-r;let[c,d,u]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,u=a):t<240?(d=a,u=r):t<300?(c=a,u=r):t<=360&&(c=r,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new ut(c,d,u,o)}}class z{static fromHex(e){return z.Format.CSS.parseHex(e)||z.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:ir.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Dg.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ut)this.rgba=e;else if(e instanceof ir)this._hsla=e,this.rgba=ir.toRGBA(e);else if(e instanceof Dg)this._hsva=e,this.rgba=Dg.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ut.equals(this.rgba,e.rgba)&&ir.equals(this.hsla,e.hsla)&&Dg.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=z._relativeLuminanceForComponent(this.rgba.r),t=z._relativeLuminanceForComponent(this.rgba.g),i=z._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return pd(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const s of i){const o=s.filter(c=>c!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=y9(r0(n,s),a0(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=y9(r0(n,s),a0(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=C9(r0(n,s),a0(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=C9(r0(n,s),a0(a,c),!0)}else r==="#"&&(l=S0e(r0(n,s),r+a));l&&e.push(l)}return e}function L0e(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:x0e(n)}var Lc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class D0e extends Dme{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}class md{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new D0e(je.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return Lc(this,void 0,void 0,function*(){const s=this._getModel(e);return s?zme.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return Lc(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:md.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?w9.getDefault():w9.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return Lc(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return N.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lmd._diffLimit){o.push({range:l,text:c});continue}const h=Sme(u,c,i),f=s.offsetAt(N.lift(l).getStartPosition());for(const g of h){const p=s.positionAt(f+g.originalStart),_=s.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};s.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return Lc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?Tme(t):null})}computeDefaultDocumentColors(e){return Lc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?L0e(t):null})}textualSuggest(e,t,i,s){return Lc(this,void 0,void 0,function*(){const o=new du,r=new RegExp(i,s),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>md._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return Lc(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(QR(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}md._diffLimit=1e5;md._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=j$());const XU=at("textResourceConfigurationService"),QU=at("textResourcePropertiesService"),nt=at("ILanguageFeaturesService");var k0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},l0=function(n,e){return function(t,i){e(t,i,n)}},hS=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const S9=60*1e3,x9=5*60*1e3;function Gu(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let $A=class extends Y{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new I0e(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>Gu(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new E0e(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Gu(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return hS(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new jU(new Ga(new Qe(l[0],l[1]),new Qe(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new jo(new Qe(c[0],c[1]),new Qe(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Kd(new N(u[0],u[1],u[2],u[3]),new N(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(Zl(t)){if(!Gu(this._modelService,e))return Promise.resolve(t);const s=du.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,wb(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Gu(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Gu(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};$A=k0e([l0(0,hs),l0(1,XU),l0(2,fc),l0(3,no),l0(4,nt)],$A);class E0e{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return hS(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const s=[];if(i.wordBasedSuggestionsMode==="currentDocument")Gu(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())Gu(this._modelService,u.uri)&&(u===e?s.unshift(u.uri):(i.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&s.push(u.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new N(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):N.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class I0e extends Y{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new y1).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(x9/2)),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>x9&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new JU(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class A0e extends Y{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new y1;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(S9/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)Pt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>S9&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new fe;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ze(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Pt(t)}}class L9{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class s2{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class JU extends Y{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new VL(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Tpe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new s2(this)))}catch(e){MA(e),this._worker=new L9(new md(new s2(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(MA(e),this._worker=new L9(new md(new s2(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new A0e(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return hS(this,void 0,void 0,function*(){return this._disposed?Promise.reject(Whe()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return hS(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return s.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function T0e(n,e,t){return new N0e(n,e,t)}class N0e extends JU{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?QR(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const KL={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Db=new class{clone(){return this}equals(n){return this===n}};function ej(n,e){return new l4([new hb(0,"",n)],e)}function M4(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new LL(t,e===null?Db:e)}class zs{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),s&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;");let r="";return s&4&&(r+=" underline"),s&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class on{static createEmpty(e,t){const i=on.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new on(s,e,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 on?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=zs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return zs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return zs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return zs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return zs.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return zs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return on.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new R4(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];o.push(s.length,c),r=l.offset}s+=l.text,o.push(s.length,l.tokenMetadata),i++}else break}return new on(new Uint32Array(o),s,this._languageIdCodec)}}on.defaultTokenMetadata=(32768|2<<24)>>>0;class R4{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof R4?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class ar{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[l++]=new ar(Math.max(1,c.startColumn-s+1),Math.min(r+1,c.endColumn-s+1),c.className,c.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:s;o[r++]=new ar(u,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ar._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class M0e{static normalize(e,t){if(t.length===0)return[];const i=[],s=new fS;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);tn(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);tn(p)&&d--}const f=c-1,g=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(g,u,h)}return s.consumeLowerThan(1073741824,o,i),i}}class nn{constructor(e,t,i,s){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class tj{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Om{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,w){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ar.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=w&&w.sort((L,x)=>L.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=ya.getPartIndex(t),s=ya.getCharIndex(t);return new ij(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<<16|i<<0)>>>0;let o=0,r=this.length-1;for(;o+1>>1,_=this._data[p];if(_===s)return p;_>s?r=p:o=p}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===s)return o;if(l===s)return r;const c=ya.getPartIndex(a),d=ya.getCharIndex(a),u=ya.getPartIndex(l);let h;c!==u?h=t:h=ya.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class UA{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function P4(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,s=0;for(const r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(s|=1,t++),r.type===2&&(s|=2,i++));e.appendString("");const o=new ya(1,t+i);return o.setColumnInfo(1,t,0,0),new UA(o,!1,s)}return e.appendString(""),new UA(new ya(0,0),!1,0)}return z0e(O0e(n),e)}class R0e{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function YL(n){const e=new zL(1e4),t=P4(n,e);return new R0e(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class P0e{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=_}}function O0e(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(o[r++]=new nn(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?pb(n.substring(a,s)):!1;o[r++]=new nn(s,u,0,f);break}const h=e?pb(n.substring(a,d)):!1;o[r++]=new nn(d,u,0,h),a=d}return o}function B0e(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(s[o++]=new nn(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new nn(c,d,u,h))}else s[o++]=l;i=c}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function W0e(n,e){const t=[];let i=new nn(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new nn(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new nn(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new nn(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function V0e(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,u=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,f=[];let g=0,p=0,_=i[p].type,v=i[p].containsRTL,b=i[p].endIndex;const w=i.length;let y=!1,S=Gs(e),L;S===-1?(y=!0,S=t,L=t):L=Lf(e);let x=!1,D=0,k=c&&c[D],P=a%r;for(let R=o;R=k.endOffset&&(D++,k=c&&c[D]);let W;if(RL)W=!0;else if(M===9)W=!0;else if(M===32)if(d)if(x)W=!0;else{const G=R+1R),W&&u&&(W=y||R>L),W&&v&&R>=S&&R<=L&&(W=!1),x){if(!W||!l&&P>=r){if(h){const G=g>0?f[g-1].endIndex:o;for(let ne=G+1;ne<=R;ne++)f[g++]=new nn(ne,"mtkw",1,!1)}else f[g++]=new nn(R,"mtkw",1,!1);P=P%r}}else(R===b||W&&R>o)&&(f[g++]=new nn(R,_,0,v),P=P%r);for(M===9?P=r:Ud(M)?P+=2:P++,x=W;R===b&&(p++,p0?e.charCodeAt(t-1):0,M=t>1?e.charCodeAt(t-2):0;R===32&&M!==32&&M!==9||(O=!0)}else O=!0;if(O)if(h){const R=g>0?f[g-1].endIndex:o;for(let M=R+1;M<=t;M++)f[g++]=new nn(M,"mtkw",1,!1)}else f[g++]=new nn(t,"mtkw",1,!1);else f[g++]=new nn(t,_,0,v);return f}function H0e(n,e,t,i){i.sort(ar.compare);const s=M0e.normalize(n,i),o=s.length;let r=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=b.startOffset,a[l++]=new nn(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new nn(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let k=0,P=c.length;k=d&&(Se+=pe)}}for(ne&&(e.appendString(' style="width:'),e.appendString(String(g*ge)),e.appendString('px"')),e.appendASCIICharCode(62);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let pe=2;pe<=Ie;pe++)e.appendCharCode(160)}else Se=2,Ie=1,e.appendCharCode(p),e.appendCharCode(8204);L+=Se,x+=Ie,y>=d&&(S+=Ie)}}else for(e.appendASCIICharCode(62);y=d&&(S+=Se)}ce?D++:D=0,y>=r&&!w&&O.isPseudoAfter()&&(w=!0,b.setColumnInfo(y+1,k,L,x)),e.appendString("")}return w||b.setColumnInfo(r+1,c.length-1,L,x),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",U0e(l))),e.appendString("")),e.appendString(""),new UA(b,f,s)}function $0e(n){return n.toString(16).toUpperCase().padStart(4,"0")}function U0e(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class k9{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class j0e{constructor(e,t){this.tabSize=e,this.data=t}}class O4{constructor(e,t,i,s,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Do{constructor(e,t,i,s,o,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=Do.isBasicASCII(i,r),this.containsRTL=Do.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?g4(e):!0}static containsRTL(e,t,i){return!t&&i?pb(e):!1}}class u_{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class q0e{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new u_(new N(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class sj{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class kb{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ki(e.data,t.data)}static equalsArr(e,t){return Ki(e,t,kb.equals)}}function G0e(n){return Array.isArray(n)}function K0e(n){return!G0e(n)}function oj(n){return typeof n=="string"}function E9(n){return!oj(n)}function fg(n){return!n}function _d(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function I9(n){return n.replace(/[&<>'"_]/g,"-")}function Y0e(n,e){console.log(`${n.languageId}: ${e}`)}function Bt(n,e){return new Error(`${n.languageId}: ${e}`)}function Hc(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,c,d,u,h,f,g,p){return fg(c)?fg(d)?!fg(u)&&u0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function Z0e(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var X0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q0e=function(n,e){return function(t,i){e(t,i,n)}},jA;const rj=5;class Eb{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new op(e,t);let i=op.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new op(e,t),this._entries[i]=s,s)}}Eb._INSTANCE=new Eb(rj);class op{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return op._equals(this,e)}push(e){return Eb.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Eb.create(this.parent,e)}}class kg{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new kg(this.languageId,this.state)}}class zc{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new h_(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new h_(e,t);const i=op.getStackElementId(e);let s=this._entries[i];return s||(s=new h_(e,null),this._entries[i]=s,s)}}zc._INSTANCE=new zc(rj);class h_{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:zc.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof h_)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class J0e{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new hb(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=yi.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const l=a.tokenize(e,t,r);if(s!==0)for(const c of l.tokens)this._tokens.push(new hb(c.offset+s,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new l4(this._tokens,e)}}class gS{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=yi.get(t);if(i){if(i instanceof jA){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}yi.isResolved(t)||e.push(yi.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=Eb.create(null,this._lexer.start);return zc.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return ej(this._languageId,i);const s=new J0e,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return M4(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new gS(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Dw(this._lexer,t.stack.state),!i))throw Bt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!E9(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex;const l=r.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(s===-1||c0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const l=e.substring(r);return this._myTokenize(l,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[v];if(!k&&(k=Dw(this._lexer,v),!k))throw Bt(this._lexer,"tokenizer state is not defined: "+v);const P=a.substr(u);for(const O of k)if((u===0||!O.matchOnlyAtLineStart)&&(b=P.match(O.regex),b)){w=b[0],y=O.action;break}}if(b||(b=[""],w=""),y||(u=this._lexer.maxStack)throw Bt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(y.next==="@pop"){if(d.depth<=1)throw Bt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(y.next==="@popall")d=d.popall();else{let k=Hc(this._lexer,y.next,w,b,v);if(k[0]==="@"&&(k=k.substr(1)),Dw(this._lexer,k))d=d.push(k);else throw Bt(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(S))}}y.log&&typeof y.log=="string"&&Y0e(this._lexer,this._lexer.languageId+": "+Hc(this._lexer,y.log,w,b,v))}if(x===null)throw Bt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const D=k=>{const P=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,O=this._getNestedEmbeddedLanguageData(P);if(u0)throw Bt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==x.length+1)throw Bt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let k=0;for(let P=1;Pn});class F4{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=d=>{var u;const h=(u=o2==null?void 0:o2.createHTML(d))!==null&&u!==void 0?u:d;i.innerHTML=h};return this.colorize(t,l||"",a,s).then(c,d=>console.error(d))}static colorize(e,t,i,s){return t_e(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),m4(t)&&(t=t.substr(1));const a=xf(t);if(!e.isRegisteredLanguageId(i))return A9(a,r,o);const l=yield yi.getOrCreate(i);return l?i_e(a,r,l,o):A9(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=Do.isBasicASCII(e,t),a=Do.containsRTL(e,r,i);return YL(new Om(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function i_e(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=n_e(n,e,t,i);if(t instanceof Ib){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function A9(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=n.length;r")}return i.join("")}function n_e(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const T9=2e4;let Ku,jy,qA,qy,GA;function s_e(n){Ku=document.createElement("div"),Ku.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),Ku.appendChild(i),i};jy=e(),qA=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),Ku.appendChild(i),i};qy=t(),GA=t(),n.appendChild(Ku)}function x1(n){Ku&&(jy.textContent!==n?(Lo(qA),pS(jy,n)):(Lo(jy),pS(qA,n)))}function Ab(n){Ku&&(qy.textContent!==n?(Lo(GA),pS(qy,n)):(Lo(qy),pS(GA,n)))}function pS(n,e){Lo(n),e.length>T9&&(e=e.substr(0,T9)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const B4=at("markerDecorationsService");var o_e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},r_e=function(n,e){return function(t,i){e(t,i,n)}};let Tb=class{constructor(e,t){}dispose(){}};Tb.ID="editor.contrib.markerDecorations";Tb=o_e([r_e(1,B4)],Tb);Sr(Tb.ID,Tb,0);class aj extends Y{constructor(e,t){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{requestAnimationFrame(()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{e=r&&r[0]&&r[0].contentRect?r[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}class bd{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=bd._read(e,this.key),i=o=>bd._read(e,o),s=(o,r)=>bd._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}}bd.items=[];function pu(n,e){bd.items.push(new bd(n,e))}function Go(n,e){pu(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function a_e(n){bd.items.forEach(e=>e.apply(n))}Go("wordWrap",[[!0,"on"],[!1,"off"]]);Go("lineNumbers",[[!0,"on"],[!1,"off"]]);Go("cursorBlinking",[["visible","solid"]]);Go("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Go("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Go("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Go("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Go("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Go("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Go("autoIndent",[[!1,"advanced"],[!0,"full"]]);Go("matchBrackets",[[!0,"always"],[!1,"never"]]);Go("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Go("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);pu("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});pu("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});pu("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const l_e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};pu("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(l_e))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});pu("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});pu("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});pu("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class c_e{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const mS=new c_e,mu=at("accessibilityService"),d_e=new _e("accessibilityModeEnabled",!1);var u_e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},h_e=function(n,e){return function(t,i){e(t,i,n)}};let KA=class extends Y{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new A$,this.isSimpleWidget=e,this._containerObserver=this._register(new aj(i,t.dimension)),this._rawOptions=N9(t),this._validatedOptions=$c.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Vc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(mS.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(SA.onDidChange(()=>this._recomputeOptions())),this._register(nS.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=$c.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Ih.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:mS.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return $c.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:g_e(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Eh||_r,pixelRatio:nS.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return SA.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=N9(e);$c.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=$c.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=f_e(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};KA=u_e([h_e(3,mu)],KA);function f_e(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function g_e(){let n="";return!lc&&!Q$&&(n+="no-user-select "),lc&&(n+="no-minimap-shadow ",n+="enable-user-select "),gt&&(n+="mac "),n}class p_e{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class m_e{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class $c{static validateOptions(e){const t=new p_e;for(const i of yg){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new m_e;for(const s of yg)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ki(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!$c._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of yg){const r=!$c._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new I$(i):null}static applyUpdate(e,t){let i=!1;for(const s of yg)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function N9(n){const e=Cl(n);return a_e(e),e}function Li(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}var __e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Mt;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Mt||(Mt={}));class Tt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new Ds,this.ignoreTargets=new Ds,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(K(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(K(document,"touchend",e=>this.onTouchEnd(e))),this._register(K(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Tt.isTouchDevice())return Y.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);const t=Tt.INSTANCE.targets.push(e);return Ze(t)}static ignoreTarget(e){if(!Tt.isTouchDevice())return Y.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);const t=Tt.INSTANCE.ignoreTargets.push(e);return Ze(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Tt.HOLD_DELAY&&Math.abs(a.initialPageX-ko(a.rollingPageX))<30&&Math.abs(a.initialPageY-ko(a.rollingPageY))<30){const c=this.newGestureEvent(Mt.Contextmenu,a.initialTarget);c.pageX=ko(a.rollingPageX),c.pageY=ko(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=ko(a.rollingPageX),d=ko(a.rollingPageY),u=ko(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=d-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/u,h>0?1:-1,c,Math.abs(f)/u,f>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Mt.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Mt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Mt.Change||e.type===Mt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,s,o,r,a,l){this.handle=$o(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Tt.SCROLL_FRICTION*d,r+=Tt.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Mt.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,i,s,o+u,r,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Tt.SCROLL_FRICTION=-.005;Tt.HOLD_DELAY=700;Tt.CLEAR_TAP_COUNT_TIME=400;__e([Li],Tt,"isTouchDevice",null);class ZL{constructor(){this._hooks=new fe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ze(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(K(r,le.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(K(r,le.POINTER_UP,a=>this.stopMonitoring(!0)))}}function W4(n){return`--vscode-${n.replace(/\./g,"-")}`}function oe(n){return`var(${W4(n)})`}function b_e(n,e){return`var(${W4(n)}, ${e})`}const lj={ColorContribution:"base.contributions.colors"};class v_e{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return Nr(s,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const XL=new v_e;mn.add(lj.ColorContribution,XL);function E(n,e,t,i,s){return XL.registerColor(n,e,t,i,s)}const J=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const w_e=E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));E("descriptionForeground",{light:"#717171",dark:ye(J,.7),hcDark:ye(J,.7),hcLight:ye(J,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Qc=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),bo=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Je=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Ut=E("contrastActiveBorder",{light:null,dark:null,hcDark:bo,hcLight:bo},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));E("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},m("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."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:z.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const y_e=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));E("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:z.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:z.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const $l=E("widget.shadow",{dark:ye(z.black,.36),light:ye(z.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),cj=E("widget.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),C_e=E("input.background",{dark:"#3C3C3C",light:z.white,hcDark:z.black,hcLight:z.white},m("inputBoxBackground","Input box background.")),S_e=E("input.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("inputBoxForeground","Input box foreground.")),x_e=E("input.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("inputBoxBorder","Input box border.")),V4=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Je,hcLight:Je},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const hh=E("inputOption.activeBackground",{dark:ye(bo,.4),light:ye(bo,.2),hcDark:z.transparent,hcLight:z.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),H4=E("inputOption.activeForeground",{dark:z.white,light:z.black,hcDark:J,hcLight:J},m("inputOption.activeForeground","Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:ye(J,.5),dark:ye(J,.5),hcDark:ye(J,.7),hcLight:ye(J,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const L_e=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:z.black,hcLight:z.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),D_e=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),k_e=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Je,hcLight:Je},m("inputValidationInfoBorder","Input validation border color for information severity.")),E_e=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:z.black,hcLight:z.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),I_e=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),A_e=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Je,hcLight:Je},m("inputValidationWarningBorder","Input validation border color for warning severity.")),T_e=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:z.black,hcLight:z.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),N_e=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:J},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),M_e=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Je,hcLight:Je},m("inputValidationErrorBorder","Input validation border color for error severity.")),Na=E("dropdown.background",{dark:"#3C3C3C",light:z.white,hcDark:z.black,hcLight:z.white},m("dropdownBackground","Dropdown background.")),R_e=E("dropdown.listBackground",{dark:null,light:null,hcDark:z.black,hcLight:z.white},m("dropdownListBackground","Dropdown list background.")),Ul=E("dropdown.foreground",{dark:"#F0F0F0",light:J,hcDark:z.white,hcLight:J},m("dropdownForeground","Dropdown foreground.")),Eg=E("dropdown.border",{dark:Na,light:"#CECECE",hcDark:Je,hcLight:Je},m("dropdownBorder","Dropdown border.")),R0=E("button.foreground",{dark:z.white,light:z.white,hcDark:z.white,hcLight:z.white},m("buttonForeground","Button foreground color.")),P_e=E("button.separator",{dark:ye(R0,.4),light:ye(R0,.4),hcDark:ye(R0,.4),hcLight:ye(R0,.4)},m("buttonSeparator","Button separator color.")),P0=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),O_e=E("button.hoverBackground",{dark:Zr(P0,.2),light:Tf(P0,.2),hcDark:P0,hcLight:P0},m("buttonHoverBackground","Button background color when hovering.")),F_e=E("button.border",{dark:Je,light:Je,hcDark:Je,hcLight:Je},m("buttonBorder","Button border color.")),B_e=E("button.secondaryForeground",{dark:z.white,light:z.white,hcDark:z.white,hcLight:J},m("buttonSecondaryForeground","Secondary button foreground color.")),YA=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:z.white},m("buttonSecondaryBackground","Secondary button background color.")),W_e=E("button.secondaryHoverBackground",{dark:Zr(YA,.2),light:Tf(YA,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),Gy=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:z.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),V_e=E("badge.foreground",{dark:z.white,light:"#333",hcDark:z.white,hcLight:z.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),H_e=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),O0=E("scrollbarSlider.background",{dark:z.fromHex("#797979").transparent(.4),light:z.fromHex("#646464").transparent(.4),hcDark:ye(Je,.6),hcLight:ye(Je,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),F0=E("scrollbarSlider.hoverBackground",{dark:z.fromHex("#646464").transparent(.7),light:z.fromHex("#646464").transparent(.7),hcDark:ye(Je,.8),hcLight:ye(Je,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),B0=E("scrollbarSlider.activeBackground",{dark:z.fromHex("#BFBFBF").transparent(.4),light:z.fromHex("#000000").transparent(.6),hcDark:Je,hcLight:Je},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),z_e=E("progressBar.background",{dark:z.fromHex("#0E70C0"),light:z.fromHex("#0E70C0"),hcDark:Je,hcLight:Je},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));E("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ma=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),$_e=E("editorError.border",{dark:null,light:null,hcDark:z.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));E("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const vo=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Nb=E("editorWarning.border",{dark:null,light:null,hcDark:z.fromHex("#FFCC00").transparent(.8),hcLight:z.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));E("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const ks=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Mb=E("editorInfo.border",{dark:null,light:null,hcDark:z.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),U_e=E("editorHint.foreground",{dark:z.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:z.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));E("sash.hoverBorder",{dark:bo,light:bo,hcDark:bo,hcLight:bo},m("sashActiveBorder","Border color of active sashes."));const Gi=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:z.black,hcLight:z.white},m("editorBackground","Editor background color.")),_u=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:z.white,hcLight:J},m("editorForeground","Editor default foreground color."));E("editorStickyScroll.background",{light:Gi,dark:Gi,hcDark:Gi,hcLight:Gi},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:z.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const Vi=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:z.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Ra=E("editorWidget.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Ig=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Je,hcLight:Je},m("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),j_e=E("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},m("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),M9=E("quickInput.background",{dark:Vi,light:Vi,hcDark:Vi,hcLight:Vi},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),q_e=E("quickInput.foreground",{dark:Ra,light:Ra,hcDark:Ra,hcLight:Ra},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),G_e=E("quickInputTitle.background",{dark:new z(new ut(255,255,255,.105)),light:new z(new ut(0,0,0,.06)),hcDark:"#000000",hcLight:z.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),dj=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:z.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),K_e=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:z.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),Y_e=E("keybindingLabel.background",{dark:new z(new ut(128,128,128,.17)),light:new z(new ut(221,221,221,.4)),hcDark:z.transparent,hcLight:z.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Z_e=E("keybindingLabel.foreground",{dark:z.fromHex("#CCCCCC"),light:z.fromHex("#555555"),hcDark:z.white,hcLight:J},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),X_e=E("keybindingLabel.border",{dark:new z(new ut(51,51,51,.6)),light:new z(new ut(204,204,204,.4)),hcDark:new z(new ut(111,195,223)),hcLight:Je},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Q_e=E("keybindingLabel.bottomBorder",{dark:new z(new ut(68,68,68,.6)),light:new z(new ut(187,187,187,.4)),hcDark:new z(new ut(111,195,223)),hcLight:J},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Jc=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),J_e=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:z.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),uj=E("editor.inactiveSelectionBackground",{light:ye(Jc,.5),dark:ye(Jc,.5),hcDark:ye(Jc,.7),hcLight:ye(Jc,.5)},m("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),z4=E("editor.selectionHighlightBackground",{light:H9(Jc,Gi,.3,.6),dark:H9(Jc,Gi,.3,.6),hcDark:null,hcLight:null},m("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Ut,hcLight:Ut},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const ebe=E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),Pa=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),tbe=E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ibe=E("editor.findMatchBorder",{light:null,dark:null,hcDark:Ut,hcLight:Ut},m("editorFindMatchBorder","Border color of the current search match.")),ed=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Ut,hcLight:Ut},m("findMatchHighlightBorder","Border color of the other search matches.")),nbe=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:ye(Ut,.4),hcLight:ye(Ut,.4)},m("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("searchEditor.findMatchBackground",{light:ye(Pa,.66),dark:ye(Pa,.66),hcDark:Pa,hcLight:Pa},m("searchEditor.queryMatch","Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:ye(ed,.66),dark:ye(ed,.66),hcDark:ed,hcLight:ed},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));E("search.resultsInfoForeground",{light:J,dark:ye(J,.65),hcDark:J,hcLight:J},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const R9=E("editorHoverWidget.background",{light:Vi,dark:Vi,hcDark:Vi,hcLight:Vi},m("hoverBackground","Background color of the editor hover."));E("editorHoverWidget.foreground",{light:Ra,dark:Ra,hcDark:Ra,hcLight:Ra},m("hoverForeground","Foreground color of the editor hover."));const sbe=E("editorHoverWidget.border",{light:Ig,dark:Ig,hcDark:Ig,hcLight:Ig},m("hoverBorder","Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:Zr(R9,.2),light:Tf(R9,.05),hcDark:Vi,hcLight:Vi},m("statusBarBackground","Background color of the editor hover status bar."));E("editorLink.activeForeground",{dark:"#4E94CE",light:z.blue,hcDark:z.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links."));const td=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:z.white,hcLight:z.black},m("editorInlayHintForeground","Foreground color of inline hints")),id=E("editorInlayHint.background",{dark:ye(Gy,.1),light:ye(Gy,.1),hcDark:ye(z.white,.1),hcLight:ye(Gy,.1)},m("editorInlayHintBackground","Background color of inline hints"));E("editorInlayHint.typeForeground",{dark:td,light:td,hcDark:td,hcLight:td},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types"));E("editorInlayHint.typeBackground",{dark:id,light:id,hcDark:id,hcLight:id},m("editorInlayHintBackgroundTypes","Background color of inline hints for types"));E("editorInlayHint.parameterForeground",{dark:td,light:td,hcDark:td,hcLight:td},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters"));E("editorInlayHint.parameterBackground",{dark:id,light:id,hcDark:id,hcLight:id},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const ZA=new z(new ut(155,185,85,.2)),XA=new z(new ut(255,0,0,.2)),obe=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),rbe=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.insertedLineBackground",{dark:ZA,light:ZA,hcDark:null,hcLight:null},m("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:XA,light:XA,hcDark:null,hcLight:null},m("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const abe=E("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),lbe=E("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("diffEditorBorder","Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const cbe=E("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),dbe=E("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ube=E("list.focusOutline",{dark:bo,light:bo,hcDark:Ut,hcLight:Ut},m("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),hbe=E("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),jl=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:z.fromHex("#0F4A85").transparent(.1)},m("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Oa=E("list.activeSelectionForeground",{dark:z.white,light:z.white,hcDark:null,hcLight:null},m("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),W0=E("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),fbe=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:z.fromHex("#0F4A85").transparent(.1)},m("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),gbe=E("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),pbe=E("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),mbe=E("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_be=E("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),hj=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:z.white.transparent(.1),hcLight:z.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),fj=E("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),bbe=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),kw=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:bo,hcLight:bo},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree."));E("list.focusHighlightForeground",{dark:kw,light:Kbe(jl,kw,"#BBE7FF"),hcDark:kw,hcLight:kw},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const vbe=E("listFilterWidget.background",{light:Tf(Vi,0),dark:Zr(Vi,0),hcDark:Vi,hcLight:Vi},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),wbe=E("listFilterWidget.outline",{dark:z.transparent,light:z.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),ybe=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Je,hcLight:Je},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Cbe=E("listFilterWidget.shadow",{dark:$l,light:$l,hcDark:$l,hcLight:$l},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:Pa,light:Pa,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));E("list.filterMatchBorder",{dark:ed,light:ed,hcDark:Je,hcLight:Ut},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const V0=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Sbe=E("tree.inactiveIndentGuidesStroke",{dark:ye(V0,.4),light:ye(V0,.4),hcDark:ye(V0,.4),hcLight:ye(V0,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),xbe=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),Lbe=E("tree.tableOddRowsBackground",{dark:ye(J,.04),light:ye(J,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const Dbe=E("checkbox.background",{dark:Na,light:Na,hcDark:Na,hcLight:Na},m("checkbox.background","Background color of checkbox widget."));E("checkbox.selectBackground",{dark:Vi,light:Vi,hcDark:Vi,hcLight:Vi},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const kbe=E("checkbox.foreground",{dark:Ul,light:Ul,hcDark:Ul,hcLight:Ul},m("checkbox.foreground","Foreground color of checkbox widget.")),Ebe=E("checkbox.border",{dark:Eg,light:Eg,hcDark:Eg,hcLight:Eg},m("checkbox.border","Border color of checkbox widget."));E("checkbox.selectBorder",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const P9=E("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),QA=E("quickInputList.focusForeground",{dark:Oa,light:Oa,hcDark:Oa,hcLight:Oa},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),gj=E("quickInputList.focusIconForeground",{dark:W0,light:W0,hcDark:W0,hcLight:W0},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),JA=E("quickInputList.focusBackground",{dark:Rb(P9,jl),light:Rb(P9,jl),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),Ibe=E("menu.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("menuBorder","Border color of menus.")),Abe=E("menu.foreground",{dark:Ul,light:Ul,hcDark:Ul,hcLight:Ul},m("menuForeground","Foreground color of menu items.")),Tbe=E("menu.background",{dark:Na,light:Na,hcDark:Na,hcLight:Na},m("menuBackground","Background color of menu items.")),Nbe=E("menu.selectionForeground",{dark:Oa,light:Oa,hcDark:Oa,hcLight:Oa},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Mbe=E("menu.selectionBackground",{dark:jl,light:jl,hcDark:jl,hcLight:jl},m("menuSelectionBackground","Background color of the selected menu item in menus.")),Rbe=E("menu.selectionBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},m("menuSelectionBorder","Border color of the selected menu item in menus.")),Pbe=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Je,hcLight:Je},m("menuSeparatorBackground","Color of a separator menu item in menus.")),eT=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:Ut,hcLight:Ut},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:Zr(eT,.1),light:Tf(eT,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));E("editor.snippetTabstopHighlightBackground",{dark:new z(new ut(124,124,124,.3)),light:new z(new ut(10,50,100,.2)),hcDark:new z(new ut(124,124,124,.3)),hcLight:new z(new ut(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new z(new ut(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const Obe=E("breadcrumb.foreground",{light:ye(J,.8),dark:ye(J,.8),hcDark:ye(J,.8),hcLight:ye(J,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Fbe=E("breadcrumb.background",{light:Gi,dark:Gi,hcDark:Gi,hcLight:Gi},m("breadcrumbsBackground","Background color of breadcrumb items.")),O9=E("breadcrumb.focusForeground",{light:Tf(J,.2),dark:Zr(J,.1),hcDark:Zr(J,.1),hcLight:Zr(J,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Bbe=E("breadcrumb.activeSelectionForeground",{light:Tf(J,.2),dark:Zr(J,.1),hcDark:Zr(J,.1),hcLight:Zr(J,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));E("breadcrumbPicker.background",{light:Vi,dark:Vi,hcDark:Vi,hcLight:Vi},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const pj=.5,F9=z.fromHex("#40C8AE").transparent(pj),B9=z.fromHex("#40A6FF").transparent(pj),W9=z.fromHex("#606060").transparent(.4),lr=.4,sm=1,Ag=E("merge.currentHeaderBackground",{dark:F9,light:F9,hcDark:null,hcLight:null},m("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",{dark:ye(Ag,lr),light:ye(Ag,lr),hcDark:ye(Ag,lr),hcLight:ye(Ag,lr)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Tg=E("merge.incomingHeaderBackground",{dark:B9,light:B9,hcDark:null,hcLight:null},m("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",{dark:ye(Tg,lr),light:ye(Tg,lr),hcDark:ye(Tg,lr),hcLight:ye(Tg,lr)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Ng=E("merge.commonHeaderBackground",{dark:W9,light:W9,hcDark:null,hcLight:null},m("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",{dark:ye(Ng,lr),light:ye(Ng,lr),hcDark:ye(Ng,lr),hcLight:ye(Ng,lr)},m("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const om=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:ye(Ag,sm),light:ye(Ag,sm),hcDark:om,hcLight:om},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:ye(Tg,sm),light:ye(Tg,sm),hcDark:om,hcLight:om},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:ye(Ng,sm),light:ye(Ng,sm),hcDark:om,hcLight:om},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const $4=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},m("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),H0=E("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Mg=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),QL=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),V9=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Wbe=E("minimap.infoHighlight",{dark:ks,light:ks,hcDark:Mb,hcLight:Mb},m("minimapInfo","Minimap marker color for infos.")),Vbe=E("minimap.warningHighlight",{dark:vo,light:vo,hcDark:Nb,hcLight:Nb},m("overviewRuleWarning","Minimap marker color for warnings.")),Hbe=E("minimap.errorHighlight",{dark:new z(new ut(255,18,18,.7)),light:new z(new ut(255,18,18,.7)),hcDark:new z(new ut(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),zbe=E("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),$be=E("minimap.foregroundOpacity",{dark:z.fromHex("#000f"),light:z.fromHex("#000f"),hcDark:z.fromHex("#000f"),hcLight:z.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",{light:ye(O0,.5),dark:ye(O0,.5),hcDark:ye(O0,.5),hcLight:ye(O0,.5)},m("minimapSliderBackground","Minimap slider background color."));E("minimapSlider.hoverBackground",{light:ye(F0,.5),dark:ye(F0,.5),hcDark:ye(F0,.5),hcLight:ye(F0,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));E("minimapSlider.activeBackground",{light:ye(B0,.5),dark:ye(B0,.5),hcDark:ye(B0,.5),hcLight:ye(B0,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Ube=E("problemsErrorIcon.foreground",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},m("problemsErrorIconForeground","The color used for the problems error icon.")),jbe=E("problemsWarningIcon.foreground",{dark:vo,light:vo,hcDark:vo,hcLight:vo},m("problemsWarningIconForeground","The color used for the problems warning icon.")),qbe=E("problemsInfoIcon.foreground",{dark:ks,light:ks,hcDark:ks,hcLight:ks},m("problemsInfoIconForeground","The color used for the problems info icon."));E("charts.foreground",{dark:J,light:J,hcDark:J,hcLight:J},m("chartsForeground","The foreground color used in charts."));E("charts.lines",{dark:ye(J,.5),light:ye(J,.5),hcDark:ye(J,.5),hcLight:ye(J,.5)},m("chartsLines","The color used for horizontal lines in charts."));E("charts.red",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},m("chartsRed","The red color used in chart visualizations."));E("charts.blue",{dark:ks,light:ks,hcDark:ks,hcLight:ks},m("chartsBlue","The blue color used in chart visualizations."));E("charts.yellow",{dark:vo,light:vo,hcDark:vo,hcLight:vo},m("chartsYellow","The yellow color used in chart visualizations."));E("charts.orange",{dark:Mg,light:Mg,hcDark:Mg,hcLight:Mg},m("chartsOrange","The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function Gbe(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Nr(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Nr(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Nr(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Nr(n.background,e);return r?(o=Nr(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Nr(n.value,e)}case 4:for(const r of n.values){const a=Nr(r,e);if(a)return a}return;case 6:return Nr(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Nr(n.value,e);if(!r)return;const a=Nr(n.background,e);return a?r.isDarkerThan(a)?z.getLighterColor(r,a,n.factor).transparent(n.transparency):z.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw w4()}}function Tf(n,e){return{op:0,value:n,factor:e}}function Zr(n,e){return{op:1,value:n,factor:e}}function ye(n,e){return{op:2,value:n,factor:e}}function Rb(...n){return{op:4,values:n}}function Kbe(n,e,t){return{op:6,if:n,then:e,else:t}}function H9(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Nr(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?z.fromHex(n):e.getColor(n);if(n instanceof z)return n;if(typeof n=="object")return Gbe(n,e)}}const mj="vscode://schemas/workbench-colors",_j=mn.as(jL.JSONContribution);_j.registerSchema(mj,XL.getColorSchema());const z9=new xi(()=>_j.notifySchemaChanged(mj),200);XL.onDidChangeSchema(()=>{z9.isScheduled()||z9.schedule()});class JL{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new bj(this.x-window.scrollX,this.y-window.scrollY)}}class bj{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new JL(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Ybe{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class Zbe{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function U4(n){const e=Nn(n);return new Ybe(e.left,e.top,e.width,e.height)}function j4(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new Zbe(o,r)}class Yd extends rr{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new JL(this.posx,this.posy),this.editorPos=U4(i),this.relativePos=j4(i,this.editorPos,this.pos)}}class Xbe{constructor(e){this._editorViewDomNode=e}_create(e){return new Yd(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return K(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return K(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return K(e,le.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,le.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return K(e,le.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return K(e,"mousemove",i=>t(this._create(i)))}}class Qbe{constructor(e){this._editorViewDomNode=e}_create(e){return new Yd(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return K(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,le.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return K(e,le.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return K(e,"pointermove",i=>t(this._create(i)))}}class Jbe extends Y{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new ZL),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Hi(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new Yd(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class L1 extends Y{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,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),s=Math.min(l,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=1073741824);let c=e.children[t].firstChild,d=e.children[s].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Oo;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Oo||(Oo={}));function Jl(n){return n===Oo.HIGH_CONTRAST_DARK||n===Oo.HIGH_CONTRAST_LIGHT}function tD(n){return n===Oo.DARK||n===Oo.HIGH_CONTRAST_DARK}const sve=function(){return Zg?!0:!(Zn||_r||lc)}();let rp=!0;class U9{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class La{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=_t(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Jl(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=ar.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(Jl(r.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const d=P4(c,s);s.appendString("");let u=null;return rp&&sve&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new Ew(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=wj(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Ew:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Ew?this._renderedViewLine.monospaceAssumptionsAreValid():rp}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Ew&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new $9(!0,[new Nh(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new $9(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}La.CLASS_NAME="view-line";class Ew{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),rp=!1)}return rp}toSlowRenderedLine(){return wj(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new Nh(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const s=Math.floor((t-1)/300)-1,o=(s+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=Ky.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return yj(this._characterMapping,e,t)}}class vj{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new Nh(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new Nh(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=Ky.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=Ky.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new Nh(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Ky.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return yj(this._characterMapping,e,t)}}class ove extends vj{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class rm{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(66),this.stickyTabStops=s.get(115),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return rm.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new H(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new H(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,vn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class q4 extends cve{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=Ka.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=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 s=t.isInContentArea?8:5;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return ro.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,s,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,s,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!ro.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new H(1,1),j9);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new H(o,r),j9)}if(i){if(ro.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=r2(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new H(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=r2(t.mouseContentHorizontalOffset-r),l=new H(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=vn._doHitTest(e,t);return s.type===1?vn.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(ro.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new H(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(ro.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new H(s,o))}}return null}static _hitTestScrollbar(e,t){if(ro.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new H(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return vn._getMouseColumn(s,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=r2(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(s,v)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(s);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let _=null;for(let v=1;vo)){const a=Math.floor((s+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new JL(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Qp(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=dve(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new Tc;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===La.CLASS_NAME?Yu.createFromDOMInfo(e,r,s.startOffset):new Tc(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===La.CLASS_NAME?Yu.createFromDOMInfo(e,o,o.textContent.length):new Tc(o)}return new Tc}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===La.CLASS_NAME?Yu.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Tc(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===La.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return Yu.createFromDOMInfo(e,l,0)}else if(a===La.CLASS_NAME)return Yu.createFromDOMInfo(e,i.offsetNode,0)}return new Tc(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=Pb.atomicPosition(i,e.column-1,s,2);return o!==-1?new H(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Tc;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(s||!o.equals(i.position))&&(i=new Cj(o,i.spanNode,s))}return i}}function dve(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=window.getComputedStyle(s,null).getPropertyValue("font-style"),a=window.getComputedStyle(s,null).getPropertyValue("font-variant"),l=window.getComputedStyle(s,null).getPropertyValue("font-weight"),c=window.getComputedStyle(s,null).getPropertyValue("font-size"),d=window.getComputedStyle(s,null).getPropertyValue("line-height"),u=window.getComputedStyle(s,null).getPropertyValue("font-family"),h=`${r} ${a} ${l} ${c}/${d} ${u}`,f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=fh.getInstance();for(let b=0;bt(new rr(i))))}onmousedown(e,t){this._register(K(e,le.MOUSE_DOWN,i=>t(new rr(i))))}onmouseover(e,t){this._register(K(e,le.MOUSE_OVER,i=>t(new rr(i))))}onmouseleave(e,t){this._register(K(e,le.MOUSE_LEAVE,i=>t(new rr(i))))}onkeydown(e,t){this._register(K(e,le.KEY_DOWN,i=>t(new Wt(i))))}onkeyup(e,t){this._register(K(e,le.KEY_UP,i=>t(new Wt(i))))}oninput(e,t){this._register(K(e,le.INPUT,t))}onblur(e,t){this._register(K(e,le.BLUR,t))}onfocus(e,t){this._register(K(e,le.FOCUS,t))}ignoreGesture(e){return Tt.ignoreTarget(e)}};const am=11;class uve extends ra{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ae.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=am+"px",this.domNode.style.height=am+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new ZL),this._register(Hi(this.bgDomNode,le.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Hi(this.domNode,le.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new y1),this._pointerdownScheduleRepeatTimer=this._register(new pc)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class hve extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new pc)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const fve=140;class Sj extends ra{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new hve(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ZL),this._shouldRender=!0,this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(K(this.domNode.domNode,le.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new uve(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=_t(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(K(this.slider.domNode,le.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Nn(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Ms&&a>fve){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const gve=20;class lm{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new lm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(gve,Math.floor(i*a/s))),d=(a-c)/(s-i),u=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=lm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new tf(null,1,0))}),this._createArrow({className:"scra",icon:ie.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new tf(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class mve extends Sj{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new lm(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-am)/2,a=(t.verticalScrollbarSize-am)/2;this._createArrow({className:"scra",icon:ie.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tf(null,0,1))}),this._createArrow({className:"scra",icon:ie.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new tf(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class _S{constructor(e,t,i,s,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,s=s|0,o=o|0,r=r|0,a=a|0),this.rawScrollLeft=s,this.rawScrollTop=a,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=o,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new _S(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new _S(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class D1 extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new _S(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Ob(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=Ob.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class q9{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function a2(n,e){const t=e-n;return function(i){return n+t*vve(i)}}function _ve(n,e,t){return function(i){return i2.5*i){let o,r;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}bS.INSTANCE=new bS;class G4 extends ra{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=Cve(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new mve(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new pve(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_t(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_t(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_t(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new pc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Pt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,gt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new tf(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Pt(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new tf(s))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,le.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=bS.INSTANCE;i.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!gt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(r){const u=G9*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=G9*a,h=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,h)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let o=s;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),wve)}}class xj extends G4{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new D1({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>$o(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class K4 extends G4{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class Y4 extends G4{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new D1({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>$o(s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function Cve(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,gt&&(e.className+=" mac"),e}class Z4 extends L1{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new vn(this._context,i),this._mouseDownOperation=this._register(new Sve(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const s=new Xbe(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=K(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Yd(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(K(this.viewHelper.viewDomNode,le.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=bS.INSTANCE;let t=0,i=Vc.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new tf(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=Vc.getZoomLevel(),u=c.deltaY>0?1:-1;Vc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Vc.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(Vc.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(K(this.viewHelper.viewDomNode,le.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return gt?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new bj(e,t).toPageCoordinates(),o=U4(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=j4(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=Qp(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class Sve extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Jbe(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new xve(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new iD,this._currentSelection=new lt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);r&&r instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=s.getCurrentScrollTop()+e.relativePos.y,c=rm.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return qn.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return qn.createOutsideEditor(o,new H(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return qn.createOutsideEditor(o,new H(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return qn.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new H(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class xve extends Y{constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Lve(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Lve extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=$o(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=U4(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new JL(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=j4(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=qn.createOutsideEditor(this._position.mouseColumn,new H(a,1),"above",this._position.outsideDistance):l=qn.createOutsideEditor(this._position.mouseColumn,new H(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=$o(()=>this._execute())}}class iD{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>iD.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}iD.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class rt{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var nd;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),s=Object.assign({},e);let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,_()}n.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(u)}n.onInput=d;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}n.onKeyUp=h;function f(){v()}n.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(p),_())}n.onRenderStart=g;function p(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",s),o++,w())}function b(x,D){const k=performance.getEntriesByName(x)[0].duration;D.total+=k,D.min=Math.min(D.min,k),D.max=Math.max(D.max,k)}function w(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function y(){if(o===0)return;const x={keydown:S(e),input:S(t),render:S(i),total:S(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,x}n.getAndClearMeasurements=y;function S(x){return{average:x.total/o,max:x.max,min:x.min}}function L(x){x.total=0,x.min=Number.MAX_VALUE,x.max=0}})(nd||(nd={}));class cn{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new cn(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new cn(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,s,o,r,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(s=this.selection)===null||s===void 0?void 0:s.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(eS(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(wA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,l=e.selectionEnd-s,c=t.selectionStart-s,d=t.selectionEnd-s;if(c===d){const h=e.selectionStart-s;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,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(eS(e.value,t.value),e.selectionEnd),s=Math.min(wA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}cn.EMPTY=new cn("",0,0,null,void 0);class Rg{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new N(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=Rg._getPageOfLine(t.startLineNumber,i),a=Rg._getRangeForPage(r,i),l=Rg._getPageOfLine(t.endLineNumber,i),c=Rg._getRangeForPage(l,i);let d=a.intersectRanges(new N(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=N.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new N(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=N.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return s&&_.length>2*500&&(_=_.substring(0,500)+String.fromCharCode(8230)+_.substring(_.length-500,_.length)),new cn(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var vS;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(vS||(vS={}));class wS{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)}}wS.INSTANCE=new wS;class Dve{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}}class kve extends Y{get textAreaState(){return this._textAreaState}constructor(e,t,i,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new xi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new xi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=cn.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(r=>{const a=new Wt(r);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(r=>{const a=new Wt(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new Dve;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===r.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:r.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:r.data});return}this._onCompositionStart.fire({data:r.data})})),this._register(this._textArea.onCompositionUpdate(r=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(r)})),this._register(this._textArea.onCompositionEnd(r=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=cn.readFromTextArea(this._textArea,this._textAreaState),l=cn.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(tn(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(r=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(r),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(r=>{this._ensureClipboardGetsEditorSelection(r)})),this._register(this._textArea.onPaste(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),r.preventDefault(),!r.clipboardData)return;let[a,l]=K9.getTextData(r.clipboardData);a&&(l=l||wS.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const r=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!r&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return K(this._textArea.ownerDocument,"selectionchange",t=>{if(nd.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new lt(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};wS.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&K9.setTextData(e.clipboardData,t.text,t.html,i)}}const K9={getTextData(n){const e=n.getData(Pl.text);let t=null;const i=n.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&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` +`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Pl.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class Eve extends Y{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new rt(this._actual,"keydown")).event,this.onKeyUp=this._register(new rt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new rt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new rt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new rt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new rt(this._actual,"beforeinput")).event,this.onInput=this._register(new rt(this._actual,"input")).event,this.onCut=this._register(new rt(this._actual,"cut")).event,this.onCopy=this._register(new rt(this._actual,"copy")).event,this.onPaste=this._register(new rt(this._actual,"paste")).event,this.onFocus=this._register(new rt(this._actual,"focus")).event,this.onBlur=this._register(new rt(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>nd.onKeyDown())),this._register(this.onBeforeInput(()=>nd.onBeforeInput())),this._register(this.onInput(()=>nd.onInput())),this._register(this.onKeyUp(()=>nd.onKeyUp())),this._register(K(this._actual,vS.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Qp(this._actual);return e?e.activeElement===this._actual:S4(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,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 s=this._actual;let o=null;const r=Qp(s);r?o=r.activeElement:o=s.ownerDocument.activeElement;const a=o===s,l=s.selectionStart,c=s.selectionEnd;if(a&&l===t&&c===i){_r&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),_r&&window.parent!==window&&s.focus();return}try{const d=ope(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),rpe(s,d)}catch{}}}class Ive extends Z4{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Mt.Tap,o=>this.onTap(o))),this._register(K(this.viewHelper.linesContentDomNode,Mt.Change,o=>this.onChange(o))),this._register(K(this.viewHelper.linesContentDomNode,Mt.Contextmenu,o=>this._onContextMenu(new Yd(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(K(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new Qbe(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Yd(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class Ave extends Z4{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Mt.Tap,s=>this.onTap(s))),this._register(K(this.viewHelper.linesContentDomNode,Mt.Change,s=>this.onChange(s))),this._register(K(this.viewHelper.linesContentDomNode,Mt.Contextmenu,s=>this._onContextMenu(new Yd(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Yd(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(vS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Tve extends Y{constructor(e,t,i){super(),$d&&C4.pointerEvents?this.handler=this._register(new Ive(e,t,i)):window.TouchEvent?this.handler=this._register(new Ave(e,t,i)):this.handler=this._register(new Z4(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Nf extends L1{}const oo=at("themeService");function sn(n){return{id:n}}function tT(n){switch(n){case Oo.DARK:return"vs-dark";case Oo.HIGH_CONTRAST_DARK:return"hc-black";case Oo.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Lj={ThemingContribution:"base.contributions.theming"};class Nve{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ze(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Dj=new Nve;mn.add(Lj.ThemingContribution,Dj);function xr(n){return Dj.onColorThemeChange(n)}class Mve extends Y{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const kj=E("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),Y9=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Je},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);E("editor.symbolHighlightBackground",{dark:Pa,light:Pa,hcDark:null,hcLight:null},m("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Ej=E("editorCursor.foreground",{dark:"#AEAFAD",light:z.black,hcDark:z.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),Rve=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),ql=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),Pve=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:z.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),Iw=E("editorIndentGuide.background",{dark:ql,light:ql,hcDark:ql,hcLight:ql},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Aw=E("editorIndentGuide.activeBackground",{dark:ql,light:ql,hcDark:ql,hcLight:ql},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),k1=E("editorIndentGuide.background1",{dark:Iw,light:Iw,hcDark:Iw,hcLight:Iw},m("editorIndentGuides1","Color of the editor indentation guides (1).")),Ove=E("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),Fve=E("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),Bve=E("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),Wve=E("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),Vve=E("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),E1=E("editorIndentGuide.activeBackground1",{dark:Aw,light:Aw,hcDark:Aw,hcLight:Aw},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Hve=E("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),zve=E("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),$ve=E("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Uve=E("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),jve=E("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Tw=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Ut,hcLight:Ut},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",{dark:Tw,light:Tw,hcDark:Tw,hcLight:Tw},m("editorActiveLineNumber","Color of editor active line number"));const qve=E("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:z.lightgrey,hcDark:z.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Je,hcLight:Je},m("editorBracketMatchBorder","Color for matching brackets boxes"));const Gve=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),Kve=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",{dark:Gi,light:Gi,hcDark:Gi,hcLight:Gi},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:z.fromHex("#fff").transparent(.8),hcLight:Je},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Yve=E("editorUnnecessaryCode.opacity",{dark:z.fromHex("#000a"),light:z.fromHex("#0007"),hcDark:null,hcLight:null},m("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:z.fromHex("#fff").transparent(.8),hcLight:z.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));E("editorGhostText.foreground",{dark:z.fromHex("#ffffff56"),light:z.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const Nw=new z(new ut(0,122,204,.6)),Zve=E("editorOverviewRuler.rangeHighlightForeground",{dark:Nw,light:Nw,hcDark:Nw,hcLight:Nw},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Xve=E("editorOverviewRuler.errorForeground",{dark:new z(new ut(255,18,18,.7)),light:new z(new ut(255,18,18,.7)),hcDark:new z(new ut(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),Qve=E("editorOverviewRuler.warningForeground",{dark:vo,light:vo,hcDark:Nb,hcLight:Nb},m("overviewRuleWarning","Overview ruler marker color for warnings.")),Jve=E("editorOverviewRuler.infoForeground",{dark:ks,light:ks,hcDark:Mb,hcLight:Mb},m("overviewRuleInfo","Overview ruler marker color for infos.")),Ij=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Aj=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Tj=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Nj=E("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Mj=E("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Rj=E("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),e1e=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new z(new ut(255,18,18,.8)),light:new z(new ut(255,18,18,.8)),hcDark:new z(new ut(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),t1e=E("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),i1e=E("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),n1e=E("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),s1e=E("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),o1e=E("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),r1e=E("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),a1e=E("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),l1e=E("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),c1e=E("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),d1e=E("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),u1e=E("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),h1e=E("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));xr((n,e)=>{const t=n.getColor(Gi),i=n.getColor(kj),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class I1 extends Nf{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new H(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new H(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Zn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=s;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){r[l]="";continue}let d="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){r[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),r[l]=`
${c}
`}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}I1.CLASS_NAME="line-numbers";xr((n,e)=>{const t=n.getColor(Pve),i=n.getColor(qve);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class nf extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=_t(document.createElement("div")),this._domNode.setClassName(nf.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=_t(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(nf.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}nf.CLASS_NAME="glyph-margin";nf.OUTER_CLASS_NAME="margin";const ap="monaco-mouse-cursor-text";class f1e{constructor(){this._onDidChange=new B,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 f_=new f1e,pi=at("keybindingService");var g1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},p1e=function(n,e){return function(t,i){e(t,i,n)}};class m1e{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new H(this.modelLineNumber,this.distanceToModelLineStart+1),i=new H(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const l2=_r;let iT=class extends so{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new H(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,r=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new lt(1,1,1,1)],this._modelSelections=[new lt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=_t(document.createElement("textarea")),Ka.write(this.textArea,6),this.textArea.setClassName(`inputarea ${ap}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=_t(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,h)=>this._context.viewModel.getValueInRange(u,h),getValueLengthInRange:(u,h)=>this._context.viewModel.getValueLengthInRange(u,h),modifyPosition:(u,h)=>this._context.viewModel.modifyPosition(u,h)},c={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Ms),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(u)?u:null,p=Array.isArray(u)?u.join(h):u;let _,v=null;if(this._copyWithSyntaxHighlighting&&p.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(_=b.html,v=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:_,mode:v}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(gt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new cn(g,g.length,g.length,N.fromPositions(f),0)}const h=500;if(gt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new cn(f,g,g,N.fromPositions(h),0)}return cn.EMPTY}return Rg.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(u,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,h,f)},d=this._register(new Eve(this.textArea.domNode));this._textAreaInput=this._register(new kve(c,d,_o,{isAndroid:CF,isChrome:_4,isFirefox:_r,isSafari:lc})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let h=!1,f=null,g=null;u.metadata&&(h=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,f=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,g=u.metadata.mode),this._viewController.paste(u.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const v=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=v.lastIndexOf(` +`),w=v.substring(b+1),y=w.lastIndexOf(" "),S=w.length-y-1,L=f.getStartPosition(),x=Math.min(L.column-1,S),D=L.column-1-x,k=w.substring(0,w.length-x),{tabSize:P}=this._context.viewModel.model.getOptions(),O=_1e(this.textArea.domNode.ownerDocument,k,this._fontInfo,P);return{distanceToModelLineStart:D,widthOfHiddenTextBefore:O}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf(` +`),w=b===-1?v:v.substring(0,b),y=w.indexOf(" "),S=y===-1?w.length:w.length-y-1,L=f.getEndPosition(),x=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,S);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-x}})();this._context.viewModel.revealRange("keyboard",!0,N.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new m1e(this._context,f.startLineNumber,g,p,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${ap} 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 ${ap}`),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(f_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=tm(t);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);s.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=tm(this._context.configuration.options.get(129));let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==0||o>50)return t.substring(s-1,e.column-1);o++,s--}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(!tn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,s;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||s===void 0?void 0:s.getAriaLabel(),c=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?m("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.",c,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===yf.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(143).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=l2?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!f_.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new H(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const s=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&s&&o&&o.left>=this._scrollLeft&&s.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+s.left-this._scrollLeft,h=o.left-s.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),_=g===p,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(yi.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(gt){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:l2?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:l2?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Mn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?z.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 s=this._context.configuration.options;s.get(57)?i.setClassName("monaco-editor-background textAreaCover "+nf.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+I1.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};iT=g1e([p1e(3,pi)],iT);function _1e(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Mn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}function b1e(n,e,t){let i=0;for(let o=0;o!0,w1e=()=>!1,y1e=n=>n===" "||n===" ";class ig{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,s){var o;this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(143),l=r.get(50);this.readOnly=r.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(127),this.wordSeparators=r.get(129),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(76),this.multiCursorPaste=r.get(78),this.multiCursorLimit=r.get(79),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=HL(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return Pj(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return y1e;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return v1e;case"never":return w1e}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Ui.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Ui.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}class ot{static fromModelState(e){return new C1e(e)}static fromViewState(e){return new S1e(e)}static fromModelSelection(e){const t=lt.liftSelection(e),i=new hn(N.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return ot.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,Zu.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new H(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-G$(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new H(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Pb.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new H(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?St.leftPositionAtomicSoftTabs(t,i,e.tabSize):St.leftPosition(t,i);return new c2(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(St.clipPositionColumn(l,t),0),d=St.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new H(e.lineNumber,St.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-Ui.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new H(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new c2(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,4)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=St.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new H(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const f=h.charAt(u.column-2),g=s.get(f);if(!g)return!1;if(Nc(f)){if(i==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let _=!1;for(const v of g)v.open===f&&v.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,w=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Gs(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Ui.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new N(s.lineNumber,d,s.lineNumber,s.column)}}return N.fromPositions(sf.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Ofe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new H(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>H.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new N(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new vs(g,"")}else s[r]=null;else s[r]=new vs(l,"")}return new _s(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class vi{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let o=i.column-2;o>=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===0){if(s===2)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=e.length;for(let r=s;r=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=vi._findPreviousWordOnLine(e,t,new H(o,r));if(s===0)return new H(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=vi._findPreviousWordOnLine(e,t,new H(o,a.start+1))),new H(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=vi._findPreviousWordOnLine(e,t,new H(o,a.start+1));return new H(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=vi._findPreviousWordOnLine(e,t,new H(o,a.start+1))),new H(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new H(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new H(i,r);if(a===45&&l!==45)return new H(i,r);if((Cg(a)||ww(a))&&Pc(l))return new H(i,r);if(Pc(a)&&Pc(l)&&r+1=l.start+1&&(l=vi._findNextWordOnLine(e,t,new H(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new H(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?c=1:(l--,c=s.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=vi._findPreviousWordOnLine(i,s,new H(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new N(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new H(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new N(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new N(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(s,h-2);)h--;return a(h,f)},c=vi._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=vi._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=vi._moveWordPartLeft(e,i);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=h.start+1&&(h=vi._findNextWordOnLine(i,s,new H(l,h.end+1))),h?c=h.start+1:cc&&(d=c,u=e.model.getLineMaxColumn(d)),ot.fromModelState(new hn(new N(r.lineNumber,1,d,u),2,0,new H(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),ot.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return ot.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return ot.fromModelState(vi.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new ot(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return ot.fromViewState(new hn(new N(i,s,i,s),0,0,new H(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new H(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return ot.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case 1:return r===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case 2:return r===2?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case 3:return r===2?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case 4:return r===2?t.map(a=>ot.fromViewState(St.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(St.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>ot.fromViewState(St.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(St.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:oot.fromViewState(St.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;oot.fromViewState(St.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;o1&&s.firstCharOffset===0){const p=ep(e,t.startLineNumber-1);p.languageId===s.languageId&&(c=p.getLineContent())}const d=o.onEnter(n,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===ss.Indent&&(h=" "+h):u===ss.Indent||u===ss.IndentOutdent?h=" ":h="";let g=LU(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var s1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},o1e=function(n,e){return function(t,i){e(t,i,n)}},$y;const s2=Object.create(null);function ku(n,e){if(e<=0)return"";s2[n]||(s2[n]=["",n]);const t=s2[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let qu=$y=class{static unshiftIndent(e,t,i,s,o){const r=Ui.visibleColumnFromColumn(e,t,i);if(o){const a=ku(" ",s),c=Ui.prevIndentTabStop(r,s)/s;return ku(a,c)}else{const a=" ",c=Ui.prevRenderTabStop(r,i)/i;return ku(a,c)}}static shiftIndent(e,t,i,s,o){const r=Ui.visibleColumnFromColumn(e,t,i);if(o){const a=ku(" ",s),c=Ui.nextIndentTabStop(r,s)/s;return ku(a,c)}else{const a=" ",c=Ui.nextRenderTabStop(r,i)/i;return ku(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=s;u++,c=d){d=0;const h=e.getLineContent(u);let f=Ks(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),u>1&&Ui.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=GA(this._opts.autoIndent,e,new N(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let v=0,b=_.appendText.length;v1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function V4(n,e,t,i=!0,s){if(n<4)return null;const o=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const r=l1e(e,t,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=e.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Vs(a),action:ss.Indent,line:r};if(o.shouldDecrease(a))return{indentation:Vs(a),action:null,line:r};{if(r===1)return{indentation:Vs(e.getLineContent(r)),action:null,line:r};const l=r-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:Vs(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Vs(e.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){const u=e.getLineContent(d);if(o.shouldIncrease(u))return{indentation:Vs(u),action:ss.Indent,line:d};if(o.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:Vs(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:Vs(u),action:null,line:d}}return{indentation:Vs(e.getLineContent(1)),action:null,line:1}}}function c1e(n,e,t,i,s){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),r=ML(o,t.startColumn-1),a=r.getLineContent();let l=!1,c;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(l=!0,c=a.substr(0,t.startColumn-1-r.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-r.firstCharOffset):d=ep(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);const u=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!u)return null;const h=c,f=Vs(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,w)=>e.getLanguageIdAtPosition(b,w)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=Vs(o.getLineContent()),_=V4(n,g,t.startLineNumber+1,void 0,s);if(!_){const b=l?p:f;return{beforeEnter:b,afterEnter:b}}let v=l?p:_.indentation;return _.action===ss.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function d1e(n,e,t,i,s,o){if(n<4)return null;const r=ep(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),c=l.substr(0,t.startColumn-1-r.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-r.firstCharOffset):d=ep(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=V4(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==ss.Indent&&(h=s.unshiftIndent(h)),h}return null}class di{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Lf(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=GA(e.autoIndent,t,new N(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===ss.Indent&&(o=di.shiftIndent(e,o)),s===ss.Outdent&&(o=di.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,o,r,a,l));return new bs(4,c,{shouldPushStackElementBefore:kw(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new N(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new zy(d,i,0,r)}static _typeCommand(e,t,i){return i?new Dw(e,t,!0):new ws(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return di._typeCommand(s,` -`,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=Vs(l).substring(0,s.startColumn-1);return di._typeCommand(s,` -`+e.normalizeIndentation(c),i)}const o=GA(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===ss.None)return di._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ss.Indent)return di._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ss.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=` + `,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}}}}]},n.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"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let s;switch(i.to){case n.RawDirection.Left:s=0;break;case n.RawDirection.Right:s=1;break;case n.RawDirection.Up:s=2;break;case n.RawDirection.Down:s=3;break;case n.RawDirection.PrevBlankLine:s=4;break;case n.RawDirection.NextBlankLine:s=5;break;case n.RawDirection.WrappedLineStart:s=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:s=7;break;case n.RawDirection.WrappedLineColumnCenter:s=8;break;case n.RawDirection.WrappedLineEnd:s=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:s=10;break;case n.RawDirection.ViewPortTop:s=11;break;case n.RawDirection.ViewPortBottom:s=13;break;case n.RawDirection.ViewPortCenter:s=12;break;case n.RawDirection.ViewPortIfOutside:s=14;break;default:return null}let o=0;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Character:o=3;break;case n.RawUnit.HalfLine:o=4;break}return{direction:s,unit:o,select:!!i.select,value:i.value||1}}n.parse=t})(yS||(yS={}));function nT(n,e,t,i){const s=tp(e,t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(s.languageId);if(!o)return null;const r=s.getLineContent(),a=r.substr(0,t.startColumn-1-s.firstCharOffset);let l;t.isEmpty()?l=r.substr(t.startColumn-1-s.firstCharOffset):l=tp(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);let c="";if(t.startLineNumber>1&&s.firstCharOffset===0){const p=tp(e,t.startLineNumber-1);p.languageId===s.languageId&&(c=p.getLineContent())}const d=o.onEnter(n,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===ns.Indent&&(h=" "+h):u===ns.Indent||u===ns.IndentOutdent?h=" ":h="";let g=zU(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var x1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},L1e=function(n,e){return function(t,i){e(t,i,n)}},Zy;const d2=Object.create(null);function Nu(n,e){if(e<=0)return"";d2[n]||(d2[n]=["",n]);const t=d2[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let Xu=Zy=class{static unshiftIndent(e,t,i,s,o){const r=Ui.visibleColumnFromColumn(e,t,i);if(o){const a=Nu(" ",s),c=Ui.prevIndentTabStop(r,s)/s;return Nu(a,c)}else{const a=" ",c=Ui.prevRenderTabStop(r,i)/i;return Nu(a,c)}}static shiftIndent(e,t,i,s,o){const r=Ui.visibleColumnFromColumn(e,t,i);if(o){const a=Nu(" ",s),c=Ui.nextIndentTabStop(r,s)/s;return Nu(a,c)}else{const a=" ",c=Ui.nextRenderTabStop(r,i)/i;return Nu(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=s;u++,c=d){d=0;const h=e.getLineContent(u);let f=Gs(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),u>1&&Ui.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=nT(this._opts.autoIndent,e,new N(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let v=0,b=_.appendText.length;v1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function X4(n,e,t,i=!0,s){if(n<4)return null;const o=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const r=E1e(e,t,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=e.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Ws(a),action:ns.Indent,line:r};if(o.shouldDecrease(a))return{indentation:Ws(a),action:null,line:r};{if(r===1)return{indentation:Ws(e.getLineContent(r)),action:null,line:r};const l=r-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:Ws(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Ws(e.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){const u=e.getLineContent(d);if(o.shouldIncrease(u))return{indentation:Ws(u),action:ns.Indent,line:d};if(o.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:Ws(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:Ws(u),action:null,line:d}}return{indentation:Ws(e.getLineContent(1)),action:null,line:1}}}function I1e(n,e,t,i,s){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),r=HL(o,t.startColumn-1),a=r.getLineContent();let l=!1,c;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(l=!0,c=a.substr(0,t.startColumn-1-r.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-r.firstCharOffset):d=tp(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);const u=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!u)return null;const h=c,f=Ws(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,w)=>e.getLanguageIdAtPosition(b,w)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=Ws(o.getLineContent()),_=X4(n,g,t.startLineNumber+1,void 0,s);if(!_){const b=l?p:f;return{beforeEnter:b,afterEnter:b}}let v=l?p:_.indentation;return _.action===ns.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function A1e(n,e,t,i,s,o){if(n<4)return null;const r=tp(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),c=l.substr(0,t.startColumn-1-r.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-r.firstCharOffset):d=tp(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=X4(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==ns.Indent&&(h=s.unshiftIndent(h)),h}return null}class ui{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Lf(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=nT(e.autoIndent,t,new N(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===ns.Indent&&(o=ui.shiftIndent(e,o)),s===ns.Outdent&&(o=ui.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,o,r,a,l));return new _s(4,c,{shouldPushStackElementBefore:Rw(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new N(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new Yy(d,i,0,r)}static _typeCommand(e,t,i){return i?new Mw(e,t,!0):new vs(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return ui._typeCommand(s,` +`,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=Ws(l).substring(0,s.startColumn-1);return ui._typeCommand(s,` +`+e.normalizeIndentation(c),i)}const o=nT(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===ns.None)return ui._typeCommand(s,` +`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ns.Indent)return ui._typeCommand(s,` +`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ns.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=` `+c+` -`+l;return i?new Dw(s,d,!0):new zy(s,d,-1,c.length-l.length,!0)}else if(o.indentAction===ss.Outdent){const l=di.unshiftIndent(e,o.indentation);return di._typeCommand(s,` -`+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=Vs(r).substring(0,s.startColumn-1);if(e.autoIndent>=4){const l=c1e(e.autoIndent,t,s,{unshiftIndent:c=>di.unshiftIndent(e,c),shiftIndent:c=>di.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,u=t.getLineContent(s.endLineNumber),h=Ks(u);if(h>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,h+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new Dw(s,` -`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new zy(s,` -`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return di._typeCommand(s,` -`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;sdi.shiftIndent(e,a),unshiftIndent:a=>di.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?di._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):di._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,_=s.length;p<_;p++){const v=s[p];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,s,o){const r=[];for(let a=0,l=s.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new N(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+s!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-s.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new V(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if(Ac(s)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:p,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(p),w=b.substring(0,_-1),y=b.substring(v-1);if(y.startsWith(h)||(f=!1),y.length>0){const D=y.charAt(0);if(!di._isBeforeClosingBrace(e,y)&&!c(D))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const D=Jp(e.wordSeparators);if(w.length>0){const k=w.charCodeAt(w.length-1);if(D.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),L=ML(S,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const x=a.findNeutralCharacter();if(x){const D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,x);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const l=[];for(let c=0,d=s.length;cnew ws(new N(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new bs(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` -`){const d=[];for(let u=0,h=o.length;u{const s=t.get(zt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=Gr();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(zt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var Zi;(function(n){class e extends ii{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,w){if(!w.position)return;b.model.pushStackElement(),b.setCursorStates(w.source,3,[_n.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&b.revealPrimaryCursor(w.source,!0,!0)}}n.MoveTo=ke(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=ke(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ii{runCoreEditorCommand(b,w){b.model.pushStackElement();const y=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),w);y!==null&&(b.setCursorStates(w.source,3,y.viewStates.map(S=>ot.fromViewState(S))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:y.fromLineNumber,fromViewVisualColumn:y.fromVisualColumn,toViewLineNumber:y.toLineNumber,toViewVisualColumn:y.toVisualColumn}),y.reversed?b.revealTopMostCursor(w.source):b.revealBottomMostCursor(w.source))}}n.ColumnSelect=ke(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,w,y){if(typeof y.position>"u"||typeof y.viewPosition>"u"||typeof y.mouseColumn>"u")return null;const S=v.model.validatePosition(y.position),L=v.coordinatesConverter.validateViewPosition(new V(y.viewPosition.lineNumber,y.viewPosition.column),S),x=y.doColumnSelect?w.fromViewLineNumber:L.lineNumber,D=y.doColumnSelect?w.fromViewVisualColumn:y.mouseColumn-1;return ju.columnSelect(v.cursorConfig,v,x,D,L.lineNumber,y.mouseColumn-1)}}),n.CursorColumnSelectLeft=ke(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,w,y){return ju.columnSelectLeft(v.cursorConfig,v,w)}}),n.CursorColumnSelectRight=ke(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,w,y){return ju.columnSelectRight(v.cursorConfig,v,w)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,w,y,S){return ju.columnSelectUp(b.cursorConfig,b,y,this._isPaged)}}n.CursorColumnSelectUp=ke(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=ke(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,w,y,S){return ju.columnSelectDown(b.cursorConfig,b,y,this._isPaged)}}n.CursorColumnSelectDown=ke(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=ke(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends ii{constructor(){super({id:"cursorMove",precondition:void 0,description:_S.description})}runCoreEditorCommand(b,w){const y=_S.parse(w);y&&this._runCursorMove(b,w.source,y)}_runCursorMove(b,w,y){b.model.pushStackElement(),b.setCursorStates(w,3,o._move(b,b.getCursorStates(),y)),b.revealPrimaryCursor(w,!0)}static _move(b,w,y){const S=y.select,L=y.value;switch(y.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return _n.simpleMove(b,w,y.direction,S,L,y.unit);case 11:case 13:case 12:case 14:return _n.viewportMove(b,w,y.direction,S,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=ke(new o);class r extends ii{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,w){let y=this._staticArgs;this._staticArgs.value===-1&&(y={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(w.source,3,_n.simpleMove(b,b.getCursorStates(),y.direction,y.select,y.value,y.unit)),b.revealPrimaryCursor(w.source,!0)}}n.CursorLeft=ke(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=ke(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1039}})),n.CursorRight=ke(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=ke(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1041}})),n.CursorUp=ke(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=ke(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=ke(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:11}})),n.CursorPageUpSelect=ke(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1035}})),n.CursorDown=ke(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=ke(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=ke(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:12}})),n.CursorPageDownSelect=ke(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1036}})),n.CreateCursor=ke(new class extends ii{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let w;b.wholeLine?w=_n.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):w=_n.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const y=v.getCursorStates();if(y.length>1){const S=w.modelState?w.modelState.position:null,L=w.viewState?w.viewState.position:null;for(let x=0,D=y.length;xL&&(S=L);const x=new N(S,1,S,v.model.getLineMaxColumn(S));let D=0;if(w.at)switch(w.at){case Pg.RawAtArgument.Top:D=3;break;case Pg.RawAtArgument.Center:D=1;break;case Pg.RawAtArgument.Bottom:D=4;break}const k=v.coordinatesConverter.convertModelRangeToViewRange(x);v.revealRange(b.source,!1,k,D,0)}}),n.SelectAll=new class extends KA{constructor(){super(Xge)}runDOMCommand(v){mr&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,w){const y=b._getViewModel();y&&this.runCoreEditorCommand(y,w)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[_n.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=ke(new class extends ii{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[ot.fromModelSelection(b.selection)]))}})})(Zi||(Zi={}));const h1e=xe.and(z.textInputFocus,z.columnSelection);function Pm(n,e){Os.registerKeybindingRule({id:n,primary:e,when:h1e,weight:ft+1})}Pm(Zi.CursorColumnSelectLeft.id,1039);Pm(Zi.CursorColumnSelectRight.id,1041);Pm(Zi.CursorColumnSelectUp.id,1040);Pm(Zi.CursorColumnSelectPageUp.id,1035);Pm(Zi.CursorColumnSelectDown.id,1042);Pm(Zi.CursorColumnSelectPageDown.id,1036);function W9(n){return n.register(),n}var V9;(function(n){class e extends vr{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=ke(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:z.writable,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,di.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=ke(new class extends e{constructor(){super({id:"outdent",precondition:z.writable,kbOpts:{weight:ft,kbExpr:xe.and(z.editorTextFocus,z.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,di.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=ke(new class extends e{constructor(){super({id:"tab",precondition:z.writable,kbOpts:{weight:ft,kbExpr:xe.and(z.editorTextFocus,z.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,di.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=ke(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sf.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=ke(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:z.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sf.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends KA{constructor(){super(cU)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends KA{constructor(){super(dU)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(V9||(V9={}));class H9 extends TL{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(zt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Mf(n,e){W9(new H9("default:"+n,n)),W9(new H9(n,n,e))}Mf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Mf("replacePreviousChar");Mf("compositionType");Mf("compositionStart");Mf("compositionEnd");Mf("paste");Mf("cut");class f1e{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Zi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Zi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Zi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Zi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Zi.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Zi.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Zi.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Zi.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Zi.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Zi.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Zi.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Zi.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Zi.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Zi.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class YL{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return YL.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new V(e.afterLineNumber,1)).lineNumber}}}class yj{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new $i("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let l=i;l<=s;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=c,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),s=!0}}return s}}class Cj{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new yj(()=>this._host.createVisibleLine())}_createDomNode(){const e=_t(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,s[c-o])}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");Pl._ttPolicy&&(t=Pl._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});Pl._sb=new RL(1e5);class Sj extends so{constructor(e){super(e),this._visibleLines=new Cj(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Mn(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),s.appendString(o),s.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class p1e extends Sj{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class m1e extends Sj{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Mn(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Mn(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class _1e extends so{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=_t(document.createElement("div")),Ka.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=_t(document.createElement("div")),Ka.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new b1e(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,s,o){this._widgets[e.getId()].setPosition(t,i,s,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class b1e{constructor(e,t,i){this._primaryAnchor=new a0(null,null),this._secondaryAnchor=new a0(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=_t(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(143);this._fixedOverflowWidgets=s.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=s(t,this._context.viewModel,this._affinity),this._secondaryAnchor=s(i,this._context.viewModel,this._affinity);function s(o,r,a){if(!o)return new a0(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new a0(o,c)}return new a0(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,s){this._setPosition(s,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,l=s.viewportHeight-a,c=o-i,d=r>=i,u=a,h=l>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const f=h-(c-s);h-=f,i-=f}if(h=v,y=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(h,v),fitsBelow:y,belowTop:f,left:_}:{fitsAbove:w,aboveTop:a,fitsBelow:y,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new l0(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const s=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:s,secondary:r};function a(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&c===3?0:u.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new z9(f,h,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&r2(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&r2(this._actual.afterRender,this._actual,this._renderData.position)}}class a0{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class l0{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class z9{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function r2(n,e,...t){try{return n.call(e,...t)}catch{return null}}class xj extends Nf{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new lt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(s=>s.positionLineNumber);t.sort((s,o)=>s-o),Ki(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let l=i;l<=s;l++){const c=l-i;for(;r=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class v1e extends xj{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class w1e extends xj{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Sr((n,e)=>{const t=n.getColor(dj);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(O9)){const i=n.getColor(O9);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),Zl(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class y1e extends Nf{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:N.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,r);for(let f=u;f<=h;f++){const g=f-o;i[g]+=d}}}_renderNormalDecorations(e,t,i){var s;const o=String(this._lineHeight),r=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class C1e extends so{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+jA(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new F4(t.domNode,d,this._context.viewLayout.getScrollable())),Ka.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=_t(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};if(f){const _=h.scrollTop;_&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(g){const _=h.scrollLeft;_&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(G(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(G(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(G(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(G(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),s=t.get(74),o=t.get(40),r=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+jA(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Lj extends K{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function ZL(n,e){let t=0,i=0;const s=n.length;for(;is)throw new $i("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){a=D,l=k;break}}}if(c===-2){c=-1,d=-1;for(let D=x;D=0){c=D,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=x=>{if(h===-2){h=-1,f=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){h=D,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=D,p=k;break}}}};let v=0,b=!0,w=0,y=!0,S=0,L=0;for(let x=0;b||y;x++){const D=e-x,k=e+x;x>1&&(D<1||D1&&(k>s||k>i)&&(y=!1),x>5e4&&(b=!1,y=!1);let O=-1;if(b&&D>=1){const P=this._computeIndentLevel(D-1);P>=0?(c=D-1,d=P,O=Math.ceil(P/this.textModel.getOptions().indentSize)):(u(D),O=this._getIndentLevelForWhitespaceLine(r,l,d))}let R=-1;if(y&&k<=s){const P=this._computeIndentLevel(k-1);P>=0?(h=k-1,f=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(_(k),R=this._getIndentLevelForWhitespaceLine(r,f,p))}if(x===0){L=O;continue}if(x===1){if(k<=s&&R>=0&&L+1===R){b=!1,v=k,w=k,S=R;continue}if(D>=1&&O>=0&&O-1===L){y=!1,v=D,w=D,S=O;continue}if(v=e,w=e,S=L,S===0)return{startLineNumber:v,endLineNumber:w,indent:S}}b&&(O>=S?v=D:b=!1),y&&(R>=S?w=k:y=!1)}return{startLineNumber:v,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,s){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new N(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(N.fromPositions(i)).toArray()).filter(f=>N.strictContainsPosition(f.range,i));c=(o=EA(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Dj;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!s.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(s.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===Nh.Enabled||s.horizontalGuides===Nh.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new dh(-1,h.openingBracketRange.getEndPosition().column,g,new h_(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,b,h.minVisibleColumnIndentation+1);let S=!1;Ks(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&r[p.lineNumber-e].push(new dh(y,-1,g,new h_(!1,p.column),-1,-1)),_.lineNumber<=t&&b>y&&r[_.lineNumber-e].push(new dh(y,-1,g,new h_(!S,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Ui.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/s.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=_;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&w>this._maxIndentLeft)break;const y=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",S=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new V(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:w+this._spaceWidth)-w:this._spaceWidth;_+=`
`}h[g]=_}this._renderResult=h}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Nh.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Nh.EnabledForActive:Nh.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const h=new Array;d.push(h);const f=s?s[u-e]:[],g=new sc(f),p=o?o[u-e]:0;for(let _=1;_<=p;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=u&&u<=a&&_===l;h.push(...g.takeWhile(y=>y.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function ng(n){if(!(n&&n.isTransparent()))return n}Sr((n,e)=>{const t=[{bracketColor:hj,guideColor:Pve,guideColorActive:Hve},{bracketColor:fj,guideColor:Ove,guideColorActive:zve},{bracketColor:gj,guideColor:Fve,guideColorActive:$ve},{bracketColor:pj,guideColor:Bve,guideColorActive:Uve},{bracketColor:mj,guideColor:Wve,guideColorActive:jve},{bracketColor:_j,guideColor:Vve,guideColorActive:qve}],i=new Dj,s=[{indentColor:w1,indentColorActive:y1},{indentColor:mve,indentColorActive:yve},{indentColor:_ve,indentColorActive:Cve},{indentColor:bve,indentColorActive:Sve},{indentColor:vve,indentColorActive:xve},{indentColor:wve,indentColorActive:Lve}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=ng((l=ng(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=ng((c=ng(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(VC),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=ng(l),u=ng(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(VC);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class a2{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class L1e{constructor(){this._currentVisibleRange=new N(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class D1e{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class k1e{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Ci(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new L1e,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(114).enabled,this._maxNumberStickyLines=s.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new La(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),s=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Mn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new T9(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new D1e(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new k1e(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new V(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new a2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=N.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new a2(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(s.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=s.startLineNumber;u<=s.endLineNumber;u++){if(ud)continue;const h=u===s.startLineNumber?s.startColumn:1,f=u!==s.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):s.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const s=new a2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Fbe(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Zn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,b=o[0].endLineNumber;for(let w=1,y=o.length;wl){if(!d)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,w=h-l;_=Math.max(w,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=c)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-XL.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}}XL.HORIZONTAL_EXTRA_PX=30;class YA{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s??0}}class E1e{constructor(e,t){this.className=e,this.zIndex=t}}class I1e{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class kj extends Nf{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new I1e}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNames)continue;const a=Math.max(r.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new N1e(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.lane===s.lane?i.zIndex===s.zIndex?s.type===i.type?i.type===0&&s.type===0?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.lane===s.lane);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,lane:r.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class T1e{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new M1e(this.lineNumber,this.lane,e)}}class N1e{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class M1e{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class R1e extends kj{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',l=[];for(let c=t;c<=i;c++){const d=c-t,u=s[d].getDecorations();let h="";for(const f of u)h+='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Bo{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=Bo._clamp(e),this.g=Bo._clamp(t),this.b=Bo._clamp(i),this.a=Bo._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Bo.Empty=new Bo(0,0,0,0);class S1 extends K{static getInstance(){return this._INSTANCE||(this._INSTANCE=new S1),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(vi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=vi.getColorMap();if(!e){this._colors=[Bo.Empty],this._backgroundIsLight=!0;return}this._colors=[Bo.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}S1._INSTANCE=null;const O1e=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),F1e=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class Pb{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Pb.soften(e,12/15),this.charDataLight=Pb.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=F1e(s,c),v=e.width*4,b=a.r,w=a.g,y=a.b,S=o.r-b,L=o.g-w,x=o.b-y,D=Math.max(r,l),k=e.data;let O=_*h*f,R=i*v+t*4;for(let P=0;Pe.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=r.r,p=r.g,_=r.b,v=s.r-g,b=s.g-p,w=s.b-_,y=g+v*f,S=p+b*f,L=_+w*f,x=Math.max(o,a),D=e.data;let k=i*h+t*4;for(let O=0;O{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=$9[n[t]]<<4|$9[n[t+1]]&15;return e},j9={1:Up(()=>U9("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Up(()=>U9("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class f_{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return j9[e]?i=new Pb(j9[e](),e):i=f_.createFromSampleData(f_.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const o of O1e)i.fillText(String.fromCharCode(o),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=f_._downsample(e,t);return new Pb(s,t)}static _downsampleChar(e,t,i,s,o){const r=1*o,a=2*o;let l=s,c=0;for(let d=0;d0){const c=255/l;for(let d=0;df_.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Ob._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Ob._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Cbe);return i?new Bo(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Sbe);return t?Bo._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class g_{constructor(e,t,i,s,o,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,l,c,d,u){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const x=Math.max(1,Math.floor(o*o/L)),D=Math.max(0,e.minimapHeight-x),k=D/(d-o),O=c*k,R=D>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),M=Math.floor(e.paddingTop/e.lineHeight);return new g_(c,d,R,k,O,x,M,1,Math.min(a,P))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*f/h)}else{const L=o/p;_=Math.floor(L*f/h)}const v=Math.floor(e.paddingTop/p);let b=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const L=o/p;b=Math.max(b,L-1)}let w;if(b>0){const L=o/p;w=(v+a+b-L-1)*f/h}else w=Math.max(0,(v+a)*f/h-_);w=Math.min(e.minimapHeight-_,w);const y=w/(d-o),S=c*y;if(g>=v+a+b){const L=w>0;return new g_(c,d,L,y,S,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let x,D=Math.max(1,Math.floor(L-S*h/f));Dc&&(D=Math.min(D,u.startLineNumber),x=Math.max(x,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?R=(t-D+x+O)*f/h:R=c/e.paddingTop*(x+O)*f/h,new g_(c,d,!0,y,R,_,x,D,k)}}}class bS{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}bS.INVALID=new bS(-1);class q9{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new yj(()=>bS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let v=0,b=s-1;v0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Fb.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Nn(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new zL,this._sliderPointerDownListener=Hi(this._slider.domNode,le.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Tt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=G(this._domNode.domNode,Mt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=G(this._domNode.domNode,Mt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Hi(this._domNode.domNode,Mt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const l=Nn(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Rs&&c>B1e){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new H4(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(k9),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=g_.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(N.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,s,o);const d=new G9(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new G9(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,r,l,a,s),this._renderDecorationsHighlights(c,i,u,e,r,l,a,s)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=s.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)i.set(g,!0);const h=s.getYForLineNumber(d,o),f=s.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(Dc,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Dc,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Ys.Inline)continue;const d=s.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(i.has(p))continue;i.set(p,!0);const _=s.getYForLineNumber(u,o);e.fillRect(Dc,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=s.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,s,f,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=s.intersectWithViewport(c.range);if(!u)continue;const[h,f]=u,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(d.position){case Ys.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case Ys.Gutter:{const _=s.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,_,W1e,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,l,c,d,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,p=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,p,c,d,u),b=this.getXOffsetForPosition(t,r,_,c,d,u);this.renderDecoration(e,s,v,h,b-v,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return Dc;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Dc];let d=Dc;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1S?Math.floor((s-S)/2):0,x=h.a/255,D=new Bo(Math.round((h.r-u.r)*x+u.r),Math.round((h.g-u.g)*x+u.g),Math.round((h.b-u.b)*x+u.b),255);let k=e.topPaddingLineCount*s;const O=[];for(let Y=0,ne=i-t+1;Y=0&&Rb)return;const P=_.charCodeAt(S);if(P===9){const M=h-(S+L)%h;L+=M-1,y+=M*r}else if(P===32)y+=r;else{const M=Wd(P)?2:1;for(let $=0;$b)return}}}}}class G9{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class H1e extends so{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=_t(document.createElement("div")),Ka.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=_t(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const s=Object.keys(this._widgets);for(let o=0,r=s.length;o=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,l=e,c=l+o,d=l+o+a;return[[0,l,c,l,d,l,c,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&H.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class $1e extends so{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=_t(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=vi.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new z1e(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=s/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):u.clearRect(0,0,i,s);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,_=g.data;u.fillStyle=p;let v=0,b=0,w=0;for(let y=0,S=_.length/3;ys&&(P=s-d),k=P-d,O=P+d}k>w+1||L!==v?(y!==0&&u.fillRect(h[v],b,f[v],w-b),v=L,b=k,w=O):O>w&&(w=O)}u.fillRect(h[v],b,f[v],w-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,_=this._settings.x[7],v=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let b=-100,w=-100;for(let y=0,S=this._cursorPositions.length;ys&&(x=s-p);const D=x-p,k=D+g;D>w+1?(y!==0&&u.fillRect(_,b,v,w-b),b=D,w=k):k>w&&(w=k)}u.fillRect(_,b,v,w-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,s),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class K9{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Ej{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const v=d.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const w=new K9(p-_,p+_,b);d.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(K9.compare),a}}class j1e extends b1{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=_t(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new U1e(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==o?(e.fillRect(0,r,s,a-r),o=c,e.fillStyle=i[o],r=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,r,s,a-r),r=d,a=u)}e.fillRect(0,r,s,a-r)}}class q1e extends so{constructor(e){super(e),this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=_t(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class K1e{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Y1e{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Z1e(n){return new K1e(n)}function X1e(n){return new Y1e(n.lineNumber,n.ranges.map(Z1e))}class ui extends Nf{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Ew(d-g)g&&(h.top=1),Ew(u-p)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=s[0].lineNumber,c=s[s.length-1].lineNumber;for(let d=0,u=s.length;d1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}ui.SELECTION_CLASS_NAME="selected-text";ui.SELECTION_TOP_LEFT="top-left-radius";ui.SELECTION_BOTTOM_LEFT="bottom-left-radius";ui.SELECTION_TOP_RIGHT="top-right-radius";ui.SELECTION_BOTTOM_RIGHT="bottom-right-radius";ui.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";ui.ROUNDED_PIECE_WIDTH=10;Sr((n,e)=>{const t=n.getColor(M_e);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Ew(n){return n<0?-n:n}class Y9{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}class Z9{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=_t(document.createElement("div")),this._domNode.setClassName(`cursor ${rp}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Mn(this._domNode,i),this._domNode.setDisplay("none"),this._position=new V(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Mn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=dfe(i,t-1);return[new V(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fn.Line||this._cursorStyle===fn.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===fn.Line?(f=LF(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=LF(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new Y9(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new N(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===fn.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===fn.Underline||this._cursorStyle===fn.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new Y9(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${rp} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class Bb extends so{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Z9(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=_t(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new hc,this._cursorFlatBlinkInterval=new g1,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},Bb.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Bb.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fn.Line:e+=" cursor-line-style";break;case fn.Block:e+=" cursor-block-style";break;case fn.Underline:e+=" cursor-underline-style";break;case fn.LineThin:e+=" cursor-line-thin-style";break;case fn.BlockOutline:e+=" cursor-block-outline-style";break;case fn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=n.getColor(uj);if(t){let i=n.getColor(gve);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),Zl(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const l2=()=>{throw new Error("Invalid change accessor")};class Q1e extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=_t(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=_t(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};J1e(e,s),s.addZone=l2,s.removeZone=l2,s.layoutZone=l2}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:_t(t.domNode),marginDomNode:t.marginDomNode?_t(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){pt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){pt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=O.endOffset&&(k++,O=i&&i[k]),M!==9&&M!==32||h&&!L&&P<=D)continue;if(u&&P>=x&&P<=D&&M===32){const Y=P-1>=0?a.charCodeAt(P-1):0,ne=P+1=0?a.charCodeAt(P-1):0;if(M===32&&Y!==32&&Y!==9)continue}if(i&&(!O||O.startOffset>P||O.endOffset<=P))continue;const $=e.visibleRangeForPosition(new V(t,P+1));$&&(r?(R=Math.max(R,$.left),M===9?S+=this._renderArrow(f,_,$.left):S+=``):M===9?S+=`
${y?String.fromCharCode(65515):String.fromCharCode(8594)}
`:S+=`
${String.fromCharCode(w)}
`)}return r?(R=Math.round(R+_),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,l={x:0,y:s/2},c={x:100/125*o,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},h={x:u.x+.35*c.x,y:u.y-.35*c.x},f={x:h.x,y:-h.y},g={x:u.x,y:-u.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class X9{constructor(e){const t=e.options,i=t.get(50),s=t.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var owe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rwe=function(n,e){return function(t,i){e(t,i,n)}};let ZA=class extends b1{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new lt(1,1,1,1)],this._renderAnimationFrame=null;const l=new f1e(t,s,o,e);this._context=new twe(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(qA,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=_t(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=_t(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=_t(document.createElement("div")),Ka.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new C1e(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new XL(this._context,this._linesContent),this._viewZones=new Q1e(this._context),this._viewParts.push(this._viewZones);const c=new $1e(this._context);this._viewParts.push(c);const d=new G1e(this._context);this._viewParts.push(d);const u=new p1e(this._context);this._viewParts.push(u),u.addDynamicOverlay(new v1e(this._context)),u.addDynamicOverlay(new ui(this._context)),u.addDynamicOverlay(new x1e(this._context)),u.addDynamicOverlay(new y1e(this._context)),u.addDynamicOverlay(new swe(this._context));const h=new m1e(this._context);this._viewParts.push(h),h.addDynamicOverlay(new w1e(this._context)),h.addDynamicOverlay(new P1e(this._context)),h.addDynamicOverlay(new R1e(this._context)),h.addDynamicOverlay(new C1(this._context)),this._glyphMarginWidgets=new A1e(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new nf(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new _1e(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Bb(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new H1e(this._context),this._viewParts.push(this._overlayWidgets);const g=new q1e(this._context);this._viewParts.push(g);const p=new nwe(this._context);this._viewParts.push(p);const _=new V1e(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new uve(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),ed.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var r,a;const l=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:ip.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,r)=>N.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===ip.Left&&(!i||N.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===ip.Right&&(!s||N.compareRangesUsingEnds(s,o.range)<0)&&(s=o.range),i&&s){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new zbe(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new V(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+jA(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=J$(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){awe(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!h4(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new iwe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new Pbe(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new V(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?YL.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new j1e(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,s,o,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(s=e.position)===null||s===void 0?void 0:s.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};ZA=owe([rwe(6,bt)],ZA);function awe(n){try{return n()}catch(e){pt(e)}}class Ij{constructor(e,t,i,s,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function of(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=yo&&(t=t-n%yo),t}function hwe(n,e){return n.reduce((t,i)=>Oi(t,e(i)),Is)}function Aj(n,e){return n===e}function Vb(n,e){const t=n,i=e;if(i-t<=0)return Is;const o=Math.floor(t/yo),r=Math.floor(i/yo),a=i-r*yo;if(o===r){const l=t-o*yo;return bi(0,a-l)}else return bi(r-o,a)}function ap(n,e){return n=e}function Og(n){return bi(n.lineNumber-1,n.column-1)}function Mh(n,e){const t=n,i=Math.floor(t/yo),s=t-i*yo,o=e,r=Math.floor(o/yo),a=o-r*yo;return new N(i+1,s+1,r+1,a+1)}function fwe(n){const e=xf(n);return bi(e.length-1,e[e.length-1].length)}class jl{static fromModelContentChanges(e){return e.map(i=>{const s=N.lift(i.range);return new jl(Og(s.getStartPosition()),Og(s.getEndPosition()),fwe(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Ho(this.startOffset)}...${Ho(this.endOffset)}) -> ${Ho(this.newLength)}`}}class gwe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>z4.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:Vb(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?bi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):bi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ho(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?bi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):bi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(s===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=dwe(e,t,this.lineIdx,this.lineCharOffset);return new zc(s,0,-1,Ai.getEmpty(),new Gu(s))}}class Cwe{constructor(e,t){this.text=e,this._offset=Is,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| -`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new zc(bi(0,g),0,-1,Ai.getEmpty(),new Gu(bi(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new zc(bi(1,g),0,-1,Ai.getEmpty(),new Gu(bi(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vSwe(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 Swe(n){let e=pr(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class xwe{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=j4.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Lwe(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?Tj(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())e7(i,s)<=e7(s,r)?(i=c2(i,s),s=r):s=c2(s,r);return c2(i,s)}function Tj(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function e7(n,e){return Math.abs(n.listHeight-e.listHeight)}function c2(n,e){return n.listHeight===e.listHeight?Ya.create23(n,e,null,!1):n.listHeight>e.listHeight?Dwe(n,e):kwe(e,n)}function Dwe(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=Ya.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ya.create23(n,s,null,!1):n}function kwe(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=Ya.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ya.create23(s,n,null,!1):n}class Ewe{constructor(e){this.lastOffset=Is,this.nextNodes=[e],this.offsets=[Is],this.idxs=[]}readLongestNodeAt(e,t){if(ap(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=c0(this.nextNodes);if(!i)return;const s=c0(this.offsets);if(ap(e,s))return;if(ap(s,e))if(Oi(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=d2(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=d2(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=c0(this.offsets),t=c0(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=c0(this.nextNodes),s=d2(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Oi(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function d2(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function c0(n){return n.length>0?n[n.length-1]:void 0}function t7(n,e,t,i){return new Iwe(n,e,t,i).parseDocument()}class Iwe{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new Ewe(i):void 0,this.positionMapper=new gwe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Ai.getEmpty(),0);return e||(e=Ya.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?Lwe(i):Tj(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!wS(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!ap(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new vwe(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Gu(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Hb.create(i.astNode,o,r.astNode)):Hb.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function SS(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new sc(i7(n)),i=i7(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return s&&u.unshift(s),u}const d=[];for(;s&&!wS(c);){const[u,h]=s.splitAt(c);d.push(u),c=Vb(u.lengthAfter,c),s=h??t.dequeue()}return wS(c)||d.push(new td(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&Aj(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new jl(h.startOffset,d,Oi(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=Is;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=hwe(d,f=>f.lengthBefore),h=Oi(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=Oi(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class td{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Vb(e,this.lengthAfter);return Aj(t,Is)?[this,void 0]:this.modified?[new td(this.modified,this.lengthBefore,e),new td(this.modified,Is,t)]:[new td(this.modified,e,e),new td(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ho(this.lengthBefore)} -> ${Ho(this.lengthAfter)}`}}function i7(n){const e=[];let t=Is;for(const i of n){const s=Vb(t,i.startOffset);wS(s)||e.push(new td(!1,s,s));const o=Vb(i.startOffset,i.endOffset);e.push(new td(!0,o,i.newLength)),t=i.endOffset}return e}class Awe extends K{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new pwe,this.brackets=new xwe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new Cwe(this.textModel.getValue(),i);this.initialAstWithoutTokens=t7(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new jl(bi(i.fromLineNumber-1,0),bi(i.toLineNumber,0),bi(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=jl.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=SS(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=SS(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new wwe(this.textModel,this.brackets);return t7(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=bi(e.startLineNumber-1,e.startColumn-1),s=bi(e.endLineNumber-1,e.endColumn-1);return new za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;XA(r,Is,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Og(e.getStartPosition()),s=Og(e.getEndPosition());return new za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Twe(o,t,this.textModel);QA(r,Is,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Mj(t,Is,t.length,Og(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Nj(t,Is,t.length,Og(e))}}function Nj(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=Oi(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(ap(r,i)){const l=Nj(n.children[o],r,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Mh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function Mj(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=Oi(e,s.length),ap(i,t)){const o=Mj(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Mh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function XA(n,e,t,i,s,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case 4:{const u=n.childrenLength;for(let h=0;h200)return!0;let c=!0;if(n.kind===2){let d=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(n.openingBracket.text,f)}const u=Oi(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new cwe(Mh(e,t),Mh(e,u),n.closingBracket?Mh(Oi(u,((l=n.child)===null||l===void 0?void 0:l.length)||Is),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=Oi(e,f.length),lp(e,s)&&V0(t,i)&&(c=QA(f,e,t,i,s,o,r+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,d)}else{let d=e;for(const u of n.children){const h=d;if(d=Oi(d,u.length),lp(h,s)&&lp(i,d)&&(c=QA(u,h,d,i,s,o,r,a),!c))return!1}}return c}class Nwe extends K{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Qr),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||!((s=this.bracketPairsTree.value)===null||s===void 0)&&s.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new fe;this.bracketPairsTree.value=Mwe(e.add(new Awe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||za.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||za.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||za.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(N.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?Iw(this._findMatchingBracketUp(l,s,u2(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(N.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(cr(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,N.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=u2(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=s-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(fa(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=s+1;c=l)break;if(fa(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!fa(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=tr.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Cl)return null;d=f}}l=u.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(l)).brackets;if(c&&!fa(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=tr.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Cl?null:g}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof Cl?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return Cl.INSTANCE;const f=tr.findPrevBracketInRange(o,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let f=u-1,g=h.length,p=h.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let _=!0;for(;f>=0;f--){const v=d.getLanguageId(f)===s&&!fa(d.getStandardTokenType(f));if(v)_?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(_&&g!==p){const b=l(c,h,g,p);if(b)return b}_=v}if(_&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return Cl.INSTANCE;const g=tr.findNextBracketInRange(o,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,_=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,f=d.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const p=l.getLanguageId(u);s!==p&&(s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(s!==p){if(o&&r&&g&&h!==f){const v=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v);g=!1}s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const _=!!o&&!fa(l.getStandardTokenType(u));if(_)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(r&&o&&g&&h!==f){const v=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(r,p)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const s=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=s;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const s=u2(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){const p=[];for(let _=0,v=g?g.brackets.length:0;_{for(;;){if(s&&++c%100===0&&!s())return Cl.INSTANCE;const b=tr.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const w=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),y=f.textIsBracket[w];if(y&&(y.isOpen(w)?a[y.index]++:y.isClose(w)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(b,y,!1,s);_=b.endColumn-1}return null};let u=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),_=this.textModel.getLineContent(f);let v=0,b=0,w=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,w=i.column-1;const S=g.getLanguageId(v);u!==S&&(u=S,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let y=!0;for(;ve==null?void 0:e.dispose()}}function u2(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class Cl{constructor(){this._searchCanceledBrand=void 0}}Cl.INSTANCE=new Cl;function Iw(n){return n instanceof Cl?null:n}class Rwe extends K{constructor(e){super(),this.textModel=e,this.colorProvider=new Rj,this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new N(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Rj{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Sr((n,e)=>{const t=[hj,fj,gj,pj,mj,_j],i=new Rj;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Rve)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function Aw(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class wn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Aw(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Aw(this.oldText)}")`:`(replace@${this.oldPosition} "${Aw(this.oldText)}" with "${Aw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Or(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!JR(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function Fwe(n){return n>=65&&n<=90||n>=97&&n<=122}function ll(n){return KC(n,!0)}class Bwe{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:hb(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===it.file)return JA(ll(e),ll(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(o7(e.authority,t.authority))return JA(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return $e.joinPath(e,...t)}basenameOrAuthority(e){return ea(e)||e.authority}basename(e){return Ri.basename(e.path)}extname(e){return Ri.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===it.file?t=$e.file(zhe(ll(e))).path:(t=Ri.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===it.file?t=$e.file(C$(ll(e))).path:t=Ri.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!o7(e.authority,t.authority))return;if(e.scheme===it.file){const o=Hhe(ll(e),ll(t));return Rs?Pj(o):o}let i=e.path||"/";const s=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,s.length);on7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=dd){return r7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=dd){let i=!1;if(e.scheme===it.file){const s=ll(e);i=s!==void 0&&s.length===n7(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!r7(e,t)?e.with({path:e.path+"/"}):e}}const Vt=new Bwe(()=>!1),q4=Vt.isEqual.bind(Vt);Vt.isEqualOrParent.bind(Vt);Vt.getComparisonKey.bind(Vt);const Wwe=Vt.basenameOrAuthority.bind(Vt),ea=Vt.basename.bind(Vt);Vt.extname.bind(Vt);const G4=Vt.dirname.bind(Vt);Vt.joinPath.bind(Vt);const Vwe=Vt.normalizePath.bind(Vt);Vt.relativePath.bind(Vt);const s7=Vt.resolvePath.bind(Vt);Vt.isAbsolutePath.bind(Vt);const o7=Vt.isEqualAuthority.bind(Vt),r7=Vt.hasTrailingPathSeparator.bind(Vt);Vt.removeTrailingPathSeparator.bind(Vt);Vt.addTrailingPathSeparator.bind(Vt);var xS;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(xS||(xS={}));function sg(n){return n.toString()}class Xi{static create(e,t){const i=e.getAlternativeVersionId(),s=eT(e);return new Xi(i,i,s,s,t,t,[])}constructor(e,t,i,s,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,s,o){t.length>0&&(this.changes=Pwe(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Or(e,t?t.length:0,i),i+=4,t)for(const s of t)Or(e,s.selectionStartLineNumber,i),i+=4,Or(e,s.selectionStartColumn,i),i+=4,Or(e,s.positionLineNumber,i),i+=4,Or(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Pr(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return($e.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Xi}append(e,t,i,s,o){this._data instanceof Xi&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Xi&&(this._data=this._data.serialize())}open(){this._data instanceof Xi||(this._data=Xi.deserialize(this._data))}undo(){if($e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Xi&&(this._data=this._data.serialize());const e=Xi.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if($e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Xi&&(this._data=this._data.serialize());const e=Xi.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Xi&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Hwe{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=sg(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=sg(e);return this._editStackElementsMap.has(t)}setModel(e){const t=sg($e.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=sg(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=sg(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=sg(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ea(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function eT(n){return n.getEOL()===` -`?0:1}function Sl(n){return n?n instanceof Oj||n instanceof Hwe:!1}class K4{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Sl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Sl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Sl(i)&&i.canAppend(this._model))return i;const s=new Oj(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],eT(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=K4._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),o.append(this._model,l.map(c=>c.textChange),eT(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return pt(i),null}}}class zwe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function $we(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){s.spacesDiff=u,u>0&&0<=l-1&&l-10?s++:y>1&&o++,$we(r,a,_,w,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=w}let h=t;s!==o&&(h=s{const _=d[p];_>g&&(g=_,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function vs(n){return(n.metadata&1)>>>0}function Ft(n,e){n.metadata=n.metadata&254|e<<0}function Sn(n){return(n.metadata&2)>>>1===1}function Rt(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function Fj(n){return(n.metadata&4)>>>2===1}function l7(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function Bj(n){return(n.metadata&64)>>>6===1}function c7(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function Uwe(n){return(n.metadata&24)>>>3}function d7(n,e){n.metadata=n.metadata&231|e<<3}function jwe(n){return(n.metadata&32)>>>5===1}function u7(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class Wj{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Ft(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,l7(this,!1),c7(this,!1),d7(this,1),u7(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Rt(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;const t=this.options.className;l7(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),c7(this,this.options.glyphMarginClassName!==null),d7(this,this.options.stickiness),u7(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Ue=new Wj(null,0,0);Ue.parent=Ue;Ue.left=Ue;Ue.right=Ue;Ft(Ue,0);class h2{constructor(){this.root=Ue,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===Ue?[]:Jwe(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===Ue?[]:Qwe(this,e,t,i,s)}collectNodesFromOwner(e){return Zwe(this,e)}collectNodesPostOrder(){return Xwe(this)}insert(e){h7(this,e),this._normalizeDeltaIfNecessary()}delete(e){f7(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=i.start+s,r=i.end+s;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,s){const o=Kwe(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function Gwe(n,e,t,i,s){const o=Uwe(n),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=n.start;let h=!1;const f=n.end;let g=!1;e<=u&&f<=t&&jwe(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&og(u,r,e,_)&&(h=!0),!g&&og(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&og(u,r,e+d,_)&&(h=!0),!g&&og(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&og(u,r,t,_)&&(n.start=e+c,h=!0),!g&&og(f,a,t,_)&&(n.end=e+c,g=!0)}const p=c-l;h||(n.start=Math.max(0,u+p)),g||(n.end=Math.max(0,f+p)),n.start>n.end&&(n.end=n.start)}function Kwe(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==Ue;){if(Sn(i)){Rt(i.left,!1),Rt(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Sn(i.left)){if(o=s+i.maxEnd,ot){Rt(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Rt(i,!0),i.right!==Ue&&!Sn(i.right)){s+=i.delta,i=i.right;continue}}return Rt(n.root,!1),l}function Ywe(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==Ue;){if(Sn(s)){Rt(s.left,!1),Rt(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),jd(s),s=s.parent;continue}if(!Sn(s.left)){if(r=o+s.maxEnd,rt){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Rt(s,!0);continue}if(Rt(s,!0),s.right!==Ue&&!Sn(s.right)){o+=s.delta,s=s.right;continue}}Rt(n.root,!1)}function Zwe(n,e){let t=n.root;const i=[];let s=0;for(;t!==Ue;){if(Sn(t)){Rt(t.left,!1),Rt(t.right,!1),t=t.parent;continue}if(t.left!==Ue&&!Sn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Rt(t,!0),t.right!==Ue&&!Sn(t.right)){t=t.right;continue}}return Rt(n.root,!1),i}function Xwe(n){let e=n.root;const t=[];let i=0;for(;e!==Ue;){if(Sn(e)){Rt(e.left,!1),Rt(e.right,!1),e=e.parent;continue}if(e.left!==Ue&&!Sn(e.left)){e=e.left;continue}if(e.right!==Ue&&!Sn(e.right)){e=e.right;continue}t[i++]=e,Rt(e,!0)}return Rt(n.root,!1),t}function Qwe(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==Ue;){if(Sn(o)){Rt(o.left,!1),Rt(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==Ue&&!Sn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&Fj(o)&&(u=!1),s&&!Bj(o)&&(u=!1),u&&(c[d++]=o),Rt(o,!0),o.right!==Ue&&!Sn(o.right)){r+=o.delta,o=o.right;continue}}return Rt(n.root,!1),c}function Jwe(n,e,t,i,s,o,r){let a=n.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==Ue;){if(Sn(a)){Rt(a.left,!1),Rt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Sn(a.left)){if(c=l+a.maxEnd,ct){Rt(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),s&&Fj(a)&&(g=!1),r&&!Bj(a)&&(g=!1),g&&(h[f++]=a)}if(Rt(a,!0),a.right!==Ue&&!Sn(a.right)){l+=a.delta,a=a.right;continue}}return Rt(n.root,!1),h}function h7(n,e){if(n.root===Ue)return e.parent=Ue,e.left=Ue,e.right=Ue,Ft(e,0),n.root=e,n.root;eye(n,e),Tc(e.parent);let t=e;for(;t!==n.root&&vs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;vs(i)===1?(Ft(t.parent,0),Ft(i,0),Ft(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,p_(n,t)),Ft(t.parent,0),Ft(t.parent.parent,1),m_(n,t.parent.parent))}else{const i=t.parent.parent.left;vs(i)===1?(Ft(t.parent,0),Ft(i,0),Ft(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,m_(n,t)),Ft(t.parent,0),Ft(t.parent.parent,1),p_(n,t.parent.parent))}return Ft(n.root,0),e}function eye(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(iye(s,o,i.start+t,i.end+t)<0)if(i.left===Ue){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Ue){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=Ue,e.right=Ue,Ft(e,1)}function f7(n,e){let t,i;if(e.left===Ue?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Ue?(t=e.left,i=e):(i=tye(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Ft(t,0),e.detach(),f2(),jd(t),n.root.parent=Ue;return}const s=vs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Ft(i,vs(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ue&&(i.left.parent=i),i.right!==Ue&&(i.right.parent=i)),e.detach(),s){Tc(t.parent),i!==e&&(Tc(i),Tc(i.parent)),f2();return}Tc(t),Tc(t.parent),i!==e&&(Tc(i),Tc(i.parent));let o;for(;t!==n.root&&vs(t)===0;)t===t.parent.left?(o=t.parent.right,vs(o)===1&&(Ft(o,0),Ft(t.parent,1),p_(n,t.parent),o=t.parent.right),vs(o.left)===0&&vs(o.right)===0?(Ft(o,1),t=t.parent):(vs(o.right)===0&&(Ft(o.left,0),Ft(o,1),m_(n,o),o=t.parent.right),Ft(o,vs(t.parent)),Ft(t.parent,0),Ft(o.right,0),p_(n,t.parent),t=n.root)):(o=t.parent.left,vs(o)===1&&(Ft(o,0),Ft(t.parent,1),m_(n,t.parent),o=t.parent.left),vs(o.left)===0&&vs(o.right)===0?(Ft(o,1),t=t.parent):(vs(o.left)===0&&(Ft(o.right,0),Ft(o,1),p_(n,o),o=t.parent.left),Ft(o,vs(t.parent)),Ft(t.parent,0),Ft(o.left,0),m_(n,t.parent),t=n.root));Ft(t,0),f2()}function tye(n){for(;n.left!==Ue;)n=n.left;return n}function f2(){Ue.parent=Ue,Ue.delta=0,Ue.start=0,Ue.end=0}function p_(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Ue&&(t.left.parent=e),t.parent=e.parent,e.parent===Ue?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,jd(e),jd(t)}function m_(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Ue&&(t.right.parent=e),t.parent=e.parent,e.parent===Ue?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,jd(e),jd(t)}function Vj(n){let e=n.end;if(n.left!==Ue){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Ue){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function jd(n){n.maxEnd=Vj(n)}function Tc(n){for(;n!==Ue;){const e=Vj(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function iye(n,e,t,i){return n===t?e-i:n-t}class tT{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Re)return Y4(this.right);let e=this;for(;e.parent!==Re&&e.parent.left!==e;)e=e.parent;return e.parent===Re?Re:e.parent}prev(){if(this.left!==Re)return Hj(this.left);let e=this;for(;e.parent!==Re&&e.parent.right!==e;)e=e.parent;return e.parent===Re?Re:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Re=new tT(null,0);Re.parent=Re;Re.left=Re;Re.right=Re;Re.color=0;function Y4(n){for(;n.left!==Re;)n=n.left;return n}function Hj(n){for(;n.right!==Re;)n=n.right;return n}function Z4(n){return n===Re?0:n.size_left+n.piece.length+Z4(n.right)}function X4(n){return n===Re?0:n.lf_left+n.piece.lineFeedCnt+X4(n.right)}function g2(){Re.parent=Re}function __(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Re&&(t.left.parent=e),t.parent=e.parent,e.parent===Re?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function b_(n,e){const t=e.left;e.left=t.right,t.right!==Re&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Re?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Tw(n,e){let t,i;if(e.left===Re?(i=e,t=i.right):e.right===Re?(i=e,t=i.left):(i=Y4(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),g2(),n.root.parent=Re;return}const s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,H0(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,H0(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Re&&(i.left.parent=i),i.right!==Re&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,H0(n,i)),e.detach(),t.parent.left===t){const r=Z4(t),a=X4(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,ml(n,t.parent,l,c)}}if(H0(n,t.parent),s){g2();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,__(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,b_(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,__(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,b_(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,__(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,b_(n,t.parent),t=n.root));t.color=0,g2()}function g7(n,e){for(H0(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,__(n,e)),e.parent.color=0,e.parent.parent.color=1,b_(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,b_(n,e)),e.parent.color=0,e.parent.parent.color=1,__(n,e.parent.parent))}n.root.color=0}function ml(n,e,t,i){for(;e!==n.root&&e!==Re;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function H0(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=Z4(e.left)-e.size_left,i=X4(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const cl=65535;function zj(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class nye{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function _l(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new nye(zj(n),i,s,o,r);return n.length=0,a}class Bs{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class Ku{constructor(e,t){this.buffer=e,this.lineStarts=t}}class oye{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Re&&e.iterate(e.root,i=>(i!==Re&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class rye{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class aye{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Ku("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Re,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=_l(e[o].buffer));const a=new Bs(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new rye(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=cl,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new Ku(l,_l(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new oye(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Re;)if(s.left!==Re&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Re;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new V(i+1,a+1)}return new V(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Re){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new V(i+1,r+1)}else t=t.right;return new V(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Re;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Re)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(s&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(s=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fy+g,t.reset(0)):(b=h.buffer,w=y=>y,t.reset(g));do if(_=t.next(b),_){if(w(_.index)>=p)return d;this.positionInBuffer(e,w(_.index)-f,v);const y=this.getLineFeedCnt(e.piece.bufferIndex,o,v),S=v.line===o.line?v.column-o.column+s:v.column+1,L=S+_[0].length;if(u[d++]=Hu(new N(i+y,S,i+y,L),_,l),w(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new Lg(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,s,r,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),w=v[d.line+p],y=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,y,d,this.positionInBuffer(f,w-b),t,i,s,r,o),r>=s)return o;h+=p}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,s),r>=s)return o;h++,l=this.nodeAt2(h,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,o,i,s),o}const g=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,g,d,u,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let p=-f;for(;(p=i.indexOf(h,p+f))!==-1;)if((!d||b4(d,i,g,p,f))&&(a[r++]=new vb(new N(s,p+1+o,s,p+1+f+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=Hu(new N(s,u.index+1+o,s,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Re){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,c=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let u=new Bs(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const p={line:u.start.line+1,column:0};u=new Bs(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` -`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const p=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,p),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,c);else this.deleteNodeTail(s,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(s,u);let f=s;for(let g=0;g=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>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;tcl){const d=[];for(;e.length>cl;){const h=e.charCodeAt(cl-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,cl-1),e=e.substring(cl-1)):(f=e.substring(0,cl),e=e.substring(cl));const g=_l(f);d.push(new Bs(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new Ku(f,g))}const u=_l(e);return d.push(new Bs(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new Ku(e,u)),d}let t=this._buffers[0].buffer.length;const i=_l(e,!1);let s=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},s=this._lastChangeBufferPos;for(let d=0;d=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,u=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(u+l,u+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);s=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!==Re;){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 s+=r.substring(l,l+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Re;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-s,d=a-o,u=i.length+d;e.piece=new Bs(i.bufferIndex,i.start,r,l,u),ml(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-s,d=o-l,u=i.length+d;e.piece=new Bs(i.bufferIndex,r,i.end,a,u),ml(this,e,d,c)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,l=s.lineFeedCnt,c=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,c),u=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Bs(s.bufferIndex,s.start,c,d,u),ml(this,e,u-a,d-l);const h=new Bs(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` -`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=_l(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Re;)if(i.left!==Re&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Re;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}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===Re||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Re||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=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Bs(e.piece.bufferIndex,e.piece.start,o,a,r),ml(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 Bs(t.piece.bufferIndex,l,t.piece.end,d,c),ml(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r -`);this.rbInsertRight(e,u[0]);for(let h=0;h=4){const l=I1e(e.autoIndent,t,s,{unshiftIndent:c=>ui.unshiftIndent(e,c),shiftIndent:c=>ui.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,u=t.getLineContent(s.endLineNumber),h=Gs(u);if(h>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,h+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new Mw(s,` +`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new Yy(s,` +`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return ui._typeCommand(s,` +`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;sui.shiftIndent(e,a),unshiftIndent:a=>ui.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?ui._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):ui._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,_=s.length;p<_;p++){const v=s[p];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,s,o){const r=[];for(let a=0,l=s.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new N(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+s!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-s.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new H(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if(Nc(s)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:p,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(p),w=b.substring(0,_-1),y=b.substring(v-1);if(y.startsWith(h)||(f=!1),y.length>0){const D=y.charAt(0);if(!ui._isBeforeClosingBrace(e,y)&&!c(D))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const D=tm(e.wordSeparators);if(w.length>0){const k=w.charCodeAt(w.length-1);if(D.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),L=HL(S,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const x=a.findNeutralCharacter();if(x){const D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,x);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const l=[];for(let c=0,d=s.length;cnew vs(new N(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new _s(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` +`){const d=[];for(let u=0,h=o.length;u{const s=t.get($t).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=Yr();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get($t).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var Zi;(function(n){class e extends ni{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,w){if(!w.position)return;b.model.pushStackElement(),b.setCursorStates(w.source,3,[_n.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&b.revealPrimaryCursor(w.source,!0,!0)}}n.MoveTo=ke(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=ke(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ni{runCoreEditorCommand(b,w){b.model.pushStackElement();const y=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),w);y!==null&&(b.setCursorStates(w.source,3,y.viewStates.map(S=>ot.fromViewState(S))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:y.fromLineNumber,fromViewVisualColumn:y.fromVisualColumn,toViewLineNumber:y.toLineNumber,toViewVisualColumn:y.toVisualColumn}),y.reversed?b.revealTopMostCursor(w.source):b.revealBottomMostCursor(w.source))}}n.ColumnSelect=ke(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,w,y){if(typeof y.position>"u"||typeof y.viewPosition>"u"||typeof y.mouseColumn>"u")return null;const S=v.model.validatePosition(y.position),L=v.coordinatesConverter.validateViewPosition(new H(y.viewPosition.lineNumber,y.viewPosition.column),S),x=y.doColumnSelect?w.fromViewLineNumber:L.lineNumber,D=y.doColumnSelect?w.fromViewVisualColumn:y.mouseColumn-1;return Zu.columnSelect(v.cursorConfig,v,x,D,L.lineNumber,y.mouseColumn-1)}}),n.CursorColumnSelectLeft=ke(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,w,y){return Zu.columnSelectLeft(v.cursorConfig,v,w)}}),n.CursorColumnSelectRight=ke(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,w,y){return Zu.columnSelectRight(v.cursorConfig,v,w)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,w,y,S){return Zu.columnSelectUp(b.cursorConfig,b,y,this._isPaged)}}n.CursorColumnSelectUp=ke(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=ke(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,w,y,S){return Zu.columnSelectDown(b.cursorConfig,b,y,this._isPaged)}}n.CursorColumnSelectDown=ke(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=ke(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends ni{constructor(){super({id:"cursorMove",precondition:void 0,description:yS.description})}runCoreEditorCommand(b,w){const y=yS.parse(w);y&&this._runCursorMove(b,w.source,y)}_runCursorMove(b,w,y){b.model.pushStackElement(),b.setCursorStates(w,3,o._move(b,b.getCursorStates(),y)),b.revealPrimaryCursor(w,!0)}static _move(b,w,y){const S=y.select,L=y.value;switch(y.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return _n.simpleMove(b,w,y.direction,S,L,y.unit);case 11:case 13:case 12:case 14:return _n.viewportMove(b,w,y.direction,S,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=ke(new o);class r extends ni{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,w){let y=this._staticArgs;this._staticArgs.value===-1&&(y={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(w.source,3,_n.simpleMove(b,b.getCursorStates(),y.direction,y.select,y.value,y.unit)),b.revealPrimaryCursor(w.source,!0)}}n.CursorLeft=ke(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=ke(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1039}})),n.CursorRight=ke(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=ke(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1041}})),n.CursorUp=ke(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=ke(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=ke(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:11}})),n.CursorPageUpSelect=ke(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1035}})),n.CursorDown=ke(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=ke(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=ke(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:12}})),n.CursorPageDownSelect=ke(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1036}})),n.CreateCursor=ke(new class extends ni{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let w;b.wholeLine?w=_n.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):w=_n.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const y=v.getCursorStates();if(y.length>1){const S=w.modelState?w.modelState.position:null,L=w.viewState?w.viewState.position:null;for(let x=0,D=y.length;xL&&(S=L);const x=new N(S,1,S,v.model.getLineMaxColumn(S));let D=0;if(w.at)switch(w.at){case Pg.RawAtArgument.Top:D=3;break;case Pg.RawAtArgument.Center:D=1;break;case Pg.RawAtArgument.Bottom:D=4;break}const k=v.coordinatesConverter.convertModelRangeToViewRange(x);v.revealRange(b.source,!1,k,D,0)}}),n.SelectAll=new class extends sT{constructor(){super(_pe)}runDOMCommand(v){_r&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,w){const y=b._getViewModel();y&&this.runCoreEditorCommand(y,w)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[_n.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=ke(new class extends ni{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[ot.fromModelSelection(b.selection)]))}})})(Zi||(Zi={}));const N1e=xe.and($.textInputFocus,$.columnSelection);function Fm(n,e){Ps.registerKeybindingRule({id:n,primary:e,when:N1e,weight:ft+1})}Fm(Zi.CursorColumnSelectLeft.id,1039);Fm(Zi.CursorColumnSelectRight.id,1041);Fm(Zi.CursorColumnSelectUp.id,1040);Fm(Zi.CursorColumnSelectPageUp.id,1035);Fm(Zi.CursorColumnSelectDown.id,1042);Fm(Zi.CursorColumnSelectPageDown.id,1036);function Q9(n){return n.register(),n}var J9;(function(n){class e extends wr{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=ke(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:$.writable,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,ui.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=ke(new class extends e{constructor(){super({id:"outdent",precondition:$.writable,kbOpts:{weight:ft,kbExpr:xe.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,ui.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=ke(new class extends e{constructor(){super({id:"tab",precondition:$.writable,kbOpts:{weight:ft,kbExpr:xe.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,ui.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=ke(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sf.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=ke(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:$.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sf.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends sT{constructor(){super(DU)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends sT{constructor(){super(kU)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(J9||(J9={}));class e7 extends WL{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get($t).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Mf(n,e){Q9(new e7("default:"+n,n)),Q9(new e7(n,n,e))}Mf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Mf("replacePreviousChar");Mf("compositionType");Mf("compositionStart");Mf("compositionEnd");Mf("paste");Mf("cut");class M1e{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Zi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Zi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Zi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Zi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Zi.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Zi.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Zi.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Zi.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Zi.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Zi.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Zi.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Zi.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Zi.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Zi.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class nD{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return nD.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new H(e.afterLineNumber,1)).lineNumber}}}class Bj{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new $i("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let l=i;l<=s;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=c,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),s=!0}}return s}}class Wj{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Bj(()=>this._host.createVisibleLine())}_createDomNode(){const e=_t(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,s[c-o])}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");Fl._ttPolicy&&(t=Fl._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});Fl._sb=new zL(1e5);class Vj extends so{constructor(e){super(e),this._visibleLines=new Wj(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Mn(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),s.appendString(o),s.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class P1e extends Vj{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class O1e extends Vj{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Mn(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Mn(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class F1e extends so{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=_t(document.createElement("div")),Ka.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=_t(document.createElement("div")),Ka.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new B1e(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,s,o){this._widgets[e.getId()].setPosition(t,i,s,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class B1e{constructor(e,t,i){this._primaryAnchor=new c0(null,null),this._secondaryAnchor=new c0(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=_t(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(143);this._fixedOverflowWidgets=s.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=s(t,this._context.viewModel,this._affinity),this._secondaryAnchor=s(i,this._context.viewModel,this._affinity);function s(o,r,a){if(!o)return new c0(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new c0(o,c)}return new c0(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,s){this._setPosition(s,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,l=s.viewportHeight-a,c=o-i,d=r>=i,u=a,h=l>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const f=h-(c-s);h-=f,i-=f}if(h=v,y=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(h,v),fitsBelow:y,belowTop:f,left:_}:{fitsAbove:w,aboveTop:a,fitsBelow:y,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d0(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const s=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:s,secondary:r};function a(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&c===3?0:u.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new t7(f,h,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&h2(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&h2(this._actual.afterRender,this._actual,this._renderData.position)}}class c0{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class d0{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class t7{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function h2(n,e,...t){try{return n.call(e,...t)}catch{return null}}class Hj extends Nf{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new lt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(s=>s.positionLineNumber);t.sort((s,o)=>s-o),Ki(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let l=i;l<=s;l++){const c=l-i;for(;r=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class W1e extends Hj{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class V1e extends Hj{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}xr((n,e)=>{const t=n.getColor(kj);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(Y9)){const i=n.getColor(Y9);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),Jl(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class H1e extends Nf{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:N.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,r);for(let f=u;f<=h;f++){const g=f-o;i[g]+=d}}}_renderNormalDecorations(e,t,i){var s;const o=String(this._lineHeight),r=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class z1e extends so{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+tT(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new K4(t.domNode,d,this._context.viewLayout.getScrollable())),Ka.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=_t(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};if(f){const _=h.scrollTop;_&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(g){const _=h.scrollLeft;_&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(K(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(K(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(K(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(K(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),s=t.get(74),o=t.get(40),r=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+tT(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class zj extends Y{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function sD(n,e){let t=0,i=0;const s=n.length;for(;is)throw new $i("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){a=D,l=k;break}}}if(c===-2){c=-1,d=-1;for(let D=x;D=0){c=D,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=x=>{if(h===-2){h=-1,f=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){h=D,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=D,p=k;break}}}};let v=0,b=!0,w=0,y=!0,S=0,L=0;for(let x=0;b||y;x++){const D=e-x,k=e+x;x>1&&(D<1||D1&&(k>s||k>i)&&(y=!1),x>5e4&&(b=!1,y=!1);let P=-1;if(b&&D>=1){const R=this._computeIndentLevel(D-1);R>=0?(c=D-1,d=R,P=Math.ceil(R/this.textModel.getOptions().indentSize)):(u(D),P=this._getIndentLevelForWhitespaceLine(r,l,d))}let O=-1;if(y&&k<=s){const R=this._computeIndentLevel(k-1);R>=0?(h=k-1,f=R,O=Math.ceil(R/this.textModel.getOptions().indentSize)):(_(k),O=this._getIndentLevelForWhitespaceLine(r,f,p))}if(x===0){L=P;continue}if(x===1){if(k<=s&&O>=0&&L+1===O){b=!1,v=k,w=k,S=O;continue}if(D>=1&&P>=0&&P-1===L){y=!1,v=D,w=D,S=P;continue}if(v=e,w=e,S=L,S===0)return{startLineNumber:v,endLineNumber:w,indent:S}}b&&(P>=S?v=D:b=!1),y&&(O>=S?w=k:y=!1)}return{startLineNumber:v,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,s){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new N(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(N.fromPositions(i)).toArray()).filter(f=>N.strictContainsPosition(f.range,i));c=(o=BA(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new $j;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!s.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(s.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===Mh.Enabled||s.horizontalGuides===Mh.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new gh(-1,h.openingBracketRange.getEndPosition().column,g,new g_(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,b,h.minVisibleColumnIndentation+1);let S=!1;Gs(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&r[p.lineNumber-e].push(new gh(y,-1,g,new g_(!1,p.column),-1,-1)),_.lineNumber<=t&&b>y&&r[_.lineNumber-e].push(new gh(y,-1,g,new g_(!S,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Ui.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/s.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=_;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&w>this._maxIndentLeft)break;const y=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",S=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new H(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:w+this._spaceWidth)-w:this._spaceWidth;_+=`
`}h[g]=_}this._renderResult=h}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Mh.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Mh.EnabledForActive:Mh.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const h=new Array;d.push(h);const f=s?s[u-e]:[],g=new ac(f),p=o?o[u-e]:0;for(let _=1;_<=p;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=u&&u<=a&&_===l;h.push(...g.takeWhile(y=>y.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function ng(n){if(!(n&&n.isTransparent()))return n}xr((n,e)=>{const t=[{bracketColor:Ij,guideColor:t1e,guideColorActive:a1e},{bracketColor:Aj,guideColor:i1e,guideColorActive:l1e},{bracketColor:Tj,guideColor:n1e,guideColorActive:c1e},{bracketColor:Nj,guideColor:s1e,guideColorActive:d1e},{bracketColor:Mj,guideColor:o1e,guideColorActive:u1e},{bracketColor:Rj,guideColor:r1e,guideColorActive:h1e}],i=new $j,s=[{indentColor:k1,indentColorActive:E1},{indentColor:Ove,indentColorActive:Hve},{indentColor:Fve,indentColorActive:zve},{indentColor:Bve,indentColorActive:$ve},{indentColor:Wve,indentColorActive:Uve},{indentColor:Vve,indentColorActive:jve}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=ng((l=ng(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=ng((c=ng(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(UC),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=ng(l),u=ng(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(UC);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class f2{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class j1e{constructor(){this._currentVisibleRange=new N(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class q1e{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class G1e{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new xi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new j1e,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(114).enabled,this._maxNumberStickyLines=s.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new La(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),s=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Mn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new U9(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new q1e(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new G1e(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new H(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new f2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=N.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new f2(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new H(s.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=s.startLineNumber;u<=s.endLineNumber;u++){if(ud)continue;const h=u===s.startLineNumber?s.startColumn:1,f=u!==s.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):s.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const s=new f2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new nve(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Zn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,b=o[0].endLineNumber;for(let w=1,y=o.length;wl){if(!d)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,w=h-l;_=Math.max(w,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=c)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-oD.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}}oD.HORIZONTAL_EXTRA_PX=30;class oT{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s??0}}class K1e{constructor(e,t){this.className=e,this.zIndex=t}}class Y1e{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Uj extends Nf{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new Y1e}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNames)continue;const a=Math.max(r.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Q1e(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.lane===s.lane?i.zIndex===s.zIndex?s.type===i.type?i.type===0&&s.type===0?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.lane===s.lane);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,lane:r.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class X1e{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new J1e(this.lineNumber,this.lane,e)}}class Q1e{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class J1e{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class ewe extends Uj{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',l=[];for(let c=t;c<=i;c++){const d=c-t,u=s[d].getDecorations();let h="";for(const f of u)h+='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Fo{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=Fo._clamp(e),this.g=Fo._clamp(t),this.b=Fo._clamp(i),this.a=Fo._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Fo.Empty=new Fo(0,0,0,0);class A1 extends Y{static getInstance(){return this._INSTANCE||(this._INSTANCE=new A1),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(yi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=yi.getColorMap();if(!e){this._colors=[Fo.Empty],this._backgroundIsLight=!0;return}this._colors=[Fo.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}A1._INSTANCE=null;const iwe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),nwe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class Fb{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Fb.soften(e,12/15),this.charDataLight=Fb.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=nwe(s,c),v=e.width*4,b=a.r,w=a.g,y=a.b,S=o.r-b,L=o.g-w,x=o.b-y,D=Math.max(r,l),k=e.data;let P=_*h*f,O=i*v+t*4;for(let R=0;Re.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=r.r,p=r.g,_=r.b,v=s.r-g,b=s.g-p,w=s.b-_,y=g+v*f,S=p+b*f,L=_+w*f,x=Math.max(o,a),D=e.data;let k=i*h+t*4;for(let P=0;P{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=i7[n[t]]<<4|i7[n[t+1]]&15;return e},s7={1:qp(()=>n7("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:qp(()=>n7("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class p_{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return s7[e]?i=new Fb(s7[e](),e):i=p_.createFromSampleData(p_.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const o of iwe)i.fillText(String.fromCharCode(o),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=p_._downsample(e,t);return new Fb(s,t)}static _downsampleChar(e,t,i,s,o){const r=1*o,a=2*o;let l=s,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dp_.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Bb._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Bb._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(zbe);return i?new Fo(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor($be);return t?Fo._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class m_{constructor(e,t,i,s,o,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,l,c,d,u){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const x=Math.max(1,Math.floor(o*o/L)),D=Math.max(0,e.minimapHeight-x),k=D/(d-o),P=c*k,O=D>0,R=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),M=Math.floor(e.paddingTop/e.lineHeight);return new m_(c,d,O,k,P,x,M,1,Math.min(a,R))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*f/h)}else{const L=o/p;_=Math.floor(L*f/h)}const v=Math.floor(e.paddingTop/p);let b=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const L=o/p;b=Math.max(b,L-1)}let w;if(b>0){const L=o/p;w=(v+a+b-L-1)*f/h}else w=Math.max(0,(v+a)*f/h-_);w=Math.min(e.minimapHeight-_,w);const y=w/(d-o),S=c*y;if(g>=v+a+b){const L=w>0;return new m_(c,d,L,y,S,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let x,D=Math.max(1,Math.floor(L-S*h/f));Dc&&(D=Math.min(D,u.startLineNumber),x=Math.max(x,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?O=(t-D+x+P)*f/h:O=c/e.paddingTop*(x+P)*f/h,new m_(c,d,!0,y,O,_,x,D,k)}}}class CS{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}CS.INVALID=new CS(-1);class o7{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Bj(()=>CS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let v=0,b=s-1;v0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Wb.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Nn(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new ZL,this._sliderPointerDownListener=Hi(this._slider.domNode,le.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Tt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=K(this._domNode.domNode,Mt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=K(this._domNode.domNode,Mt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Hi(this._domNode.domNode,Mt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const l=Nn(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Ms&&c>swe){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new Q4(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(V9),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=m_.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(N.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,s,o);const d=new r7(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new r7(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,r,l,a,s),this._renderDecorationsHighlights(c,i,u,e,r,l,a,s)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=s.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)i.set(g,!0);const h=s.getYForLineNumber(d,o),f=s.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(Ec,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Ec,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Ks.Inline)continue;const d=s.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(i.has(p))continue;i.set(p,!0);const _=s.getYForLineNumber(u,o);e.fillRect(Ec,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=s.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,s,f,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=s.intersectWithViewport(c.range);if(!u)continue;const[h,f]=u,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(d.position){case Ks.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case Ks.Gutter:{const _=s.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,_,owe,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,l,c,d,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,p=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,p,c,d,u),b=this.getXOffsetForPosition(t,r,_,c,d,u);this.renderDecoration(e,s,v,h,b-v,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return Ec;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Ec];let d=Ec;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1S?Math.floor((s-S)/2):0,x=h.a/255,D=new Fo(Math.round((h.r-u.r)*x+u.r),Math.round((h.g-u.g)*x+u.g),Math.round((h.b-u.b)*x+u.b),255);let k=e.topPaddingLineCount*s;const P=[];for(let G=0,ne=i-t+1;G=0&&Ob)return;const R=_.charCodeAt(S);if(R===9){const M=h-(S+L)%h;L+=M-1,y+=M*r}else if(R===32)y+=r;else{const M=Ud(R)?2:1;for(let W=0;Wb)return}}}}}class r7{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class awe extends so{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=_t(document.createElement("div")),Ka.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=_t(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const s=Object.keys(this._widgets);for(let o=0,r=s.length;o=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,l=e,c=l+o,d=l+o+a;return[[0,l,c,l,d,l,c,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&z.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class cwe extends so{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=_t(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=yi.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new lwe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=s/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=z.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=z.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):u.clearRect(0,0,i,s);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,_=g.data;u.fillStyle=p;let v=0,b=0,w=0;for(let y=0,S=_.length/3;ys&&(R=s-d),k=R-d,P=R+d}k>w+1||L!==v?(y!==0&&u.fillRect(h[v],b,f[v],w-b),v=L,b=k,w=P):P>w&&(w=P)}u.fillRect(h[v],b,f[v],w-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,_=this._settings.x[7],v=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let b=-100,w=-100;for(let y=0,S=this._cursorPositions.length;ys&&(x=s-p);const D=x-p,k=D+g;D>w+1?(y!==0&&u.fillRect(_,b,v,w-b),b=D,w=k):k>w&&(w=k)}u.fillRect(_,b,v,w-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,s),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class a7{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class jj{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const v=d.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const w=new a7(p-_,p+_,b);d.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(a7.compare),a}}class uwe extends L1{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=_t(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new dwe(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==o?(e.fillRect(0,r,s,a-r),o=c,e.fillStyle=i[o],r=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,r,s,a-r),r=d,a=u)}e.fillRect(0,r,s,a-r)}}class hwe extends so{constructor(e){super(e),this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=_t(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class gwe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class pwe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function mwe(n){return new gwe(n)}function _we(n){return new pwe(n.lineNumber,n.ranges.map(mwe))}class hi extends Nf{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Pw(d-g)g&&(h.top=1),Pw(u-p)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=s[0].lineNumber,c=s[s.length-1].lineNumber;for(let d=0,u=s.length;d1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}hi.SELECTION_CLASS_NAME="selected-text";hi.SELECTION_TOP_LEFT="top-left-radius";hi.SELECTION_BOTTOM_LEFT="bottom-left-radius";hi.SELECTION_TOP_RIGHT="top-right-radius";hi.SELECTION_BOTTOM_RIGHT="bottom-right-radius";hi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";hi.ROUNDED_PIECE_WIDTH=10;xr((n,e)=>{const t=n.getColor(J_e);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Pw(n){return n<0?-n:n}class l7{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}class c7{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=_t(document.createElement("div")),this._domNode.setClassName(`cursor ${ap}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Mn(this._domNode,i),this._domNode.setDisplay("none"),this._position=new H(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Mn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=Afe(i,t-1);return[new H(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fn.Line||this._cursorStyle===fn.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===fn.Line?(f=BF(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=BF(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new l7(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new N(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===fn.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===fn.Underline||this._cursorStyle===fn.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new l7(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${ap} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class Vb extends so{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new c7(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=_t(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new pc,this._cursorFlatBlinkInterval=new y1,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},Vb.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Vb.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fn.Line:e+=" cursor-line-style";break;case fn.Block:e+=" cursor-block-style";break;case fn.Underline:e+=" cursor-underline-style";break;case fn.LineThin:e+=" cursor-line-thin-style";break;case fn.BlockOutline:e+=" cursor-block-outline-style";break;case fn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=n.getColor(Ej);if(t){let i=n.getColor(Rve);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),Jl(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const g2=()=>{throw new Error("Invalid change accessor")};class bwe extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=_t(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=_t(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};vwe(e,s),s.addZone=g2,s.removeZone=g2,s.layoutZone=g2}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:_t(t.domNode),marginDomNode:t.marginDomNode?_t(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){pt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){pt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=P.endOffset&&(k++,P=i&&i[k]),M!==9&&M!==32||h&&!L&&R<=D)continue;if(u&&R>=x&&R<=D&&M===32){const G=R-1>=0?a.charCodeAt(R-1):0,ne=R+1=0?a.charCodeAt(R-1):0;if(M===32&&G!==32&&G!==9)continue}if(i&&(!P||P.startOffset>R||P.endOffset<=R))continue;const W=e.visibleRangeForPosition(new H(t,R+1));W&&(r?(O=Math.max(O,W.left),M===9?S+=this._renderArrow(f,_,W.left):S+=``):M===9?S+=`
${y?String.fromCharCode(65515):String.fromCharCode(8594)}
`:S+=`
${String.fromCharCode(w)}
`)}return r?(O=Math.round(O+_),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,l={x:0,y:s/2},c={x:100/125*o,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},h={x:u.x+.35*c.x,y:u.y-.35*c.x},f={x:h.x,y:-h.y},g={x:u.x,y:-u.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class d7{constructor(e){const t=e.options,i=t.get(50),s=t.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var Lwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Dwe=function(n,e){return function(t,i){e(t,i,n)}};let rT=class extends L1{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new lt(1,1,1,1)],this._renderAnimationFrame=null;const l=new M1e(t,s,o,e);this._context=new ywe(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(iT,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=_t(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=_t(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=_t(document.createElement("div")),Ka.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new z1e(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new oD(this._context,this._linesContent),this._viewZones=new bwe(this._context),this._viewParts.push(this._viewZones);const c=new cwe(this._context);this._viewParts.push(c);const d=new fwe(this._context);this._viewParts.push(d);const u=new P1e(this._context);this._viewParts.push(u),u.addDynamicOverlay(new W1e(this._context)),u.addDynamicOverlay(new hi(this._context)),u.addDynamicOverlay(new U1e(this._context)),u.addDynamicOverlay(new H1e(this._context)),u.addDynamicOverlay(new xwe(this._context));const h=new O1e(this._context);this._viewParts.push(h),h.addDynamicOverlay(new V1e(this._context)),h.addDynamicOverlay(new twe(this._context)),h.addDynamicOverlay(new ewe(this._context)),h.addDynamicOverlay(new I1(this._context)),this._glyphMarginWidgets=new Z1e(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new nf(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new F1e(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Vb(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new awe(this._context),this._viewParts.push(this._overlayWidgets);const g=new hwe(this._context);this._viewParts.push(g);const p=new Swe(this._context);this._viewParts.push(p);const _=new rwe(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new Tve(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),nd.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var r,a;const l=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:np.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,r)=>N.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===np.Left&&(!i||N.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===np.Right&&(!s||N.compareRangesUsingEnds(s,o.range)<0)&&(s=o.range),i&&s){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new lve(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new H(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+tT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=mU(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){kwe(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!S4(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Cwe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new tve(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new H(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?nD.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new uwe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,s,o,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(s=e.position)===null||s===void 0?void 0:s.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};rT=Lwe([Dwe(6,bt)],rT);function kwe(n){try{return n()}catch(e){pt(e)}}class qj{constructor(e,t,i,s,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function of(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=wo&&(t=t-n%wo),t}function Nwe(n,e){return n.reduce((t,i)=>Oi(t,e(i)),Es)}function Gj(n,e){return n===e}function zb(n,e){const t=n,i=e;if(i-t<=0)return Es;const o=Math.floor(t/wo),r=Math.floor(i/wo),a=i-r*wo;if(o===r){const l=t-o*wo;return wi(0,a-l)}else return wi(r-o,a)}function lp(n,e){return n=e}function Og(n){return wi(n.lineNumber-1,n.column-1)}function Rh(n,e){const t=n,i=Math.floor(t/wo),s=t-i*wo,o=e,r=Math.floor(o/wo),a=o-r*wo;return new N(i+1,s+1,r+1,a+1)}function Mwe(n){const e=xf(n);return wi(e.length-1,e[e.length-1].length)}class Gl{static fromModelContentChanges(e){return e.map(i=>{const s=N.lift(i.range);return new Gl(Og(s.getStartPosition()),Og(s.getEndPosition()),Mwe(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Ho(this.startOffset)}...${Ho(this.endOffset)}) -> ${Ho(this.newLength)}`}}class Rwe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>J4.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:zb(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?wi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):wi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ho(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?wi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):wi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(s===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=Awe(e,t,this.lineIdx,this.lineCharOffset);return new Uc(s,0,-1,Ti.getEmpty(),new Qu(s))}}class zwe{constructor(e,t){this.text=e,this._offset=Es,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| +`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new Uc(wi(0,g),0,-1,Ti.getEmpty(),new Qu(wi(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Uc(wi(1,g),0,-1,Ti.getEmpty(),new Qu(wi(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(v$we(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 $we(n){let e=mr(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class Uwe{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=iP.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function jwe(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?Kj(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())f7(i,s)<=f7(s,r)?(i=p2(i,s),s=r):s=p2(s,r);return p2(i,s)}function Kj(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function f7(n,e){return Math.abs(n.listHeight-e.listHeight)}function p2(n,e){return n.listHeight===e.listHeight?Ya.create23(n,e,null,!1):n.listHeight>e.listHeight?qwe(n,e):Gwe(e,n)}function qwe(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=Ya.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ya.create23(n,s,null,!1):n}function Gwe(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=Ya.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ya.create23(s,n,null,!1):n}class Kwe{constructor(e){this.lastOffset=Es,this.nextNodes=[e],this.offsets=[Es],this.idxs=[]}readLongestNodeAt(e,t){if(lp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u0(this.nextNodes);if(!i)return;const s=u0(this.offsets);if(lp(e,s))return;if(lp(s,e))if(Oi(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=m2(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=m2(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=u0(this.offsets),t=u0(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u0(this.nextNodes),s=m2(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Oi(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function m2(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u0(n){return n.length>0?n[n.length-1]:void 0}function g7(n,e,t,i){return new Ywe(n,e,t,i).parseDocument()}class Ywe{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new Kwe(i):void 0,this.positionMapper=new Rwe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Ti.getEmpty(),0);return e||(e=Ya.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?jwe(i):Kj(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!xS(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!lp(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Wwe(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Qu(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),$b.create(i.astNode,o,r.astNode)):$b.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function kS(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new ac(p7(n)),i=p7(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return s&&u.unshift(s),u}const d=[];for(;s&&!xS(c);){const[u,h]=s.splitAt(c);d.push(u),c=zb(u.lengthAfter,c),s=h??t.dequeue()}return xS(c)||d.push(new sd(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&Gj(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new Gl(h.startOffset,d,Oi(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=Es;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=Nwe(d,f=>f.lengthBefore),h=Oi(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=Oi(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class sd{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=zb(e,this.lengthAfter);return Gj(t,Es)?[this,void 0]:this.modified?[new sd(this.modified,this.lengthBefore,e),new sd(this.modified,Es,t)]:[new sd(this.modified,e,e),new sd(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ho(this.lengthBefore)} -> ${Ho(this.lengthAfter)}`}}function p7(n){const e=[];let t=Es;for(const i of n){const s=zb(t,i.startOffset);xS(s)||e.push(new sd(!1,s,s));const o=zb(i.startOffset,i.endOffset);e.push(new sd(!0,o,i.newLength)),t=i.endOffset}return e}class Zwe extends Y{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new Pwe,this.brackets=new Uwe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new zwe(this.textModel.getValue(),i);this.initialAstWithoutTokens=g7(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new Gl(wi(i.fromLineNumber-1,0),wi(i.toLineNumber,0),wi(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Gl.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=kS(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=kS(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new Vwe(this.textModel,this.brackets);return g7(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=wi(e.startLineNumber-1,e.startColumn-1),s=wi(e.endLineNumber-1,e.endColumn-1);return new za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;aT(r,Es,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Og(e.getStartPosition()),s=Og(e.getEndPosition());return new za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Xwe(o,t,this.textModel);lT(r,Es,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Zj(t,Es,t.length,Og(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Yj(t,Es,t.length,Og(e))}}function Yj(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=Oi(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(lp(r,i)){const l=Yj(n.children[o],r,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Rh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function Zj(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=Oi(e,s.length),lp(i,t)){const o=Zj(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Rh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function aT(n,e,t,i,s,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case 4:{const u=n.childrenLength;for(let h=0;h200)return!0;let c=!0;if(n.kind===2){let d=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(n.openingBracket.text,f)}const u=Oi(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new Iwe(Rh(e,t),Rh(e,u),n.closingBracket?Rh(Oi(u,((l=n.child)===null||l===void 0?void 0:l.length)||Es),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=Oi(e,f.length),cp(e,s)&&z0(t,i)&&(c=lT(f,e,t,i,s,o,r+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,d)}else{let d=e;for(const u of n.children){const h=d;if(d=Oi(d,u.length),cp(h,s)&&cp(i,d)&&(c=lT(u,h,d,i,s,o,r,a),!c))return!1}}return c}class Qwe extends Y{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Jr),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||!((s=this.bracketPairsTree.value)===null||s===void 0)&&s.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new fe;this.bracketPairsTree.value=Jwe(e.add(new Zwe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||za.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||za.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||za.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(N.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?Ow(this._findMatchingBracketUp(l,s,_2(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(N.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(cr(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,N.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=_2(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=s-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(ga(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=s+1;c=l)break;if(ga(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!ga(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=tr.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Sl)return null;d=f}}l=u.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(l)).brackets;if(c&&!ga(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=tr.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Sl?null:g}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof Sl?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return Sl.INSTANCE;const f=tr.findPrevBracketInRange(o,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let f=u-1,g=h.length,p=h.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let _=!0;for(;f>=0;f--){const v=d.getLanguageId(f)===s&&!ga(d.getStandardTokenType(f));if(v)_?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(_&&g!==p){const b=l(c,h,g,p);if(b)return b}_=v}if(_&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return Sl.INSTANCE;const g=tr.findNextBracketInRange(o,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,_=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,f=d.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const p=l.getLanguageId(u);s!==p&&(s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(s!==p){if(o&&r&&g&&h!==f){const v=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v);g=!1}s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const _=!!o&&!ga(l.getStandardTokenType(u));if(_)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(r&&o&&g&&h!==f){const v=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=tr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(r,p)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const s=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=s;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const s=_2(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){const p=[];for(let _=0,v=g?g.brackets.length:0;_{for(;;){if(s&&++c%100===0&&!s())return Sl.INSTANCE;const b=tr.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const w=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),y=f.textIsBracket[w];if(y&&(y.isOpen(w)?a[y.index]++:y.isClose(w)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(b,y,!1,s);_=b.endColumn-1}return null};let u=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),_=this.textModel.getLineContent(f);let v=0,b=0,w=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,w=i.column-1;const S=g.getLanguageId(v);u!==S&&(u=S,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let y=!0;for(;ve==null?void 0:e.dispose()}}function _2(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class Sl{constructor(){this._searchCanceledBrand=void 0}}Sl.INSTANCE=new Sl;function Ow(n){return n instanceof Sl?null:n}class eye extends Y{constructor(e){super(),this.textModel=e,this.colorProvider=new Xj,this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new N(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Xj{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}xr((n,e)=>{const t=[Ij,Aj,Tj,Nj,Mj,Rj],i=new Xj;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(e1e)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function Fw(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class wn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Fw(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Fw(this.oldText)}")`:`(replace@${this.oldPosition} "${Fw(this.oldText)}" with "${Fw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Fr(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!d4(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function nye(n){return n>=65&&n<=90||n>=97&&n<=122}function ll(n){return QC(n,!0)}class sye{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:gb(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===it.file)return cT(ll(e),ll(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(b7(e.authority,t.authority))return cT(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return je.joinPath(e,...t)}basenameOrAuthority(e){return ta(e)||e.authority}basename(e){return Ri.basename(e.path)}extname(e){return Ri.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===it.file?t=je.file(lfe(ll(e))).path:(t=Ri.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===it.file?t=je.file(W$(ll(e))).path:t=Ri.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!b7(e.authority,t.authority))return;if(e.scheme===it.file){const o=afe(ll(e),ll(t));return Ms?Qj(o):o}let i=e.path||"/";const s=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,s.length);om7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=fd){return v7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=fd){let i=!1;if(e.scheme===it.file){const s=ll(e);i=s!==void 0&&s.length===m7(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!v7(e,t)?e.with({path:e.path+"/"}):e}}const Vt=new sye(()=>!1),nP=Vt.isEqual.bind(Vt);Vt.isEqualOrParent.bind(Vt);Vt.getComparisonKey.bind(Vt);const oye=Vt.basenameOrAuthority.bind(Vt),ta=Vt.basename.bind(Vt);Vt.extname.bind(Vt);const sP=Vt.dirname.bind(Vt);Vt.joinPath.bind(Vt);const rye=Vt.normalizePath.bind(Vt);Vt.relativePath.bind(Vt);const _7=Vt.resolvePath.bind(Vt);Vt.isAbsolutePath.bind(Vt);const b7=Vt.isEqualAuthority.bind(Vt),v7=Vt.hasTrailingPathSeparator.bind(Vt);Vt.removeTrailingPathSeparator.bind(Vt);Vt.addTrailingPathSeparator.bind(Vt);var ES;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(ES||(ES={}));function sg(n){return n.toString()}class Xi{static create(e,t){const i=e.getAlternativeVersionId(),s=dT(e);return new Xi(i,i,s,s,t,t,[])}constructor(e,t,i,s,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,s,o){t.length>0&&(this.changes=tye(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Fr(e,t?t.length:0,i),i+=4,t)for(const s of t)Fr(e,s.selectionStartLineNumber,i),i+=4,Fr(e,s.selectionStartColumn,i),i+=4,Fr(e,s.positionLineNumber,i),i+=4,Fr(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Or(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(je.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Xi}append(e,t,i,s,o){this._data instanceof Xi&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Xi&&(this._data=this._data.serialize())}open(){this._data instanceof Xi||(this._data=Xi.deserialize(this._data))}undo(){if(je.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Xi&&(this._data=this._data.serialize());const e=Xi.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(je.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Xi&&(this._data=this._data.serialize());const e=Xi.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Xi&&(this._data=this._data.serialize()),this._data.byteLength+168}}class aye{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=sg(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=sg(e);return this._editStackElementsMap.has(t)}setModel(e){const t=sg(je.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=sg(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=sg(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=sg(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ta(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function dT(n){return n.getEOL()===` +`?0:1}function xl(n){return n?n instanceof Jj||n instanceof aye:!1}class oP{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);xl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);xl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(xl(i)&&i.canAppend(this._model))return i;const s=new Jj(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],dT(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=oP._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),o.append(this._model,l.map(c=>c.textChange),dT(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return pt(i),null}}}class lye{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function cye(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){s.spacesDiff=u,u>0&&0<=l-1&&l-10?s++:y>1&&o++,cye(r,a,_,w,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=w}let h=t;s!==o&&(h=s{const _=d[p];_>g&&(g=_,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function bs(n){return(n.metadata&1)>>>0}function Ft(n,e){n.metadata=n.metadata&254|e<<0}function Sn(n){return(n.metadata&2)>>>1===1}function Rt(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function eq(n){return(n.metadata&4)>>>2===1}function y7(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function tq(n){return(n.metadata&64)>>>6===1}function C7(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function dye(n){return(n.metadata&24)>>>3}function S7(n,e){n.metadata=n.metadata&231|e<<3}function uye(n){return(n.metadata&32)>>>5===1}function x7(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class iq{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Ft(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,y7(this,!1),C7(this,!1),S7(this,1),x7(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Rt(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;const t=this.options.className;y7(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),C7(this,this.options.glyphMarginClassName!==null),S7(this,this.options.stickiness),x7(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const qe=new iq(null,0,0);qe.parent=qe;qe.left=qe;qe.right=qe;Ft(qe,0);class b2{constructor(){this.root=qe,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===qe?[]:vye(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===qe?[]:bye(this,e,t,i,s)}collectNodesFromOwner(e){return mye(this,e)}collectNodesPostOrder(){return _ye(this)}insert(e){L7(this,e),this._normalizeDeltaIfNecessary()}delete(e){D7(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=i.start+s,r=i.end+s;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,s){const o=gye(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function fye(n,e,t,i,s){const o=dye(n),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=n.start;let h=!1;const f=n.end;let g=!1;e<=u&&f<=t&&uye(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&og(u,r,e,_)&&(h=!0),!g&&og(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&og(u,r,e+d,_)&&(h=!0),!g&&og(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&og(u,r,t,_)&&(n.start=e+c,h=!0),!g&&og(f,a,t,_)&&(n.end=e+c,g=!0)}const p=c-l;h||(n.start=Math.max(0,u+p)),g||(n.end=Math.max(0,f+p)),n.start>n.end&&(n.end=n.start)}function gye(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==qe;){if(Sn(i)){Rt(i.left,!1),Rt(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Sn(i.left)){if(o=s+i.maxEnd,ot){Rt(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Rt(i,!0),i.right!==qe&&!Sn(i.right)){s+=i.delta,i=i.right;continue}}return Rt(n.root,!1),l}function pye(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==qe;){if(Sn(s)){Rt(s.left,!1),Rt(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),Zd(s),s=s.parent;continue}if(!Sn(s.left)){if(r=o+s.maxEnd,rt){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Rt(s,!0);continue}if(Rt(s,!0),s.right!==qe&&!Sn(s.right)){o+=s.delta,s=s.right;continue}}Rt(n.root,!1)}function mye(n,e){let t=n.root;const i=[];let s=0;for(;t!==qe;){if(Sn(t)){Rt(t.left,!1),Rt(t.right,!1),t=t.parent;continue}if(t.left!==qe&&!Sn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Rt(t,!0),t.right!==qe&&!Sn(t.right)){t=t.right;continue}}return Rt(n.root,!1),i}function _ye(n){let e=n.root;const t=[];let i=0;for(;e!==qe;){if(Sn(e)){Rt(e.left,!1),Rt(e.right,!1),e=e.parent;continue}if(e.left!==qe&&!Sn(e.left)){e=e.left;continue}if(e.right!==qe&&!Sn(e.right)){e=e.right;continue}t[i++]=e,Rt(e,!0)}return Rt(n.root,!1),t}function bye(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==qe;){if(Sn(o)){Rt(o.left,!1),Rt(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==qe&&!Sn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&eq(o)&&(u=!1),s&&!tq(o)&&(u=!1),u&&(c[d++]=o),Rt(o,!0),o.right!==qe&&!Sn(o.right)){r+=o.delta,o=o.right;continue}}return Rt(n.root,!1),c}function vye(n,e,t,i,s,o,r){let a=n.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==qe;){if(Sn(a)){Rt(a.left,!1),Rt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Sn(a.left)){if(c=l+a.maxEnd,ct){Rt(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),s&&eq(a)&&(g=!1),r&&!tq(a)&&(g=!1),g&&(h[f++]=a)}if(Rt(a,!0),a.right!==qe&&!Sn(a.right)){l+=a.delta,a=a.right;continue}}return Rt(n.root,!1),h}function L7(n,e){if(n.root===qe)return e.parent=qe,e.left=qe,e.right=qe,Ft(e,0),n.root=e,n.root;wye(n,e),Mc(e.parent);let t=e;for(;t!==n.root&&bs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;bs(i)===1?(Ft(t.parent,0),Ft(i,0),Ft(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,__(n,t)),Ft(t.parent,0),Ft(t.parent.parent,1),b_(n,t.parent.parent))}else{const i=t.parent.parent.left;bs(i)===1?(Ft(t.parent,0),Ft(i,0),Ft(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,b_(n,t)),Ft(t.parent,0),Ft(t.parent.parent,1),__(n,t.parent.parent))}return Ft(n.root,0),e}function wye(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(Cye(s,o,i.start+t,i.end+t)<0)if(i.left===qe){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===qe){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=qe,e.right=qe,Ft(e,1)}function D7(n,e){let t,i;if(e.left===qe?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===qe?(t=e.left,i=e):(i=yye(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Ft(t,0),e.detach(),v2(),Zd(t),n.root.parent=qe;return}const s=bs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Ft(i,bs(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==qe&&(i.left.parent=i),i.right!==qe&&(i.right.parent=i)),e.detach(),s){Mc(t.parent),i!==e&&(Mc(i),Mc(i.parent)),v2();return}Mc(t),Mc(t.parent),i!==e&&(Mc(i),Mc(i.parent));let o;for(;t!==n.root&&bs(t)===0;)t===t.parent.left?(o=t.parent.right,bs(o)===1&&(Ft(o,0),Ft(t.parent,1),__(n,t.parent),o=t.parent.right),bs(o.left)===0&&bs(o.right)===0?(Ft(o,1),t=t.parent):(bs(o.right)===0&&(Ft(o.left,0),Ft(o,1),b_(n,o),o=t.parent.right),Ft(o,bs(t.parent)),Ft(t.parent,0),Ft(o.right,0),__(n,t.parent),t=n.root)):(o=t.parent.left,bs(o)===1&&(Ft(o,0),Ft(t.parent,1),b_(n,t.parent),o=t.parent.left),bs(o.left)===0&&bs(o.right)===0?(Ft(o,1),t=t.parent):(bs(o.left)===0&&(Ft(o.right,0),Ft(o,1),__(n,o),o=t.parent.left),Ft(o,bs(t.parent)),Ft(t.parent,0),Ft(o.left,0),b_(n,t.parent),t=n.root));Ft(t,0),v2()}function yye(n){for(;n.left!==qe;)n=n.left;return n}function v2(){qe.parent=qe,qe.delta=0,qe.start=0,qe.end=0}function __(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==qe&&(t.left.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Zd(e),Zd(t)}function b_(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==qe&&(t.right.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Zd(e),Zd(t)}function nq(n){let e=n.end;if(n.left!==qe){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==qe){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function Zd(n){n.maxEnd=nq(n)}function Mc(n){for(;n!==qe;){const e=nq(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function Cye(n,e,t,i){return n===t?e-i:n-t}class uT{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Re)return rP(this.right);let e=this;for(;e.parent!==Re&&e.parent.left!==e;)e=e.parent;return e.parent===Re?Re:e.parent}prev(){if(this.left!==Re)return sq(this.left);let e=this;for(;e.parent!==Re&&e.parent.right!==e;)e=e.parent;return e.parent===Re?Re:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Re=new uT(null,0);Re.parent=Re;Re.left=Re;Re.right=Re;Re.color=0;function rP(n){for(;n.left!==Re;)n=n.left;return n}function sq(n){for(;n.right!==Re;)n=n.right;return n}function aP(n){return n===Re?0:n.size_left+n.piece.length+aP(n.right)}function lP(n){return n===Re?0:n.lf_left+n.piece.lineFeedCnt+lP(n.right)}function w2(){Re.parent=Re}function v_(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Re&&(t.left.parent=e),t.parent=e.parent,e.parent===Re?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function w_(n,e){const t=e.left;e.left=t.right,t.right!==Re&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Re?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Bw(n,e){let t,i;if(e.left===Re?(i=e,t=i.right):e.right===Re?(i=e,t=i.left):(i=rP(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),w2(),n.root.parent=Re;return}const s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,$0(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,$0(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Re&&(i.left.parent=i),i.right!==Re&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,$0(n,i)),e.detach(),t.parent.left===t){const r=aP(t),a=lP(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,_l(n,t.parent,l,c)}}if($0(n,t.parent),s){w2();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,v_(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,w_(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,v_(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,w_(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,v_(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,w_(n,t.parent),t=n.root));t.color=0,w2()}function k7(n,e){for($0(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,v_(n,e)),e.parent.color=0,e.parent.parent.color=1,w_(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,w_(n,e)),e.parent.color=0,e.parent.parent.color=1,v_(n,e.parent.parent))}n.root.color=0}function _l(n,e,t,i){for(;e!==n.root&&e!==Re;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function $0(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=aP(e.left)-e.size_left,i=lP(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const cl=65535;function oq(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class Sye{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function bl(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new Sye(oq(n),i,s,o,r);return n.length=0,a}class Fs{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class Ju{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Lye{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Re&&e.iterate(e.root,i=>(i!==Re&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class Dye{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class kye{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Ju("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Re,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=bl(e[o].buffer));const a=new Fs(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new Dye(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=cl,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new Ju(l,bl(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Lye(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Re;)if(s.left!==Re&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Re;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new H(i+1,a+1)}return new H(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Re){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new H(i+1,r+1)}else t=t.right;return new H(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Re;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Re)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(s&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(s=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fy+g,t.reset(0)):(b=h.buffer,w=y=>y,t.reset(g));do if(_=t.next(b),_){if(w(_.index)>=p)return d;this.positionInBuffer(e,w(_.index)-f,v);const y=this.getLineFeedCnt(e.piece.bufferIndex,o,v),S=v.line===o.line?v.column-o.column+s:v.column+1,L=S+_[0].length;if(u[d++]=qu(new N(i+y,S,i+y,L),_,l),w(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new Lg(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,s,r,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),w=v[d.line+p],y=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,y,d,this.positionInBuffer(f,w-b),t,i,s,r,o),r>=s)return o;h+=p}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,s),r>=s)return o;h++,l=this.nodeAt2(h,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,o,i,s),o}const g=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,g,d,u,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let p=-f;for(;(p=i.indexOf(h,p+f))!==-1;)if((!d||I4(d,i,g,p,f))&&(a[r++]=new yb(new N(s,p+1+o,s,p+1+f+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=qu(new N(s,u.index+1+o,s,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Re){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,c=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let u=new Fs(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const p={line:u.start.line+1,column:0};u=new Fs(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const p=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,p),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,c);else this.deleteNodeTail(s,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(s,u);let f=s;for(let g=0;g=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>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;tcl){const d=[];for(;e.length>cl;){const h=e.charCodeAt(cl-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,cl-1),e=e.substring(cl-1)):(f=e.substring(0,cl),e=e.substring(cl));const g=bl(f);d.push(new Fs(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new Ju(f,g))}const u=bl(e);return d.push(new Fs(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new Ju(e,u)),d}let t=this._buffers[0].buffer.length;const i=bl(e,!1);let s=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},s=this._lastChangeBufferPos;for(let d=0;d=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,u=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(u+l,u+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);s=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!==Re;){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 s+=r.substring(l,l+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Re;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-s,d=a-o,u=i.length+d;e.piece=new Fs(i.bufferIndex,i.start,r,l,u),_l(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-s,d=o-l,u=i.length+d;e.piece=new Fs(i.bufferIndex,r,i.end,a,u),_l(this,e,d,c)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,l=s.lineFeedCnt,c=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,c),u=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Fs(s.bufferIndex,s.start,c,d,u),_l(this,e,u-a,d-l);const h=new Fs(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=bl(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Re;)if(i.left!==Re&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Re;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}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===Re||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Re||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=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Fs(e.piece.bufferIndex,e.piece.start,o,a,r),_l(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 Fs(t.piece.bufferIndex,l,t.piece.end,d,c),_l(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r +`);this.rbInsertRight(e,u[0]);for(let h=0;h_.sortIndex-v.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,_)=>_.lineNumber-p.lineNumber),g=[];for(let p=0,_=u.length;p<_;p++){const v=u[p].lineNumber;if(p>0&&u[p-1].lineNumber===v)continue;const b=u[p].oldContent,w=this.getLineContent(v);w.length===0||w===b||Ks(w)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new mme(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new N(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=of(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cp._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new N(c,d,c,d+l.firstLineLength):u=new N(c,d,c+h-1,l.lastLineLength+1)}else u=new N(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class lye{constructor(e,t,i,s,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let s=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;p_.sortIndex-v.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,_)=>_.lineNumber-p.lineNumber),g=[];for(let p=0,_=u.length;p<_;p++){const v=u[p].lineNumber;if(p>0&&u[p-1].lineNumber===v)continue;const b=u[p].oldContent,w=this.getLineContent(v);w.length===0||w===b||Gs(w)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new Ome(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new N(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=of(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(dp._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new N(c,d,c,d+l.firstLineLength):u=new N(c,d,c+h-1,l.lastLineLength+1)}else u=new N(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Eye{constructor(e,t,i,s,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=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=sye(this._tmpLineStarts,e);this.chunks.push(new Ku(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=fb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=N$(e)))}finish(e=!0){return this._finish(),new lye(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=_l(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class cye{constructor(e){this._default=e,this._store=[]}get(e){return 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 s=this._store.slice(0,e),o=this._store.slice(e+t),r=dye(i,this._default);this._store=s.concat(r,o)}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 s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new uye(e,[t]))}finalize(){return this._tokens}}class hye{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new nT(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class fye extends hye{constructor(e,t,i,s){super(e,t),this._textModel=i,this._languageIdCodec=s}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>t)break;const o=this._textModel.getLineContent(s.lineNumber),r=d0(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=d0(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new on(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(s,0),d=d0(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new on(d.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class pye{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Ge(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Ge(i.start,e):this._ranges.splice(t,1,new Ge(i.start,e),new Ge(e+1,i.endExclusive))}}addRange(e){Ge.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function d0(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){pt(a)}return r||(r=C4(n.encodeLanguageId(e),o)),on.convertToEndOffset(r.tokens,i.length),r}class mye{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Kc(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Ze(e,t))}}const bl=new Uint32Array(0).buffer;class _a{static deleteBeginning(e,t){return e===null||e===bl?e:_a.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===bl)return e;const i=Ol(e),s=i[i.length-2];return _a.delete(e,t,s)}static delete(e,t,i){if(e===null||e===bl||t===i)return e;const s=Ol(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return bl;const r=on.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,l=s[r<<1];if(id&&(s[c++]=g,s[c++]=s[(f<<1)+1],d=g)}if(c===s.length)return e;const h=new Uint32Array(c);return h.set(s.subarray(0,c),0),h.buffer}static append(e,t){if(t===bl)return e;if(e===bl)return t;if(e===null)return e;if(t===null)return null;const i=Ol(e),s=Ol(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=on.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let s=null;if(t1&&(o=$s.getLanguageId(s[1])!==e),!o)return bl}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=p7(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=_a.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=_a.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=_a.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=_a.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=_a.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class Q4{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){s=s||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=gL(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=Q4._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const c=[];let d=0,u=0;const h=(f,g)=>{f!==u&&(u=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,b=~v>>>0;for(;lt)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class LS extends Lj{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new Q4(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new _ye(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=of(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new $i("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=LS._findLanguageBoundaries(s,o),l=lb(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[c,d]=LS._findLanguageBoundaries(s,o-1),u=lb(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new bye(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new nT(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=vi.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return pt(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new fye(this._textModel.getLineCount(),s,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};s&&s.createBackgroundTokenizer&&!s.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,r)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new mye(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new $b(this._languageIdCodec),this._debugBackgroundStates=new nT(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=of(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Ze.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,s;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new iT,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.checkFinished()}forceTokenization(e){var t,i;const s=new iT;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(s,e),this.setTokens(s.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),s=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!s.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return s}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new V(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class bye extends K{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Ci(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ki(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class vye{constructor(){this.changeType=1}}class ta{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new ta(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new ta(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}}class m7{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class wye{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class yye{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Cye{constructor(){this.changeType=5}}class dp{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},p2=function(n,e){return function(t,i){e(t,i,n)}},Fu;function xye(n){const e=new $j;return e.acceptChunk(n),e.finish()}function Lye(n){const e=new $j;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function _7(n,e){let t;return typeof n=="string"?t=xye(n):gme(n)?t=Lye(n):t=n,t.create(e)}let Nw=0;const Dye=999,kye=1e4;class Eye{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const u0=()=>{throw new Error("Invalid change accessor")};let Za=Fu=class extends K{static resolveOptions(e,t){if(t.detectIndentation){const i=a7(e,t.tabSize,t.insertSpaces);return new Oy({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Oy(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return ur(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Mye(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new Rye),this._languageSelectionListener=this._register(new Qr),this._deltaDecorationCallCnt=0,this._attachedViews=new Pye,Nw++,this.id="$model"+Nw,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=$e.parse("inmemory://model/"+Nw):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=_7(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=Fu.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Nwe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new S1e(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Rwe(this)),this._tokenizationTextModelPart=new LS(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new N(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>Fu.LARGE_FILE_SIZE_THRESHOLD||u>Fu.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>Fu.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>Fu._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=M$(Nw),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new b7,this._commandManager=new K4(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cp([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=K.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Rh(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Kl();const{textBuffer:t,disposable:i}=_7(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new b7,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new dp([new vye],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=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=xye(this._tmpLineStarts,e);this.chunks.push(new Ju(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=pb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Y$(e)))}finish(e=!0){return this._finish(),new Eye(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=bl(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Iye{constructor(e){this._default=e,this._store=[]}get(e){return 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 s=this._store.slice(0,e),o=this._store.slice(e+t),r=Aye(i,this._default);this._store=s.concat(r,o)}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 s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new Tye(e,[t]))}finalize(){return this._tokens}}class Nye{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new fT(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Mye extends Nye{constructor(e,t,i,s){super(e,t),this._textModel=i,this._languageIdCodec=s}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>t)break;const o=this._textModel.getLineContent(s.lineNumber),r=h0(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=h0(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new on(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(s,0),d=h0(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new on(d.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class Pye{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Ye(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Ye(i.start,e):this._ranges.splice(t,1,new Ye(i.start,e),new Ye(e+1,i.endExclusive))}}addRange(e){Ye.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function h0(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){pt(a)}return r||(r=M4(n.encodeLanguageId(e),o)),on.convertToEndOffset(r.tokens,i.length),r}class Oye{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Xc(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Qe(e,t))}}const vl=new Uint32Array(0).buffer;class ba{static deleteBeginning(e,t){return e===null||e===vl?e:ba.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===vl)return e;const i=Bl(e),s=i[i.length-2];return ba.delete(e,t,s)}static delete(e,t,i){if(e===null||e===vl||t===i)return e;const s=Bl(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return vl;const r=on.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,l=s[r<<1];if(id&&(s[c++]=g,s[c++]=s[(f<<1)+1],d=g)}if(c===s.length)return e;const h=new Uint32Array(c);return h.set(s.subarray(0,c),0),h.buffer}static append(e,t){if(t===vl)return e;if(e===vl)return t;if(e===null)return e;if(t===null)return null;const i=Bl(e),s=Bl(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=on.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let s=null;if(t1&&(o=zs.getLanguageId(s[1])!==e),!o)return vl}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=E7(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ba.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ba.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=ba.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=ba.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=ba.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class cP{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){s=s||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=CL(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=cP._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const c=[];let d=0,u=0;const h=(f,g)=>{f!==u&&(u=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,b=~v>>>0;for(;lt)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class IS extends zj{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new cP(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Fye(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=of(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new $i("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=IS._findLanguageBoundaries(s,o),l=db(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[c,d]=IS._findLanguageBoundaries(s,o-1),u=db(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new Bye(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new fT(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=yi.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return pt(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new Mye(this._textModel.getLineCount(),s,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};s&&s.createBackgroundTokenizer&&!s.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,r)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Oye(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new jb(this._languageIdCodec),this._debugBackgroundStates=new fT(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=of(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Qe.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,s;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new hT,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.checkFinished()}forceTokenization(e){var t,i;const s=new hT;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(s,e),this.setTokens(s.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),s=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!s.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return s}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new H(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class Bye extends Y{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new xi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ki(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class Wye{constructor(){this.changeType=1}}class ia{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new ia(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new ia(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}}class I7{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Vye{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Hye{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class zye{constructor(){this.changeType=5}}class up{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},y2=function(n,e){return function(t,i){e(t,i,n)}},zu;function Uye(n){const e=new rq;return e.acceptChunk(n),e.finish()}function jye(n){const e=new rq;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function A7(n,e){let t;return typeof n=="string"?t=Uye(n):Rme(n)?t=jye(n):t=n,t.create(e)}let Ww=0;const qye=999,Gye=1e4;class Kye{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const f0=()=>{throw new Error("Invalid change accessor")};let Za=zu=class extends Y{static resolveOptions(e,t){if(t.detectIndentation){const i=w7(e,t.tabSize,t.insertSpaces);return new $y({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new $y(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return ur(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Jye(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new eCe),this._languageSelectionListener=this._register(new Jr),this._deltaDecorationCallCnt=0,this._attachedViews=new tCe,Ww++,this.id="$model"+Ww,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=je.parse("inmemory://model/"+Ww):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=A7(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=zu.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Qwe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new $1e(this,this._languageConfigurationService)),this._decorationProvider=this._register(new eye(this)),this._tokenizationTextModelPart=new IS(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new N(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>zu.LARGE_FILE_SIZE_THRESHOLD||u>zu.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>zu.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>zu._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Z$(Ww),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new T7,this._commandManager=new oP(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new dp([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Y.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Ph(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Xl();const{textBuffer:t,disposable:i}=A7(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new T7,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new up([new Wye],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,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(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new dp([new Cye],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}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 s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=kye?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Oy({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,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=a7(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),bj(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(T$.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.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $i("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new Eye(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $i("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}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 u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&s===r&&a===c&&l===d&&e instanceof N&&!(e instanceof lt)?e:new N(o,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 s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(tn(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new V(1,1);if(s>r)return new V(r,this.getLineMaxColumn(r));if(o<=1)return new V(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new V(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(tn(l))return new V(s,o-1)}return new V(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof V&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=tn(a),d=tn(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof N&&!(e instanceof lt)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=s.lineNumber,l=s.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=tn(c),h=tn(d);return!u&&!h?new N(o,r,a,l):o===a&&r===l?new N(o,r-1,a,l-1):u&&h?new N(o,r-1,a,l+1):u?new N(o,r-1,a,l):new N(o,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 N(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=Dye){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>N.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>N.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(` -`)<0){const h=new Ou(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>bw.findMatches(this,new Ou(e,i,s,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` -`)<0){const c=new Ou(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new N(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return bw.findNextMatch(this,new Ou(e,i,s,o),a,r),h.length>0||(u=new N(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return bw.findNextMatch(this,new Ou(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return bw.findPreviousMatch(this,new Ou(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Yk?e:new Yk(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,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new up([new zye],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}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 s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=Gye?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new $y({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,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=w7(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Pj(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(K$.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.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $i("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new Kye(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new $i("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new $i("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}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 u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&s===r&&a===c&&l===d&&e instanceof N&&!(e instanceof lt)?e:new N(o,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 s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(tn(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new H(1,1);if(s>r)return new H(r,this.getLineMaxColumn(r));if(o<=1)return new H(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new H(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(tn(l))return new H(s,o-1)}return new H(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof H&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=tn(a),d=tn(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof N&&!(e instanceof lt)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=s.lineNumber,l=s.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=tn(c),h=tn(d);return!u&&!h?new N(o,r,a,l):o===a&&r===l?new N(o,r-1,a,l-1):u&&h?new N(o,r-1,a,l+1):u?new N(o,r-1,a,l):new N(o,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 N(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=qye){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>N.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>N.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(` +`)<0){const h=new Hu(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>Lw.findMatches(this,new Hu(e,i,s,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const c=new Hu(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new N(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return Lw.findNextMatch(this,new Hu(e,i,s,o),a,r),h.length>0||(u=new N(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return Lw.findNextMatch(this,new Hu(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Lw.findPreviousMatch(this,new Hu(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof t2?e:new t2(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,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){u=!1;break}}if(u){const h=new N(c,1,c,d);t.push(new Yk(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;k--){const O=f+k,R=w+k;D.takeFromEndWhile(M=>M.lineNumber>R);const P=D.takeFromEndWhile(M=>M.lineNumber===R);a.push(new m7(O,this.getLineContent(R),P))}if(vce.lineNumberce.lineNumber===ne)}a.push(new yye(O+1,f+_,$,M))}l+=b}this._emitContentChangedEvent(new dp(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 s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new m7(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new Uj(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:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,w7(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){pt(o)}return i.addDecoration=u0,i.changeDecoration=u0,i.changeDecorationOptions=u0,i.removeDecoration=u0,i.deltaDecorations=u0,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),pt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:v7[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(v7[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new N(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return fI(u,this._decorationProvider.getDecorationsInRange(d,i,s)),u}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return fI(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return ta.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}s!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return Iye(this.getLineContent(e))+1}};Za._MODEL_SYNC_LIMIT=50*1024*1024;Za.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Za.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Za.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Za.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:An.tabSize,indentSize:An.indentSize,insertSpaces:An.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:An.trimAutoWhitespace,largeFileOptimizations:An.largeFileOptimizations,bracketPairColorizationOptions:An.bracketPairColorizationOptions};Za=Fu=Sye([p2(4,QL),p2(5,ki),p2(6,no)],Za);function Iye(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function m2(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function _2(n){return!!n.options.after||!!n.options.before}class b7{constructor(){this._decorationsTree0=new h2,this._decorationsTree1=new h2,this._injectedTextDecorationsTree=new h2}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),l=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){_2(e)?this._injectedTextDecorationsTree.insert(e):m2(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){_2(e)?this._injectedTextDecorationsTree.delete(e):m2(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){_2(e)?this._injectedTextDecorationsTree.resolveNode(e,t):m2(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function dl(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class qj{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Aye extends qj{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Uo.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Tye{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:ip.Left}}class Nye extends qj{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?H.fromHex(e):t.getColor(e.id)}}class lm{static from(e){return e instanceof lm?e:new lm(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Qe{static register(e){return new Qe(e)}static createDynamic(e){return new Qe(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?dl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(s=e.blockPadding)!==null&&s!==void 0?s:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?dl(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Aye(e.overviewRuler):null,this.minimap=e.minimap?new Nye(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Tye(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?dl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?dl(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?dl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?dl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?dl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?dl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?dl(e.afterContentClassName):null,this.after=e.after?lm.from(e.after):null,this.before=e.before?lm.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Qe.EMPTY=Qe.register({description:"empty"});const v7=[Qe.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Qe.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Qe.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Qe.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function w7(n){return n instanceof Qe?n:Qe.createDynamic(n)}class Mye extends K{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Rye extends K{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class Pye{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Oye(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class Oye{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Ze(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class DS{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new hn(new N(1,1,1,1),0,0,new V(1,1),0),new hn(new N(1,1,1,1),0,0,new V(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new ot(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?lt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):lt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,r),l=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(l)?t:new hn(N.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=DS._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new hn(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new hn(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new hn(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new N(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new hn(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class y7{constructor(e){this.context=e,this.cursors=[new DS(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Eme(this.cursors,cr(e=>e.viewState.position,V.compare)).viewState.position}getBottomMostViewPosition(){return kme(this.cursors,cr(e=>e.viewState.position,V.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(ot.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,N.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class C7{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class Fye{constructor(){this.type=0}}class Bye{constructor(){this.type=1}}class Wye{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Vye{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class rg{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class Mw{constructor(){this.type=5}}class Hye{constructor(e){this.type=6,this.isFocused=e}}class zye{constructor(){this.type=7}}class Rw{constructor(){this.type=8}}class Gj{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class sT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class oT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class jy{constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class $ye{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Uye{constructor(e){this.theme=e,this.type=14}}class jye{constructor(e){this.type=15,this.ranges=e}}class qye{constructor(){this.type=16}}let Gye=class{constructor(){this.type=17}};class Kye extends K{constructor(){super(),this._onEvent=this._register(new B),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Yye{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class J4{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new J4(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class eP{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new eP(this.oldHasFocus,e.hasFocus)}}class tP{constructor(e,t,i,s,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new tP(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Zye{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Xye{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class kS{constructor(e,t,i,s,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=v_.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=N.fromPositions(a[0],a[0]),e.emitViewEvent(new jy(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=ot.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,ot.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,ot.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=v_.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Vye(l,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(s.cursorState[d].modelState))){const c=s?s.cursorState.map(u=>u.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new kS(c,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const o=v_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){pt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return S7.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new w_(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(di.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 s=t.length;let o=0;for(;o{const c=l.getPosition();return new lt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(di.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(di.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(sf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new bs(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new bs(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class v_{static from(e,t){return new v_(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=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class rCe{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{const d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(d[f].sort(u),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{const p=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new lt(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new lt(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{N.isEmpty(u)&&h===""||s.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(u,h,f)=>{a=!0,r(u,h,f)},trackSelection:(u,h)=>{const f=lt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return pt(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-N.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class aCe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class w_{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new aCe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=w_._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=w_._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oxb,tokenizeEncoded:(n,e,t)=>C4(0,t)};function cCe(n,e,t){return lCe(this,void 0,void 0,function*(){if(!t)return L7(e,n.languageIdCodec,x7);const i=yield vi.getOrCreate(t);return L7(e,n.languageIdCodec,i||x7)})}function dCe(n,e,t,i,s,o,r){let a="
",l=i,c=0,d=!0;for(let u=0,h=e.getCount();u0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>s||l>=s)break}return a+="
",a}function L7(n,e,t){let i='
';const s=xf(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);on.convertToEndOffset(c.tokens,l.length);const u=new on(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${YC(l.substring(h,_))}`,h=_}o=c.endState}return i+="
",i}class uCe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class hCe{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}let Kj=class rT{constructor(e,t,i,s){this._instanceId=M$(++rT.INSTANCE_COUNT),this._pendingChanges=new uCe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new hCe(l,s,o,r,a)),l},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const s=new Set;for(const l of i)s.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!s.has(d.id)){if(o.has(d.id)){const u=o.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=rT.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const p=[],_=e+(t-e)/2;let v=-1;for(let S=s;S<=r;S++){if(v===-1){const L=u,x=u+i;(L<=_&&__)&&(v=S)}for(u+=i,p[S-s]=h,h+=i;d===S;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=S;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let w=s,y=r;return wt&&y--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:y}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};Kj.INSTANCE_COUNT=0;const fCe=125;class z0{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class gCe extends K{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new z0(0,0,0,0),this._scrollable=this._register(new v1({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new J4(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class pCe extends K{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new Kj(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new gCe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new z0(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?fCe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new z0(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(102);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(104)?o+=Math.max(0,t-s.get(66)-s.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new z0(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new g9(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new g9(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),s=e.get(50),o=e.get(143);if(i.isViewportWrapping){const r=e.get(72);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(103)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new z0(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class mCe{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new N(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new HU(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new N(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,UC(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let d=o;d<=r;d++)c[d-o]=[];for(let d=0,u=s.length;dt===1)}function vCe(n,e){return Yj(n,e.range,t=>t===2)}function Yj(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function b2(n,e){return n===null?e?ES.INSTANCE:IS.INSTANCE:new wCe(n,e)}class wCe{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new ta(0,0,c+1,this._projectionData.injectionOptions[d],0));r=ta.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=D7(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,b=l.breakOffsets[p];for(;gb)break;if(v0?l.wrappedTextIndentLength:0,D=x+Math.max(y-v,0),k=x+Math.min(S-v,b-v);D!==k&&_.push(new D0e(D,k,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=w,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:on.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],l=e.sliceAndInflate(r,a,o);let c=l.getLineContent();i>0&&(c=D7(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=v2.length)for(let e=1;e<=n;e++)v2[e]=yCe(e);return v2[n]}function yCe(n){return new Array(n+1).join(" ")}class CCe{constructor(e,t,i,s,o,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new xCe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new sc(ta.fromDecorations(s));for(let p=0;pv.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(N.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=b2(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new ome(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=SCe(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(N.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:Qe.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&l&&c&&d)return!1;const u=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=s.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new k7(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=d;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new dh(f.visibleColumn,g,f.className,new h_(f.horizontalLine.top,p.column),-1,-1):_.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],l=i.lineNumber-1,c=s.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let w=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(w=_===0?1:2),r.push(b),a.push(w),d===null&&(d=new V(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),u.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),c=a.getViewLineMaxColumn(this.model,o+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new V(o+1,d)).equals(i)?new V(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new N(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new V(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new N(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new V(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new V(s?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return N.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new N(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let l=[];const c=r.lineNumber-1,d=a.lineNumber-1;let u=null;for(let p=c;p<=d;p++)if(this.modelLineProjections[p].isVisible())u===null&&(u=new V(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=N.compareRangesUsingStarts(p.range,_.range);return v===0?p.id<_.id?-1:p.id>_.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const _=p.id;g!==_&&(g=_,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function SCe(n){if(n.length===0)return[];const e=n.slice();e.sort(N.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new N(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new N(i,1,s,1)),t}class k7{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class E7{constructor(e,t){this.modelRange=e,this.viewLines=t}}class xCe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class LCe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new DCe(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new sT(t,i)}onModelLinesInserted(e,t,i,s){return new oT(t,i)}onModelLineChanged(e,t,i){return[!1,new Gj(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}let kCe=class extends K{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new ICe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new Kye,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Ci(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=iP.create(this.model),this.model.isTooLargeForTokenization())this._lines=new LCe(this.model);else{const d=this._configuration.options,u=d.get(50),h=d.get(137),f=d.get(144),g=d.get(136),p=d.get(128);this._lines=new CCe(this._editorId,this.model,s,o,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new oCe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new pCe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new $ye(d)),this._eventDispatcher.emitOutgoingEvent(new tP(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new mCe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(S1.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new qye)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Uye(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new N(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Hye(e)),this._eventDispatcher.emitOutgoingEvent(new eP(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Fye)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Bye)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new V(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new A7(t,this._viewportStart.startLineDelta)}return new A7(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(50),r=s.get(137),a=s.get(144),l=s.get(136),c=s.get(128);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new Mw),e.emitViewEvent(new Rw),e.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new rg(null))),e.emitViewEvent(new Wye(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),ig.shouldRecreate(t)&&(this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof Rh?e.rawContentChangedEvent.changes:e.changes,a=e instanceof Rh?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const c=l.finalize(),d=new sc(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new Mw),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),s=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 2:{const h=d.dequeue(),[f,g,p,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=f,g&&i.emitViewEvent(g),p&&(i.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new Rw),i.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof Rh&&i.emitOutgoingEvent(new iCe(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new zye),this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new tCe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new eCe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new Mw),t.emitViewEvent(new Rw),t.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new nCe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new rg(e)),this._eventDispatcher.emitOutgoingEvent(new Jye(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new Mw),r.emitViewEvent(new Rw),r.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new Xye)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new N(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Ks(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Lf(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new ko(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new L0e(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,UC(this._configuration.options)),i=new ECe;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,o.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const s=t.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(N.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+s);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}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===Vo||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new N(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Wo.fontFamily;let c;return l?c=Wo.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Wo.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(s,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?s-1:0,f=c===o?r-1:u.length;u===""?l+="
":l+=dCe(u,d.inflate(),t,h,f,a,Rs)}return l}_getColorMap(){const e=vi.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,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(s=>this._cursor.setSelections(s,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 Qye);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,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,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new jy(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new jy(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new jy(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Gye),this._eventDispatcher.emitOutgoingEvent(new Zye))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class iP{static create(e){const t=e._setTrackedRange(null,new N(1,1,1,1),1);return new iP(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new V(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new N(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class ECe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){s>c&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new Lb(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class ICe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&I7(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>ACe(t,i),[]);return I7(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function ACe(n,e){const t=[];let i=0,s=0;for(;i0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===0)if(e<=r)s=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Pw(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new Pw(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&T7(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(N7(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(T7(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,N7(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===1||t===4){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}c4()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function T7(n){return n==null?!0:n===em.Right||n===em.Both}function N7(n){return n==null?!0:n===em.Left||n===em.Both}class Pw{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new V(e+this.outputLineIndex,this.outputOffset+1)}}class nP{static create(e){return new nP(e.get(132),e.get(131))}constructor(e,t){this.classifier=new NCe(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],l=[];return{addRequest:(c,d,u)=>{r.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=r.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let aT=[],lT=[];function MCe(n,e,t,i,s,o,r,a){if(s===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=Xj(t,i,s,o,r),f=s-h,g=aT,p=lT;let _=0,v=0,b=0,w=s;const y=d.length;let S=0;if(S>=0){let L=Math.abs(u[S]-w);for(;S+1=L)break;L=x,S++}}for(;SL&&(L=v,x=b);let D=0,k=0,O=0,R=0;if(x<=w){let M=x,$=L===0?0:t.charCodeAt(L-1),Y=L===0?0:n.get($),ne=!0;for(let ce=L;cev&&cT($,Y,se,Se,c)&&(D=ge,k=M),M+=Ie,M>w){ge>v?(O=ge,R=M-Ie):(O=ce+1,R=M),M-k>f&&(D=0),ne=!1;break}$=se,Y=Se}if(ne){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(D===0){let M=x,$=t.charCodeAt(L),Y=n.get($),ne=!1;for(let ce=L-1;ce>=v;ce--){const ge=ce+1,se=t.charCodeAt(ce);if(se===9){ne=!0;break}let Se,Ie;if(Gp(se)?(ce--,Se=0,Ie=2):(Se=n.get(se),Ie=Wd(se)?o:1),M<=w){if(O===0&&(O=ge,R=M),M<=w-f)break;if(cT(se,Se,$,Y,c)){D=ge,k=M;break}}M-=Ie,$=se,Y=Se}if(D!==0){const ce=f-(R-k);if(ce<=i){const ge=t.charCodeAt(O);let se;tn(ge)?se=2:se=C_(ge,R,i,o),ce-se<0&&(D=0)}}if(ne){S--;continue}}if(D===0&&(D=O,k=R),D<=v){const M=t.charCodeAt(v);tn(M)?(D=v+2,k=b+2):(D=v+1,k=b+C_(M,b,i,o))}for(v=D,g[_]=D,b=k,p[_]=k,_++,w=k+f;S<0||S=P)break;P=M,S++}}return _===0?null:(g.length=_,p.length=_,aT=e.breakOffsets,lT=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function RCe(n,e,t,i,s,o,r,a){const l=ta.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),s===-1)return c?new y_(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new y_(d,c,[l.length],[],0):null;const h=a==="keepAll",f=Xj(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,w=0,y=s,S=l.charCodeAt(0),L=n.get(S),x=C_(S,0,i,o),D=1;tn(S)&&(x+=1,S=l.charCodeAt(1),L=n.get(S),D++);for(let k=D;ky&&((b===0||x-w>g)&&(b=O,w=x-M),p[v]=b,_[v]=w,v++,y=w+g,b=0),S=R,L=P}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=x,new y_(d,c,p,_,f))}function C_(n,e,t,i){return n===9?t-e%t:Wd(n)||n<32?i:1}function M7(n,e){return e-n%e}function cT(n,e,t,i,s){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!s&&e===3&&i!==2||!s&&i===3&&e!==1)}function Xj(n,e,t,i,s){let o=0;if(s!==0){const r=Ks(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const w2=If("domLineBreaksComputer",{createHTML:n=>n});class sP{static create(){return new sP}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>PCe(r,e,t,i,s,o,a)}}}function PCe(n,e,t,i,s,o,r){var a;function l(k){const O=r[k];if(O){const R=ta.applyInjectedText(n[k],O),P=O.map($=>$.options),M=O.map($=>$.column-1);return new y_(M,P,[R.length],[],0)}else return null}if(i===-1){const k=[];for(let O=0,R=n.length;Oc?(R=0,P=0):M=c-ne}const $=O.substr(R),Y=OCe($,P,t,M,g,h);p[k]=R,_[k]=P,v[k]=$,b[k]=Y[0],w[k]=Y[1]}const y=g.build(),S=(a=w2==null?void 0:w2.createHTML(y))!==null&&a!==void 0?a:y;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const L=document.createRange(),x=Array.prototype.slice.call(f.children,0),D=[];for(let k=0;kse.options),ce=ge.map(se=>se.column-1)):(ne=null,ce=null),D[k]=new y_(ce,ne,R,Y,M)}return document.body.removeChild(f),D}function OCe(n,e,t,i,s,o){if(o!==0){const h=String(o);s.appendString('
');const r=n.length;let a=e,l=0;const c=[],d=[];let u=0");for(let h=0;h"),c[h]=l,d[h]=a;const f=u;u=h+1"),c[n.length]=l,d[n.length]=a,s.appendString("
"),[c,d]}function FCe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{dT(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function dT(n,e,t,i,s,o,r,a){if(i===o||(s=s||y2(n,e,t[i],t[i+1]),r=r||y2(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=y2(n,e,t[l],t[l+1]);dT(n,e,t,i,s,l,c,a),dT(n,e,t,l,c,o,r,a)}function y2(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class BCe extends K{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new qR),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){pt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(Kc(()=>{this._instantiateSome(1)})),this._register(Kc(()=>{this._instantiateSome(2)})),this._register(Kc(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Kc(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){pt(i)}}}}var WCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ul=function(n,e){return function(t,i){e(t,i,n)}},VCe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Bu;let HCe=0,zCe=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){Pt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},cm=Bu=class extends K{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,s,o,r,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=khe(),this._contributions=this._register(new BCe),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new R7({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new R7({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new zn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new zn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new zn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new zn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++HCe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(143)){const w=b.get(143);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new $Ce(this,this._contextKeyService)),this._register(new UCe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new JL([Je,this._contextKeyService])),this._modelData=null,this._focusTracker=new jCe(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=Jg.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of Jg.getEditorActions()){if(this._actions.has(v.id)){pt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new Ij(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(w=>Promise.resolve(v.runEditorCommand(w,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new qge(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!_())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:v=>VCe(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new BA(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return VL.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?_i.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` +`)){u=!1;break}}if(u){const h=new N(c,1,c,d);t.push(new t2(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;k--){const P=f+k,O=w+k;D.takeFromEndWhile(M=>M.lineNumber>O);const R=D.takeFromEndWhile(M=>M.lineNumber===O);a.push(new I7(P,this.getLineContent(O),R))}if(vce.lineNumberce.lineNumber===ne)}a.push(new Hye(P+1,f+_,W,M))}l+=b}this._emitContentChangedEvent(new up(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 s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new I7(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new aq(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:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,M7(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){pt(o)}return i.addDecoration=f0,i.changeDecoration=f0,i.changeDecorationOptions=f0,i.removeDecoration=f0,i.deltaDecorations=f0,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),pt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:N7[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(N7[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new N(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return SI(u,this._decorationProvider.getDecorationsInRange(d,i,s)),u}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return SI(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return ia.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}s!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return Yye(this.getLineContent(e))+1}};Za._MODEL_SYNC_LIMIT=50*1024*1024;Za.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Za.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Za.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Za.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:An.tabSize,indentSize:An.indentSize,insertSpaces:An.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:An.trimAutoWhitespace,largeFileOptimizations:An.largeFileOptimizations,bracketPairColorizationOptions:An.bracketPairColorizationOptions};Za=zu=$ye([y2(4,rD),y2(5,Ii),y2(6,no)],Za);function Yye(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function C2(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function S2(n){return!!n.options.after||!!n.options.before}class T7{constructor(){this._decorationsTree0=new b2,this._decorationsTree1=new b2,this._injectedTextDecorationsTree=new b2}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),l=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){S2(e)?this._injectedTextDecorationsTree.insert(e):C2(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){S2(e)?this._injectedTextDecorationsTree.delete(e):C2(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){S2(e)?this._injectedTextDecorationsTree.resolveNode(e,t):C2(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function dl(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class cq{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Zye extends cq{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Uo.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Xye{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:np.Left}}class Qye extends cq{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?z.fromHex(e):t.getColor(e.id)}}class dm{static from(e){return e instanceof dm?e:new dm(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class et{static register(e){return new et(e)}static createDynamic(e){return new et(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?dl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(s=e.blockPadding)!==null&&s!==void 0?s:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?dl(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Zye(e.overviewRuler):null,this.minimap=e.minimap?new Qye(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Xye(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?dl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?dl(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?dl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?dl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?dl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?dl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?dl(e.afterContentClassName):null,this.after=e.after?dm.from(e.after):null,this.before=e.before?dm.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}et.EMPTY=et.register({description:"empty"});const N7=[et.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),et.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),et.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),et.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function M7(n){return n instanceof et?n:et.createDynamic(n)}class Jye extends Y{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class eCe extends Y{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class tCe{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new iCe(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class iCe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Qe(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class AS{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new hn(new N(1,1,1,1),0,0,new H(1,1),0),new hn(new N(1,1,1,1),0,0,new H(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new ot(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?lt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):lt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,r),l=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(l)?t:new hn(N.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=AS._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new hn(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new hn(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new hn(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new H(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new H(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new N(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new hn(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class R7{constructor(e){this.context=e,this.cursors=[new AS(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Kme(this.cursors,cr(e=>e.viewState.position,H.compare)).viewState.position}getBottomMostViewPosition(){return Gme(this.cursors,cr(e=>e.viewState.position,H.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(ot.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,N.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class P7{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class nCe{constructor(){this.type=0}}class sCe{constructor(){this.type=1}}class oCe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class rCe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class rg{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class Vw{constructor(){this.type=5}}class aCe{constructor(e){this.type=6,this.isFocused=e}}class lCe{constructor(){this.type=7}}class Hw{constructor(){this.type=8}}class dq{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class gT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class pT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class Qy{constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class cCe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class dCe{constructor(e){this.theme=e,this.type=14}}class uCe{constructor(e){this.type=15,this.ranges=e}}class hCe{constructor(){this.type=16}}let fCe=class{constructor(){this.type=17}};class gCe extends Y{constructor(){super(),this._onEvent=this._register(new B),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class pCe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class dP{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new dP(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class uP{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new uP(this.oldHasFocus,e.hasFocus)}}class hP{constructor(e,t,i,s,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new hP(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class mCe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class _Ce{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class TS{constructor(e,t,i,s,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=y_.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=N.fromPositions(a[0],a[0]),e.emitViewEvent(new Qy(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=ot.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,ot.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,ot.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=y_.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new rCe(l,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(s.cursorState[d].modelState))){const c=s?s.cursorState.map(u=>u.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new TS(c,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const o=y_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){pt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return O7.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new C_(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(ui.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 s=t.length;let o=0;for(;o{const c=l.getPosition();return new lt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(ui.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(ui.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(sf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new _s(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new _s(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class y_{static from(e,t){return new y_(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=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class DCe{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{const d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(d[f].sort(u),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{const p=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new lt(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new lt(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{N.isEmpty(u)&&h===""||s.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(u,h,f)=>{a=!0,r(u,h,f)},trackSelection:(u,h)=>{const f=lt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return pt(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-N.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class kCe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class C_{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new kCe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=C_._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=C_._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oDb,tokenizeEncoded:(n,e,t)=>M4(0,t)};function ICe(n,e,t){return ECe(this,void 0,void 0,function*(){if(!t)return B7(e,n.languageIdCodec,F7);const i=yield yi.getOrCreate(t);return B7(e,n.languageIdCodec,i||F7)})}function ACe(n,e,t,i,s,o,r){let a="
",l=i,c=0,d=!0;for(let u=0,h=e.getCount();u0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>s||l>=s)break}return a+="
",a}function B7(n,e,t){let i='
';const s=xf(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);on.convertToEndOffset(c.tokens,l.length);const u=new on(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${JC(l.substring(h,_))}`,h=_}o=c.endState}return i+="
",i}class TCe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class NCe{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}let uq=class mT{constructor(e,t,i,s){this._instanceId=Z$(++mT.INSTANCE_COUNT),this._pendingChanges=new TCe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new NCe(l,s,o,r,a)),l},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const s=new Set;for(const l of i)s.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!s.has(d.id)){if(o.has(d.id)){const u=o.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=mT.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const p=[],_=e+(t-e)/2;let v=-1;for(let S=s;S<=r;S++){if(v===-1){const L=u,x=u+i;(L<=_&&__)&&(v=S)}for(u+=i,p[S-s]=h,h+=i;d===S;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=S;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let w=s,y=r;return wt&&y--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:y}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};uq.INSTANCE_COUNT=0;const MCe=125;class U0{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class RCe extends Y{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new U0(0,0,0,0),this._scrollable=this._register(new D1({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new dP(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class PCe extends Y{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new uq(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new RCe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new U0(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?MCe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new U0(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(102);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(104)?o+=Math.max(0,t-s.get(66)-s.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new U0(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new k9(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new k9(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),s=e.get(50),o=e.get(143);if(i.isViewportWrapping){const r=e.get(72);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(103)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new U0(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class OCe{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new H(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new H(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new N(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new sj(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new N(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,KC(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let d=o;d<=r;d++)c[d-o]=[];for(let d=0,u=s.length;dt===1)}function WCe(n,e){return hq(n,e.range,t=>t===2)}function hq(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function x2(n,e){return n===null?e?NS.INSTANCE:MS.INSTANCE:new VCe(n,e)}class VCe{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new ia(0,0,c+1,this._projectionData.injectionOptions[d],0));r=ia.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=W7(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,b=l.breakOffsets[p];for(;gb)break;if(v0?l.wrappedTextIndentLength:0,D=x+Math.max(y-v,0),k=x+Math.min(S-v,b-v);D!==k&&_.push(new q0e(D,k,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=w,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:on.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],l=e.sliceAndInflate(r,a,o);let c=l.getLineContent();i>0&&(c=W7(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=L2.length)for(let e=1;e<=n;e++)L2[e]=HCe(e);return L2[n]}function HCe(n){return new Array(n+1).join(" ")}class zCe{constructor(e,t,i,s,o,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new UCe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new ac(ia.fromDecorations(s));for(let p=0;pv.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(N.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=x2(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Lme(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=$Ce(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(N.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:et.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&l&&c&&d)return!1;const u=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=s.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new V7(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new H(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new H(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=d;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new gh(f.visibleColumn,g,f.className,new g_(f.horizontalLine.top,p.column),-1,-1):_.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],l=i.lineNumber-1,c=s.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let w=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(w=_===0?1:2),r.push(b),a.push(w),d===null&&(d=new H(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),u.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),c=a.getViewLineMaxColumn(this.model,o+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new H(o+1,d)).equals(i)?new H(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new N(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new H(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new N(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new H(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new H(s?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return N.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new N(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let l=[];const c=r.lineNumber-1,d=a.lineNumber-1;let u=null;for(let p=c;p<=d;p++)if(this.modelLineProjections[p].isVisible())u===null&&(u=new H(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=N.compareRangesUsingStarts(p.range,_.range);return v===0?p.id<_.id?-1:p.id>_.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const _=p.id;g!==_&&(g=_,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function $Ce(n){if(n.length===0)return[];const e=n.slice();e.sort(N.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new N(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new N(i,1,s,1)),t}class V7{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class H7{constructor(e,t){this.modelRange=e,this.viewLines=t}}class UCe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class jCe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new qCe(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new gT(t,i)}onModelLinesInserted(e,t,i,s){return new pT(t,i)}onModelLineChanged(e,t,i){return[!1,new dq(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}let GCe=class extends Y{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new YCe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new gCe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new xi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=fP.create(this.model),this.model.isTooLargeForTokenization())this._lines=new jCe(this.model);else{const d=this._configuration.options,u=d.get(50),h=d.get(137),f=d.get(144),g=d.get(136),p=d.get(128);this._lines=new zCe(this._editorId,this.model,s,o,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new LCe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new PCe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new cCe(d)),this._eventDispatcher.emitOutgoingEvent(new hP(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new OCe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(A1.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new hCe)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new dCe(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new N(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new aCe(e)),this._eventDispatcher.emitOutgoingEvent(new uP(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new nCe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new sCe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new H(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new $7(t,this._viewportStart.startLineDelta)}return new $7(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(50),r=s.get(137),a=s.get(144),l=s.get(136),c=s.get(128);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new Vw),e.emitViewEvent(new Hw),e.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new rg(null))),e.emitViewEvent(new oCe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),ig.shouldRecreate(t)&&(this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof Ph?e.rawContentChangedEvent.changes:e.changes,a=e instanceof Ph?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const c=l.finalize(),d=new ac(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new Vw),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),s=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 2:{const h=d.dequeue(),[f,g,p,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=f,g&&i.emitViewEvent(g),p&&(i.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new Hw),i.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof Ph&&i.emitOutgoingEvent(new CCe(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new lCe),this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new yCe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new wCe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new Vw),t.emitViewEvent(new Hw),t.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new ig(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new SCe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new rg(e)),this._eventDispatcher.emitOutgoingEvent(new vCe(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new Vw),r.emitViewEvent(new Hw),r.emitViewEvent(new rg(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new _Ce)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new N(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Gs(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Lf(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Do(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new j0e(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,KC(this._configuration.options)),i=new KCe;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,o.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const s=t.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(N.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+s);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}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===Vo||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new N(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Wo.fontFamily;let c;return l?c=Wo.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Wo.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(s,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?s-1:0,f=c===o?r-1:u.length;u===""?l+="
":l+=ACe(u,d.inflate(),t,h,f,a,Ms)}return l}_getColorMap(){const e=yi.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,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(s=>this._cursor.setSelections(s,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 bCe);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,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,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new Qy(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new Qy(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new Qy(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new fCe),this._eventDispatcher.emitOutgoingEvent(new mCe))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class fP{static create(e){const t=e._setTrackedRange(null,new N(1,1,1,1),1);return new fP(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new H(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new N(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class KCe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){s>c&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new kb(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class YCe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&z7(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>ZCe(t,i),[]);return z7(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function ZCe(n,e){const t=[];let i=0,s=0;for(;i0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===0)if(e<=r)s=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new zw(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new zw(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&U7(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(j7(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(U7(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,j7(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===1||t===4){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}w4()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function U7(n){return n==null?!0:n===im.Right||n===im.Both}function j7(n){return n==null?!0:n===im.Left||n===im.Both}class zw{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new H(e+this.outputLineIndex,this.outputOffset+1)}}class gP{static create(e){return new gP(e.get(132),e.get(131))}constructor(e,t){this.classifier=new QCe(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],l=[];return{addRequest:(c,d,u)=>{r.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=r.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let _T=[],bT=[];function JCe(n,e,t,i,s,o,r,a){if(s===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=gq(t,i,s,o,r),f=s-h,g=_T,p=bT;let _=0,v=0,b=0,w=s;const y=d.length;let S=0;if(S>=0){let L=Math.abs(u[S]-w);for(;S+1=L)break;L=x,S++}}for(;SL&&(L=v,x=b);let D=0,k=0,P=0,O=0;if(x<=w){let M=x,W=L===0?0:t.charCodeAt(L-1),G=L===0?0:n.get(W),ne=!0;for(let ce=L;cev&&vT(W,G,se,Se,c)&&(D=ge,k=M),M+=Ie,M>w){ge>v?(P=ge,O=M-Ie):(P=ce+1,O=M),M-k>f&&(D=0),ne=!1;break}W=se,G=Se}if(ne){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(D===0){let M=x,W=t.charCodeAt(L),G=n.get(W),ne=!1;for(let ce=L-1;ce>=v;ce--){const ge=ce+1,se=t.charCodeAt(ce);if(se===9){ne=!0;break}let Se,Ie;if(Yp(se)?(ce--,Se=0,Ie=2):(Se=n.get(se),Ie=Ud(se)?o:1),M<=w){if(P===0&&(P=ge,O=M),M<=w-f)break;if(vT(se,Se,W,G,c)){D=ge,k=M;break}}M-=Ie,W=se,G=Se}if(D!==0){const ce=f-(O-k);if(ce<=i){const ge=t.charCodeAt(P);let se;tn(ge)?se=2:se=x_(ge,O,i,o),ce-se<0&&(D=0)}}if(ne){S--;continue}}if(D===0&&(D=P,k=O),D<=v){const M=t.charCodeAt(v);tn(M)?(D=v+2,k=b+2):(D=v+1,k=b+x_(M,b,i,o))}for(v=D,g[_]=D,b=k,p[_]=k,_++,w=k+f;S<0||S=R)break;R=M,S++}}return _===0?null:(g.length=_,p.length=_,_T=e.breakOffsets,bT=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function eSe(n,e,t,i,s,o,r,a){const l=ia.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),s===-1)return c?new S_(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new S_(d,c,[l.length],[],0):null;const h=a==="keepAll",f=gq(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,w=0,y=s,S=l.charCodeAt(0),L=n.get(S),x=x_(S,0,i,o),D=1;tn(S)&&(x+=1,S=l.charCodeAt(1),L=n.get(S),D++);for(let k=D;ky&&((b===0||x-w>g)&&(b=P,w=x-M),p[v]=b,_[v]=w,v++,y=w+g,b=0),S=O,L=R}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=x,new S_(d,c,p,_,f))}function x_(n,e,t,i){return n===9?t-e%t:Ud(n)||n<32?i:1}function q7(n,e){return e-n%e}function vT(n,e,t,i,s){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!s&&e===3&&i!==2||!s&&i===3&&e!==1)}function gq(n,e,t,i,s){let o=0;if(s!==0){const r=Gs(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const D2=If("domLineBreaksComputer",{createHTML:n=>n});class pP{static create(){return new pP}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>tSe(r,e,t,i,s,o,a)}}}function tSe(n,e,t,i,s,o,r){var a;function l(k){const P=r[k];if(P){const O=ia.applyInjectedText(n[k],P),R=P.map(W=>W.options),M=P.map(W=>W.column-1);return new S_(M,R,[O.length],[],0)}else return null}if(i===-1){const k=[];for(let P=0,O=n.length;Pc?(O=0,R=0):M=c-ne}const W=P.substr(O),G=iSe(W,R,t,M,g,h);p[k]=O,_[k]=R,v[k]=W,b[k]=G[0],w[k]=G[1]}const y=g.build(),S=(a=D2==null?void 0:D2.createHTML(y))!==null&&a!==void 0?a:y;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const L=document.createRange(),x=Array.prototype.slice.call(f.children,0),D=[];for(let k=0;kse.options),ce=ge.map(se=>se.column-1)):(ne=null,ce=null),D[k]=new S_(ce,ne,O,G,M)}return document.body.removeChild(f),D}function iSe(n,e,t,i,s,o){if(o!==0){const h=String(o);s.appendString('
');const r=n.length;let a=e,l=0;const c=[],d=[];let u=0");for(let h=0;h"),c[h]=l,d[h]=a;const f=u;u=h+1"),c[n.length]=l,d[n.length]=a,s.appendString("
"),[c,d]}function nSe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{wT(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function wT(n,e,t,i,s,o,r,a){if(i===o||(s=s||k2(n,e,t[i],t[i+1]),r=r||k2(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=k2(n,e,t[l],t[l+1]);wT(n,e,t,i,s,l,c,a),wT(n,e,t,l,c,o,r,a)}function k2(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class sSe extends Y{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new n4),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){pt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(Xc(()=>{this._instantiateSome(1)})),this._register(Xc(()=>{this._instantiateSome(2)})),this._register(Xc(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Xc(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){pt(i)}}}}var oSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ul=function(n,e){return function(t,i){e(t,i,n)}},rSe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},$u;let aSe=0,lSe=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){Pt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},um=$u=class extends Y{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,s,o,r,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=Ghe(),this._contributions=this._register(new sSe),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new G7({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new G7({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new zn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new zn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new zn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new zn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new zn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new zn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++aSe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(143)){const w=b.get(143);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new cSe(this,this._contextKeyService)),this._register(new dSe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new aD([tt,this._contextKeyService])),this._modelData=null,this._focusTracker=new uSe(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=ep.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of ep.getEditorActions()){if(this._actions.has(v.id)){pt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new qj(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(w=>Promise.resolve(v.runEditorCommand(w,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new hpe(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!_())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:v=>rSe(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new KA(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return KL.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?vi.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` `?i=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const 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,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?Bu._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Bu._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?Bu._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(s=>N.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ui.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(!V.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,s){if(!this._modelData)return;if(!N.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}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 N(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,s){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new N(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=lt.isISelection(e),s=N.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new lt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!N.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(N.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,pt);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,s,e);const l=r.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new N(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=Jg.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,pt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new qCe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,UC(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,UC(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(143),o=Bu._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Mn(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new kCe(this._id,this._configuration,e,sP.create(),nP.create(this._configuration.options),a=>$o(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(79),h=m("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(Zj.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new YL(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new ZA(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),options:Bu.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};cm.dropIntoEditorDecorationOptions=Qe.register({description:"workbench-dnd-target",className:"dnd-target"});cm=Bu=WCe([ul(3,bt),ul(4,zt),ul(5,gs),ul(6,Je),ul(7,oo),ul(8,Ln),ul(9,uu),ul(10,no),ul(11,nt)],cm);class R7 extends K{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class zn extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class $Ce extends K{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=z.editorSimpleInput.bindTo(t),this._editorFocus=z.focus.bindTo(t),this._textInputFocus=z.textInputFocus.bindTo(t),this._editorTextFocus=z.editorTextFocus.bindTo(t),this._tabMovesFocus=z.tabMovesFocus.bindTo(t),this._editorReadonly=z.readOnly.bindTo(t),this._inDiffEditor=z.inDiffEditor.bindTo(t),this._editorColumnSelection=z.columnSelection.bindTo(t),this._hasMultipleSelections=z.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=z.hasNonEmptySelection.bindTo(t),this._canUndo=z.canUndo.bindTo(t),this._canRedo=z.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(hS.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(hS.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class UCe extends K{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=z.languageId.bindTo(t),this._hasCompletionItemProvider=z.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=z.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=z.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=z.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=z.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=z.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=z.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=z.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=z.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=z.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=z.hasReferenceProvider.bindTo(t),this._hasRenameProvider=z.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=z.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=z.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=z.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=z.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=z.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=z.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=z.isInWalkThroughSnippet.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===it.walkThroughSnippet)})}}class jCe extends K{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Vd(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class qCe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const GCe=encodeURIComponent("");function C2(n){return GCe+encodeURIComponent(n.toString())+KCe}const YCe=encodeURIComponent('');function XCe(n){return YCe+encodeURIComponent(n.toString())+ZCe}Sr((n,e)=>{const t=n.getColor(Ma);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${C2(t)}") repeat-x bottom left; }`);const i=n.getColor(wo);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${C2(i)}") repeat-x bottom left; }`);const s=n.getColor(Es);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${C2(s)}") repeat-x bottom left; }`);const o=n.getColor(x_e);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${XCe(o)}") no-repeat bottom left; }`);const r=n.getColor(Ive);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var QCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},JCe=function(n,e){return function(t,i){e(t,i,n)}},eSe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let uT=class extends K{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new ks,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return eSe(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ke(t)}};uT=QCe([JCe(0,oo)],uT);var tSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},P7=function(n,e){return function(t,i){e(t,i,n)}},iSe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let AS=class extends uT{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,s,o)=>iSe(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===it.http||o===it.https)return oU(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};AS=tSe([P7(0,Je),P7(1,oo)],AS);ht(zt,AS,0);const Om=at("layoutService");var Qj=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jj=function(n,e){return function(t,i){e(t,i,n)}};let TS=class{get dimension(){return this._dimension||(this._dimension=AL(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=de.None,this.offset={top:0,quickPickTop:0}}};TS=Qj([Jj(0,zt)],TS);let hT=class extends TS{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};hT=Qj([Jj(1,zt)],hT);ht(Om,TS,1);const eq=at("dialogService");var nSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},O7=function(n,e){return function(t,i){e(t,i,n)}},Ow=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Fw(n){return n.scheme===it.file?n.fsPath:n.path}let tq=0;class Bw{constructor(e,t,i,s,o,r,a){this.id=++tq,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class F7{constructor(e,t){this.resourceLabel=e,this.reason=t}}class B7{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(m({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` -`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class sSe{constructor(e,t,i,s,o,r,a){this.id=++tq,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new B7),this.removedResources.has(t)||this.removedResources.set(t,new F7(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 B7),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new F7(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class iq{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=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,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new jj(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,o=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--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class S2{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof Da){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){pt(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,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),s.dispose(),o()),l=>(r(),s.dispose(),this._onError(l,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return Ow(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return K.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?K.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(K.None);const i=e.actual.prepareUndoRedo();return i?yhe(i)?t(i):i.then(s=>t(s)):t(K.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||nq);return new S2(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new Ww(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new Ww}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return Ow(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:fi.Info,message:m("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=m({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new S2([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Da){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return Ow(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:m("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:m({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:m("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return Ow(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new S2([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderoP(n,t))}function rSe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var aSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},V7=function(n,e){return function(t,i){e(t,i,n)}};const rq=at("ILanguageFeatureDebounceService");var NS;(function(n){const e=new WeakMap;let t=0;function i(s){let o=e.get(s);return o===void 0&&(o=++t,e.set(s,o)),o}n.of=i})(NS||(NS={}));class lSe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class cSe{constructor(e,t,i,s,o,r){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=o,this._max=r,this._cache=new w4(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>BL(NS.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?co(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new oSe(6),this._cache.set(i,s));const o=co(s.update(t),this._min,this._max);return oP(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new sq;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return co(e,this._min,this._max)}}let gT=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var s,o,r;const a=(s=i==null?void 0:i.min)!==null&&s!==void 0?s:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,d=`${NS.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new cSe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new lSe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new sq;for(const t of this._data.values())e.update(t.default());return e.value}};gT=aSe([V7(0,dc),V7(1,oq)],gT);ht(rq,gT,1);var dSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x2=function(n,e){return function(t,i){e(t,i,n)}};let pT=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new xl}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${$s.getForeground(r)}, fontStyle ${$s.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;c>0&&this._logService.getLevel()===yn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;r|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;r|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;r|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;r|=u|8}if(d.foreground){const u=d.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${$s.getForeground(r)}, fontStyle ${$s.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};pT=dSe([x2(1,oo),x2(2,ki),x2(3,dc)],pT);class uSe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class xl{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=xl._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=xl._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},L2=function(n,e){return function(t,i){e(t,i,n)}};let mT=class extends K{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new pT(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};mT=fSe([L2(0,oo),L2(1,dc),L2(2,ki)],mT);ht(hSe,mT,1);var H7=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Vw="**",z7="/",qy="[/\\\\]",Gy="[^/\\\\]",gSe=/\//g;function $7(n,e){switch(n){case 0:return"";case 1:return`${Gy}*?`;default:return`(?:${qy}|${Gy}+${qy}${e?`|${qy}${Gy}+`:""})*?`}}function U7(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function aq(n){if(!n)return"";let e="";const t=U7(n,z7);if(t.every(i=>i===Vw))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===Vw){if(i)return;e+=$7(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===z7?u="":u=pr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${U7(a,",").map(f=>aq(f)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=Gy;continue;case"*":e+=$7(1);continue;default:e+=pr(d)}}orP(a,e)).filter(a=>a!==$a),n),i=t.length;if(!i)return $a;if(i===1)return t[0];const s=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function K7(n,e,t){const i=dd===Ri.sep,s=i?n:n.replace(gSe,dd),o=dd+s,r=Ri.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(o)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function xSe(n){try{const e=new RegExp(`^${aq(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return $a}}function LSe(n,e,t){return!n||typeof e!="string"?!1:lq(n)(e,void 0,t)}function lq(n,e={}){if(!n)return q7;if(typeof n=="string"||DSe(n)){const t=rP(n,e);if(t===$a)return q7;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return kSe(n,e)}function DSe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function kSe(n,e){const t=cq(Object.getOwnPropertyNames(n).map(a=>ESe(a,n[a],e)).filter(a=>a!==$a)),i=t.length;if(!i)return $a;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;fH7(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let d,u;for(let h=0,f=t.length;hH7(this,void 0,void 0,function*(){for(const h of u){const f=yield h;if(typeof f=="string")return f}return null}))():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function ESe(n,e,t){if(e===!1)return $a;const i=rP(n,t);if(i===$a)return $a;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=s.replace("$(basename)",()=>l),u=c(d);return yA(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function cq(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?s[c]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function dq(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=dq(a,e,t,i,s,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&s&&(e=s);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(d)if(d===o)u=10;else if(d==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:C$(a.base)}),h===e.fsPath||LSe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function uq(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(uq):!!n.exclusive}class Y7{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class ni{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ke(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const s=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=s?new Y7(e.uri,e.getLanguageId(),s.uri,s.type):new Y7(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=dq(r.selector,o.uri,o.languageId,_me(e),o.notebookUri,o.notebookType),uq(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(ni._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:$0(e.selector)&&!$0(t.selector)?1:!$0(e.selector)&&$0(t.selector)?-1:e._timet._time?-1:0}}function $0(n){return typeof n=="string"?!1:Array.isArray(n)?n.some($0):!!n.isBuiltin}class ISe{constructor(){this.referenceProvider=new ni(this._score.bind(this)),this.renameProvider=new ni(this._score.bind(this)),this.codeActionProvider=new ni(this._score.bind(this)),this.definitionProvider=new ni(this._score.bind(this)),this.typeDefinitionProvider=new ni(this._score.bind(this)),this.declarationProvider=new ni(this._score.bind(this)),this.implementationProvider=new ni(this._score.bind(this)),this.documentSymbolProvider=new ni(this._score.bind(this)),this.inlayHintsProvider=new ni(this._score.bind(this)),this.colorProvider=new ni(this._score.bind(this)),this.codeLensProvider=new ni(this._score.bind(this)),this.documentFormattingEditProvider=new ni(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ni(this._score.bind(this)),this.onTypeFormattingEditProvider=new ni(this._score.bind(this)),this.signatureHelpProvider=new ni(this._score.bind(this)),this.hoverProvider=new ni(this._score.bind(this)),this.documentHighlightProvider=new ni(this._score.bind(this)),this.selectionRangeProvider=new ni(this._score.bind(this)),this.foldingRangeProvider=new ni(this._score.bind(this)),this.linkProvider=new ni(this._score.bind(this)),this.inlineCompletionsProvider=new ni(this._score.bind(this)),this.completionProvider=new ni(this._score.bind(this)),this.linkedEditingRangeProvider=new ni(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ni(this._score.bind(this)),this.documentSemanticTokensProvider=new ni(this._score.bind(this)),this.documentOnDropEditProvider=new ni(this._score.bind(this)),this.documentPasteEditProvider=new ni(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}ht(nt,ISe,1);const hq=at("IWorkspaceEditService");class aP{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ph.is(t))return Ph.lift(t);if(up.is(t))return up.lift(t);throw new Error("Unsupported edit")})}}class Ph extends aP{static is(e){return e instanceof Ph?!0:Ds(e)&&$e.isUri(e.resource)&&Ds(e.textEdit)}static lift(e){return e instanceof Ph?e:new Ph(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class up extends aP{static is(e){return e instanceof up?!0:Ds(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof up?e:new up(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const $n={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},ASe=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),MS=Object.assign(Object.assign({},ASe),{properties:{"editor.tabSize":{type:"number",default:An.tabSize,minimum:1,markdownDescription:m("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:An.insertSpaces,markdownDescription:m("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:An.detectIndentation,markdownDescription:m("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:An.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:An.largeFileOptimizations,description:m("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:m("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),m("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),m("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:m("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),m("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),m("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:m("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:$n.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:$n.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:$n.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:$n.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:$n.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:$n.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:$n.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:$n.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:$n.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:$n.diffWordWrap,markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:$n.diffAlgorithm,markdownEnumDescriptions:[m("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),m("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:$n.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:$n.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:$n.hideUnchangedRegions.minimumLineCount,markdownDescription:m("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:$n.hideUnchangedRegions.contextLineCount,markdownDescription:m("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:$n.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:$n.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function TSe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of yg){const e=n.schema;if(typeof e<"u")if(TSe(e))MS.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(MS.properties[t]=e[t])}let Hw=null;function fq(){return Hw===null&&(Hw=Object.create(null),Object.keys(MS.properties).forEach(n=>{Hw[n]=!0})),Hw}function NSe(n){return fq()[`editor.${n}`]||!1}function MSe(n){return fq()[`diffEditor.${n}`]||!1}const RSe=mn.as(Af.Configuration);RSe.registerConfiguration(MS);class PSe{static insert(e,t){return{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function k2(n){return Object.isFrozen(n)?n:fue(n)}class In{constructor(e={},t=[],i=[],s){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof In)return i;const s=new OSe("");return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?RF(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),s=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:s,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?RF(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const s=yl(this.contents),o=yl(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(s,l.contents);for(const c of l.overrides){const[d]=o.filter(u=>Ki(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=Qh(d.keys)):o.push(yl(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new In(s,r,o,a.every(l=>l instanceof In)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Qh([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=yl(o),this.mergeContents(o,r)):o=r),i[s]=o}return new In(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ds(e[i])&&Ds(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=yl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=yl(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Npe(this.contents,e),zd.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ki(i.identifiers,sS(e))),1))}updateValue(e,t,i){wU(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),zd.test(e)&&this.overrides.push({identifiers:sS(e),keys:Object.keys(this.contents[e]),contents:xA(this.contents[e],s=>console.error(s))})}}class OSe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new In}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new In(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=mn.as(Af.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=xA(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var o,r,a;let l=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(zd.test(u)&&i){const h=this.filter(e[u],t,!1,s);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((r=s.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=s.include)===null||a===void 0)&&a.includes(u)||(f===void 0||s.scopes===void 0||s.scopes.includes(f))&&!(s.skipRestricted&&(h!=null&&h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(zd.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:sS(s),keys:Object.keys(o),contents:xA(o,t)})}return i}}class FSe{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,i){const s=e.inspect(t,i);return{get value(){return k2(s.value)},get override(){return k2(s.override)},get merged(){return k2(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class eD{constructor(e,t,i,s,o=new In,r=new In,a=new Tn,l=new In,c=new Tn){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Tn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new In,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new FSe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),r=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set($e.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Tn);return new eD(t,i,s,o,new In,r,a,new In,new Tn)}static parseConfigurationModel(e){return new In(e.contents,e.keys,e.overrides)}}class BSe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const r of o)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=eD.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const r=o+s.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!So(l,c)}return!0}}const RS={kind:0},WSe={kind:1};function VSe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class S_{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=S_.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"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,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),RS;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const s=t[i];if(S_._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Z7(n){return n?`${n.serialize()}`:"no when condition"}function X7(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const HSe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class zSe extends K{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:de.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new g1,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new hc,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),RS;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),RS;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw jR("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(m("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),u_.enabled&&u_.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],u_.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new Fg(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,u=>this._notificationService.warn(u)),HSe.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Fg{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Fg.EMPTY=new Fg(null);class Q7{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?_T(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=_T(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function _T(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return $Se.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:USe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return jSe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new zfe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class jb extends GSe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Al.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Al.toString(e.keyCode)}_getElectronAccelerator(e){return Al.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Al.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return jb.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Al.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=ZR[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof ef)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new ef(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=_T(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new jb(i,t)]:[]}}const iD=at("labelService"),KSe=at("progressService");class hp{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}hp.None=Object.freeze({report(){}});const x1=at("editorProgressService");class YSe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new x_(new QSe(e,t))}static forStrings(){return new x_(new YSe)}static forConfigKeys(){return new x_(new ZSe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new zw,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new zw,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new zw,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new zw,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const JSe=at("contextService");class exe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const txe="code-workspace";m("codeWorkspace","Code Workspace");const ixe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var J7;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(J7||(J7={}));var e8;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(e8||(e8={}));var t8;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})(t8||(t8={}));var i8;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(i8||(i8={}));var n8;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(n8||(n8={}));var PS;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(PS||(PS={}));var s8;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(s8||(s8={}));var bT;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(bT||(bT={}));const nxe=at("workspaceTrustManagementService"),fu=at("contextViewService"),gu=at("contextMenuService");var kn;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(kn||(kn={}));function sxe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var id;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(id||(id={}));function Bg(n,e,t){const i=t.mode===id.ALIGN?t.offset:t.offset+t.size,s=t.mode===id.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class dm extends K{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=K.None,this.toDisposeOnSetContainer=K.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=we(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,qc(this.view),this.setContainer(e,t),this._register(Ke(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=we(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=oxe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(we("slot"))}else this.container.appendChild(this.view);const s=new fe;dm.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Hi(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),dm.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Hi(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),Do(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Ih(this.view),this.toDisposeOnClean=e.render(this.view)||K.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Bd&&u4.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(f4(e)){const u=Nn(e),h=Mge(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else sxe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=ys(this.view),s=ah(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const u={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:r===0?0:1,mode:id.ALIGN};l=Bg(window.innerHeight,s,u)+window.pageYOffset,kn.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=id.AVOID),c=Bg(window.innerWidth,i,h)}else{const u={offset:t.left,size:t.width,position:r===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:id.ALIGN};c=Bg(window.innerWidth,i,u),kn.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=id.AVOID),l=Bg(window.innerHeight,s,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Nn(this.container);this.view.style.top=`${l-(this.useFixedPosition?Nn(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Nn(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),qc(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Cn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}dm.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];dm.BUBBLE_DOWN_EVENTS=["click"];const oxe=` +`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const 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,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?$u._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?$u._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?$u._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(s=>N.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ui.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(!H.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,s){if(!this._modelData)return;if(!N.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}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 N(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,s){if(!H.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new N(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=lt.isISelection(e),s=N.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new lt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!N.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(N.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,pt);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,s,e);const l=r.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new N(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=ep.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,pt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new hSe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,KC(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,KC(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(143),o=$u._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Mn(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new GCe(this._id,this._configuration,e,pP.create(),gP.create(this._configuration.options),a=>$o(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(79),h=m("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(fq.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new nD(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new rT(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),options:$u.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};um.dropIntoEditorDecorationOptions=et.register({description:"workbench-dnd-target",className:"dnd-target"});um=$u=oSe([ul(3,bt),ul(4,$t),ul(5,fs),ul(6,tt),ul(7,oo),ul(8,Ln),ul(9,mu),ul(10,no),ul(11,nt)],um);class G7 extends Y{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class zn extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class cSe extends Y{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=$.editorSimpleInput.bindTo(t),this._editorFocus=$.focus.bindTo(t),this._textInputFocus=$.textInputFocus.bindTo(t),this._editorTextFocus=$.editorTextFocus.bindTo(t),this._tabMovesFocus=$.tabMovesFocus.bindTo(t),this._editorReadonly=$.readOnly.bindTo(t),this._inDiffEditor=$.inDiffEditor.bindTo(t),this._editorColumnSelection=$.columnSelection.bindTo(t),this._hasMultipleSelections=$.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=$.hasNonEmptySelection.bindTo(t),this._canUndo=$.canUndo.bindTo(t),this._canRedo=$.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(mS.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(mS.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class dSe extends Y{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=$.languageId.bindTo(t),this._hasCompletionItemProvider=$.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=$.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=$.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=$.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=$.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=$.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=$.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=$.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=$.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=$.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=$.hasReferenceProvider.bindTo(t),this._hasRenameProvider=$.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=$.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=$.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=$.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=$.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=$.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=$.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=$.isInWalkThroughSnippet.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===it.walkThroughSnippet)})}}class uSe extends Y{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(jd(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class hSe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const fSe=encodeURIComponent("");function E2(n){return fSe+encodeURIComponent(n.toString())+gSe}const pSe=encodeURIComponent('');function _Se(n){return pSe+encodeURIComponent(n.toString())+mSe}xr((n,e)=>{const t=n.getColor(Ma);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${E2(t)}") repeat-x bottom left; }`);const i=n.getColor(vo);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${E2(i)}") repeat-x bottom left; }`);const s=n.getColor(ks);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${E2(s)}") repeat-x bottom left; }`);const o=n.getColor(U_e);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${_Se(o)}") no-repeat bottom left; }`);const r=n.getColor(Yve);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var bSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vSe=function(n,e){return function(t,i){e(t,i,n)}},wSe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let yT=class extends Y{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ds,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return wSe(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ze(t)}};yT=bSe([vSe(0,oo)],yT);var ySe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},K7=function(n,e){return function(t,i){e(t,i,n)}},CSe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let RS=class extends yT{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,s,o)=>CSe(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===it.http||o===it.https)return CU(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};RS=ySe([K7(0,tt),K7(1,oo)],RS);ht($t,RS,0);const Bm=at("layoutService");var pq=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mq=function(n,e){return function(t,i){e(t,i,n)}};let PS=class{get dimension(){return this._dimension||(this._dimension=BL(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=de.None,this.offset={top:0,quickPickTop:0}}};PS=pq([mq(0,$t)],PS);let CT=class extends PS{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};CT=pq([mq(1,$t)],CT);ht(Bm,PS,1);const _q=at("dialogService");var SSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Y7=function(n,e){return function(t,i){e(t,i,n)}},$w=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Uw(n){return n.scheme===it.file?n.fsPath:n.path}let bq=0;class jw{constructor(e,t,i,s,o,r,a){this.id=++bq,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Z7{constructor(e,t){this.resourceLabel=e,this.reason=t}}class X7{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(m({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class xSe{constructor(e,t,i,s,o,r,a){this.id=++bq,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new X7),this.removedResources.has(t)||this.removedResources.set(t,new Z7(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 X7),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Z7(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class vq{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=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,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new lq(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,o=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--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class I2{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof Da){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){pt(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,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),s.dispose(),o()),l=>(r(),s.dispose(),this._onError(l,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return $w(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Y.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Y.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Y.None);const i=e.actual.prepareUndoRedo();return i?Hhe(i)?t(i):i.then(s=>t(s)):t(Y.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||wq);return new I2(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new qw(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new qw}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return $w(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:gi.Info,message:m("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=m({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new I2([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Da){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return $w(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:m("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:m({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:m("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return $w(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new I2([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrdermP(n,t))}function DSe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var kSe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},J7=function(n,e){return function(t,i){e(t,i,n)}};const Sq=at("ILanguageFeatureDebounceService");var OS;(function(n){const e=new WeakMap;let t=0;function i(s){let o=e.get(s);return o===void 0&&(o=++t,e.set(s,o)),o}n.of=i})(OS||(OS={}));class ESe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class ISe{constructor(e,t,i,s,o,r){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=o,this._max=r,this._cache=new T4(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>qL(OS.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?co(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new LSe(6),this._cache.set(i,s));const o=co(s.update(t),this._min,this._max);return mP(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new yq;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return co(e,this._min,this._max)}}let xT=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var s,o,r;const a=(s=i==null?void 0:i.min)!==null&&s!==void 0?s:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,d=`${OS.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new ISe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new ESe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new yq;for(const t of this._data.values())e.update(t.default());return e.value}};xT=kSe([J7(0,fc),J7(1,Cq)],xT);ht(Sq,xT,1);var ASe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},A2=function(n,e){return function(t,i){e(t,i,n)}};let LT=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Ll}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${zs.getForeground(r)}, fontStyle ${zs.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;c>0&&this._logService.getLevel()===yn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;r|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;r|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;r|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;r|=u|8}if(d.foreground){const u=d.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${zs.getForeground(r)}, fontStyle ${zs.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};LT=ASe([A2(1,oo),A2(2,Ii),A2(3,fc)],LT);class TSe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class Ll{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Ll._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Ll._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},T2=function(n,e){return function(t,i){e(t,i,n)}};let DT=class extends Y{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new LT(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};DT=MSe([T2(0,oo),T2(1,fc),T2(2,Ii)],DT);ht(NSe,DT,1);var e8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Gw="**",t8="/",Jy="[/\\\\]",eC="[^/\\\\]",RSe=/\//g;function i8(n,e){switch(n){case 0:return"";case 1:return`${eC}*?`;default:return`(?:${Jy}|${eC}+${Jy}${e?`|${Jy}${eC}+`:""})*?`}}function n8(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function xq(n){if(!n)return"";let e="";const t=n8(n,t8);if(t.every(i=>i===Gw))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===Gw){if(i)return;e+=i8(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===t8?u="":u=mr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${n8(a,",").map(f=>xq(f)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=eC;continue;case"*":e+=i8(1);continue;default:e+=mr(d)}}o_P(a,e)).filter(a=>a!==$a),n),i=t.length;if(!i)return $a;if(i===1)return t[0];const s=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function a8(n,e,t){const i=fd===Ri.sep,s=i?n:n.replace(RSe,fd),o=fd+s,r=Ri.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(o)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function USe(n){try{const e=new RegExp(`^${xq(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return $a}}function jSe(n,e,t){return!n||typeof e!="string"?!1:Lq(n)(e,void 0,t)}function Lq(n,e={}){if(!n)return o8;if(typeof n=="string"||qSe(n)){const t=_P(n,e);if(t===$a)return o8;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return GSe(n,e)}function qSe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function GSe(n,e){const t=Dq(Object.getOwnPropertyNames(n).map(a=>KSe(a,n[a],e)).filter(a=>a!==$a)),i=t.length;if(!i)return $a;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;fe8(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let d,u;for(let h=0,f=t.length;he8(this,void 0,void 0,function*(){for(const h of u){const f=yield h;if(typeof f=="string")return f}return null}))():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function KSe(n,e,t){if(e===!1)return $a;const i=_P(n,t);if(i===$a)return $a;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=s.replace("$(basename)",()=>l),u=c(d);return TA(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function Dq(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?s[c]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function kq(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=kq(a,e,t,i,s,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&s&&(e=s);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(d)if(d===o)u=10;else if(d==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:W$(a.base)}),h===e.fsPath||jSe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function Eq(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(Eq):!!n.exclusive}class l8{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class si{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ze(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const s=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=s?new l8(e.uri,e.getLanguageId(),s.uri,s.type):new l8(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=kq(r.selector,o.uri,o.languageId,Fme(e),o.notebookUri,o.notebookType),Eq(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(si._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:j0(e.selector)&&!j0(t.selector)?1:!j0(e.selector)&&j0(t.selector)?-1:e._timet._time?-1:0}}function j0(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(j0):!!n.isBuiltin}class YSe{constructor(){this.referenceProvider=new si(this._score.bind(this)),this.renameProvider=new si(this._score.bind(this)),this.codeActionProvider=new si(this._score.bind(this)),this.definitionProvider=new si(this._score.bind(this)),this.typeDefinitionProvider=new si(this._score.bind(this)),this.declarationProvider=new si(this._score.bind(this)),this.implementationProvider=new si(this._score.bind(this)),this.documentSymbolProvider=new si(this._score.bind(this)),this.inlayHintsProvider=new si(this._score.bind(this)),this.colorProvider=new si(this._score.bind(this)),this.codeLensProvider=new si(this._score.bind(this)),this.documentFormattingEditProvider=new si(this._score.bind(this)),this.documentRangeFormattingEditProvider=new si(this._score.bind(this)),this.onTypeFormattingEditProvider=new si(this._score.bind(this)),this.signatureHelpProvider=new si(this._score.bind(this)),this.hoverProvider=new si(this._score.bind(this)),this.documentHighlightProvider=new si(this._score.bind(this)),this.selectionRangeProvider=new si(this._score.bind(this)),this.foldingRangeProvider=new si(this._score.bind(this)),this.linkProvider=new si(this._score.bind(this)),this.inlineCompletionsProvider=new si(this._score.bind(this)),this.completionProvider=new si(this._score.bind(this)),this.linkedEditingRangeProvider=new si(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new si(this._score.bind(this)),this.documentSemanticTokensProvider=new si(this._score.bind(this)),this.documentOnDropEditProvider=new si(this._score.bind(this)),this.documentPasteEditProvider=new si(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}ht(nt,YSe,1);const Iq=at("IWorkspaceEditService");class bP{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Oh.is(t))return Oh.lift(t);if(hp.is(t))return hp.lift(t);throw new Error("Unsupported edit")})}}class Oh extends bP{static is(e){return e instanceof Oh?!0:Ls(e)&&je.isUri(e.resource)&&Ls(e.textEdit)}static lift(e){return e instanceof Oh?e:new Oh(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class hp extends bP{static is(e){return e instanceof hp?!0:Ls(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof hp?e:new hp(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const $n={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},ZSe=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),FS=Object.assign(Object.assign({},ZSe),{properties:{"editor.tabSize":{type:"number",default:An.tabSize,minimum:1,markdownDescription:m("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:An.insertSpaces,markdownDescription:m("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:An.detectIndentation,markdownDescription:m("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:An.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:An.largeFileOptimizations,description:m("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:m("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),m("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),m("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:m("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),m("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),m("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:m("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:$n.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:$n.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:$n.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:$n.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:$n.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:$n.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:$n.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:$n.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:$n.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:$n.diffWordWrap,markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:$n.diffAlgorithm,markdownEnumDescriptions:[m("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),m("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:$n.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:$n.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:$n.hideUnchangedRegions.minimumLineCount,markdownDescription:m("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:$n.hideUnchangedRegions.contextLineCount,markdownDescription:m("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:$n.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:$n.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function XSe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of yg){const e=n.schema;if(typeof e<"u")if(XSe(e))FS.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(FS.properties[t]=e[t])}let Kw=null;function Aq(){return Kw===null&&(Kw=Object.create(null),Object.keys(FS.properties).forEach(n=>{Kw[n]=!0})),Kw}function QSe(n){return Aq()[`editor.${n}`]||!1}function JSe(n){return Aq()[`diffEditor.${n}`]||!1}const exe=mn.as(Af.Configuration);exe.registerConfiguration(FS);class txe{static insert(e,t){return{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function M2(n){return Object.isFrozen(n)?n:Mue(n)}class In{constructor(e={},t=[],i=[],s){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof In)return i;const s=new ixe("");return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?GF(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),s=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:s,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?GF(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const s=Cl(this.contents),o=Cl(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(s,l.contents);for(const c of l.overrides){const[d]=o.filter(u=>Ki(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=Qh(d.keys)):o.push(Cl(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new In(s,r,o,a.every(l=>l instanceof In)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Qh([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Cl(o),this.mergeContents(o,r)):o=r),i[s]=o}return new In(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ls(e[i])&&Ls(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Cl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Cl(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Qpe(this.contents,e),Gd.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ki(i.identifiers,lS(e))),1))}updateValue(e,t,i){FU(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Gd.test(e)&&this.overrides.push({identifiers:lS(e),keys:Object.keys(this.contents[e]),contents:RA(this.contents[e],s=>console.error(s))})}}class ixe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new In}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new In(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=mn.as(Af.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=RA(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var o,r,a;let l=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(Gd.test(u)&&i){const h=this.filter(e[u],t,!1,s);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((r=s.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=s.include)===null||a===void 0)&&a.includes(u)||(f===void 0||s.scopes===void 0||s.scopes.includes(f))&&!(s.skipRestricted&&(h!=null&&h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(Gd.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:lS(s),keys:Object.keys(o),contents:RA(o,t)})}return i}}class nxe{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,i){const s=e.inspect(t,i);return{get value(){return M2(s.value)},get override(){return M2(s.override)},get merged(){return M2(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class lD{constructor(e,t,i,s,o=new In,r=new In,a=new Tn,l=new In,c=new Tn){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Tn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new In,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new nxe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),r=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(je.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Tn);return new lD(t,i,s,o,new In,r,a,new In,new Tn)}static parseConfigurationModel(e){return new In(e.contents,e.keys,e.overrides)}}class sxe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const r of o)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=lD.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const r=o+s.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Co(l,c)}return!0}}const BS={kind:0},oxe={kind:1};function rxe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class L_{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=L_.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"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,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),BS;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const s=t[i];if(L_._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function c8(n){return n?`${n.serialize()}`:"no when condition"}function d8(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const axe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class lxe extends Y{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:de.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new y1,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new pc,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),BS;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),BS;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw i4("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(m("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),f_.enabled&&f_.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],f_.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Fg.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new Fg(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,u=>this._notificationService.warn(u)),axe.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Fg{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Fg.EMPTY=new Fg(null);class u8{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?kT(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=kT(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function kT(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return cxe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:dxe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return uxe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new lge(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class Gb extends fxe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Nl.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Nl.toString(e.keyCode)}_getElectronAccelerator(e){return Nl.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Nl.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return Gb.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Nl.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=a4[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof ef)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new ef(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=kT(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new Gb(i,t)]:[]}}const dD=at("labelService"),gxe=at("progressService");class fp{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}fp.None=Object.freeze({report(){}});const T1=at("editorProgressService");class pxe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new D_(new bxe(e,t))}static forStrings(){return new D_(new pxe)}static forConfigKeys(){return new D_(new mxe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new Yw,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new Yw,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new Yw,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new Yw,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const vxe=at("contextService");class wxe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const yxe="code-workspace";m("codeWorkspace","Code Workspace");const Cxe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var h8;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(h8||(h8={}));var f8;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(f8||(f8={}));var g8;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})(g8||(g8={}));var p8;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(p8||(p8={}));var m8;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(m8||(m8={}));var WS;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(WS||(WS={}));var _8;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(_8||(_8={}));var ET;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(ET||(ET={}));const Sxe=at("workspaceTrustManagementService"),bu=at("contextViewService"),vu=at("contextMenuService");var kn;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(kn||(kn={}));function xxe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var od;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(od||(od={}));function Bg(n,e,t){const i=t.mode===od.ALIGN?t.offset:t.offset+t.size,s=t.mode===od.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class hm extends Y{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Y.None,this.toDisposeOnSetContainer=Y.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=we(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Yc(this.view),this.setContainer(e,t),this._register(Ze(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=we(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=Lxe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(we("slot"))}else this.container.appendChild(this.view);const s=new fe;hm.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Hi(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),hm.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Hi(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),Lo(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Ah(this.view),this.toDisposeOnClean=e.render(this.view)||Y.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!($d&&C4.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(x4(e)){const u=Nn(e),h=Jge(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else xxe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=ws(this.view),s=uh(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const u={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:r===0?0:1,mode:od.ALIGN};l=Bg(window.innerHeight,s,u)+window.pageYOffset,kn.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=od.AVOID),c=Bg(window.innerWidth,i,h)}else{const u={offset:t.left,size:t.width,position:r===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:od.ALIGN};c=Bg(window.innerWidth,i,u),kn.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=od.AVOID),l=Bg(window.innerHeight,s,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Nn(this.container);this.view.style.top=`${l-(this.useFixedPosition?Nn(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Nn(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Yc(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Cn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}hm.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];hm.BUBBLE_DOWN_EVENTS=["click"];const Lxe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -2688,46 +2735,46 @@ Received: '{1}'.`,e,Sa.getLexeme(t)),o=t.offset,r=Sa.getLexeme(t);return this._p :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 rxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},axe=function(n,e){return function(t,i){e(t,i,n)}};let vT=class extends K{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=K.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new dm(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const s=Ke(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};vT=rxe([axe(0,Om)],vT);let um=[],cP=[],gq=[];function $w(n,e=!1){lxe(n,!1,e)}function lxe(n,e,t){const i=cxe(n,e);um.push(i),i.userConfigured?gq.push(i):cP.push(i),t&&!i.userConfigured&&um.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function cxe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?lq(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Ri.sep)>=0:!1}}function dxe(){um=um.filter(n=>n.userConfigured),cP=[]}function uxe(n,e){return hxe(n,e).map(t=>t.id)}function hxe(n,e){let t;if(n)switch(n.scheme){case it.file:t=n.fsPath;break;case it.data:{t=xS.parseMetaData(n).get(xS.META_DATA_LABEL);break}case it.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Ml.unknown}];t=t.toLowerCase();const i=S$(t),s=o8(t,i,gq);if(s)return[s,{id:Vo,mime:Ml.text}];const o=o8(t,i,cP);if(o)return[o,{id:Vo,mime:Ml.text}];if(e){const r=fxe(e);if(r)return[r,{id:Vo,mime:Ml.text}]}return[{id:"unknown",mime:Ml.unknown}]}function o8(n,e,t){var i;let s,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(s)return s;if(o)return o;if(r)return r}function fxe(n){if(o4(n)&&(n=n.substr(1)),n.length>0)for(let e=um.length-1;e>=0;e--){const t=um[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Uw=Object.prototype.hasOwnProperty,r8="vs.editor.nullLanguage";class gxe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(r8,0),this._register(Vo,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||r8}}class qb extends K{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,qb.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new gxe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Qp.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){qb.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},dxe();const e=[].concat(Qp.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),mn.as(Af.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Uw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)$w({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)$w({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)$w({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);lfe(l)||$w({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Uw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Uw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Uw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:uxe(e,t)}}qb.instanceCount=0;class Gb extends K{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Gb.instanceCount++,this._registry=this._register(new qb(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Gb.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return Qz(i,null)}createById(e){return new a8(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new a8(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Vo),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),vi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}Gb.instanceCount=0;class a8{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const pq={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Ml.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function mq(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function pxe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function mxe(n,e){return wT(n.toLowerCase(),e.toLowerCase(),0,0)}function wT(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=wT(n,e,t+1,i+1))?vq({start:i,end:i+1},s):null}return wT(n,e,t,i+1)}function dP(n){return 97<=n&&n<=122}function nD(n){return 65<=n&&n<=90}function uP(n){return 48<=n&&n<=57}function _xe(n){return n===32||n===9||n===10||n===13}const bxe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>bxe.add(n.charCodeAt(0)));function bq(n){return dP(n)||nD(n)||uP(n)}function vq(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function wq(n,e){for(let t=e;t0&&!bq(n.charCodeAt(t-1)))return t}return n.length}function yT(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=yT(n,e,t+1,i+1);!s&&(o=wq(e,o)).6}function yxe(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function Cxe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=vxe(e);if(!yxe(t)){if(!wxe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const nd=128;function fP(){const n=[],e=[];for(let t=0;t<=nd;t++)e[t]=0;for(let t=0;t<=nd;t++)n.push(e.slice(0));return n}function Cq(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const Sq=Cq(2*nd),CT=Cq(2*nd),hl=fP(),Eu=fP(),jw=fP();function qw(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!s4(t)}}function d8(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function Ky(n,e,t){return e[n]!==t[n]}function Dxe(n,e,t,i,s,o,r=!1){for(;end?nd:n.length,l=i.length>nd?nd:i.length;if(t>=a||o>=l||a-t>l-o||!Dxe(e,t,a,s,o,l,!0))return;kxe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,k=D?Eu[c][d-1]+(hl[c][d-1]>0?-5:0):0,O=h>b+1&&hl[c][d-1]>0,R=O?Eu[c][d-2]+(hl[c][d-2]>0?-5:0):0;if(O&&(!D||R>=k)&&(!L||R>=x))Eu[c][d]=R,jw[c][d]=3,hl[c][d]=0;else if(D&&(!L||k>=x))Eu[c][d]=k,jw[c][d]=2,hl[c][d]=0;else if(L)Eu[c][d]=x,jw[c][d]=1,hl[c][d]=hl[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[Eu[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const w=jw[c][b];if(w===3)b=b-2;else if(w===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!Ky(b+o-1,i,s)&&p+1>hl[c][b]&&(b=d),b===d?p++:p=1,_||(_=b),c--,d=b-1,g.push(d)}l===a&&r.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function kxe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(CT[r]=a,r--),a--}function Exe(n,e,t,i,s,o,r,a,l,c,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=n[t]===s[r]?7:5:Ky(r,s,o)&&(r===0||!Ky(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):qw(o,r)&&(r===0||!qw(o,r-1))?u=5:(qw(o,r-1)||d8(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=Ky(r,s,o)||qw(o,r-1)||d8(o,r-1)),t===i?r>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}const Ixe="$(",gP=new RegExp(`\\$\\(${Ae.iconNameExpression}(?:${Ae.iconModifierExpression})?\\)`,"g"),Axe=new RegExp(`(\\\\)?${gP.source}`,"g");function Txe(n){return n.replace(Axe,(e,t)=>t?e:`\\${e}`)}const Nxe=new RegExp(`\\\\${gP.source}`,"g");function Mxe(n){return n.replace(Nxe,e=>`\\${e}`)}const Rxe=new RegExp(`(\\s)?(\\\\)?${gP.source}(\\s)?`,"g");function Dq(n){return n.indexOf(Ixe)===-1?n:n.replace(Rxe,(e,t,i,s)=>i?e:t||s||"")}function Pxe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const E2=new RegExp(`\\$\\(${Ae.iconNameCharacter}+\\)`,"g");function U0(n){E2.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=E2.lastIndex,o=E2.exec(n),r=n.substring(s,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`;var Dxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kxe=function(n,e){return function(t,i){e(t,i,n)}};let IT=class extends Y{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Y.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new hm(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const s=Ze(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};IT=Dxe([kxe(0,Bm)],IT);let fm=[],wP=[],Tq=[];function Zw(n,e=!1){Exe(n,!1,e)}function Exe(n,e,t){const i=Ixe(n,e);fm.push(i),i.userConfigured?Tq.push(i):wP.push(i),t&&!i.userConfigured&&fm.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function Ixe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?Lq(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Ri.sep)>=0:!1}}function Axe(){fm=fm.filter(n=>n.userConfigured),wP=[]}function Txe(n,e){return Nxe(n,e).map(t=>t.id)}function Nxe(n,e){let t;if(n)switch(n.scheme){case it.file:t=n.fsPath;break;case it.data:{t=ES.parseMetaData(n).get(ES.META_DATA_LABEL);break}case it.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Pl.unknown}];t=t.toLowerCase();const i=V$(t),s=b8(t,i,Tq);if(s)return[s,{id:Vo,mime:Pl.text}];const o=b8(t,i,wP);if(o)return[o,{id:Vo,mime:Pl.text}];if(e){const r=Mxe(e);if(r)return[r,{id:Vo,mime:Pl.text}]}return[{id:"unknown",mime:Pl.unknown}]}function b8(n,e,t){var i;let s,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(s)return s;if(o)return o;if(r)return r}function Mxe(n){if(m4(n)&&(n=n.substr(1)),n.length>0)for(let e=fm.length-1;e>=0;e--){const t=fm[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Xw=Object.prototype.hasOwnProperty,v8="vs.editor.nullLanguage";class Rxe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(v8,0),this._register(Vo,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||v8}}class Kb extends Y{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,Kb.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Rxe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(em.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Kb.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Axe();const e=[].concat(em.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),mn.as(Af.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Xw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)Zw({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)Zw({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)Zw({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);Efe(l)||Zw({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Xw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Xw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Xw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Txe(e,t)}}Kb.instanceCount=0;class Yb extends Y{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Yb.instanceCount++,this._registry=this._register(new Kb(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Yb.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return p$(i,null)}createById(e){return new w8(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new w8(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Vo),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),yi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}Yb.instanceCount=0;class w8{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const Nq={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Pl.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function Mq(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function Pxe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function Oxe(n,e){return AT(n.toLowerCase(),e.toLowerCase(),0,0)}function AT(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=AT(n,e,t+1,i+1))?Oq({start:i,end:i+1},s):null}return AT(n,e,t,i+1)}function yP(n){return 97<=n&&n<=122}function uD(n){return 65<=n&&n<=90}function CP(n){return 48<=n&&n<=57}function Fxe(n){return n===32||n===9||n===10||n===13}const Bxe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>Bxe.add(n.charCodeAt(0)));function Pq(n){return yP(n)||uD(n)||CP(n)}function Oq(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function Fq(n,e){for(let t=e;t0&&!Pq(n.charCodeAt(t-1)))return t}return n.length}function TT(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=TT(n,e,t+1,i+1);!s&&(o=Fq(e,o)).6}function Hxe(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function zxe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=Wxe(e);if(!Hxe(t)){if(!Vxe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const rd=128;function xP(){const n=[],e=[];for(let t=0;t<=rd;t++)e[t]=0;for(let t=0;t<=rd;t++)n.push(e.slice(0));return n}function Wq(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const Vq=Wq(2*rd),NT=Wq(2*rd),hl=xP(),Mu=xP(),Qw=xP();function Jw(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!p4(t)}}function S8(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function tC(n,e,t){return e[n]!==t[n]}function qxe(n,e,t,i,s,o,r=!1){for(;erd?rd:n.length,l=i.length>rd?rd:i.length;if(t>=a||o>=l||a-t>l-o||!qxe(e,t,a,s,o,l,!0))return;Gxe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,k=D?Mu[c][d-1]+(hl[c][d-1]>0?-5:0):0,P=h>b+1&&hl[c][d-1]>0,O=P?Mu[c][d-2]+(hl[c][d-2]>0?-5:0):0;if(P&&(!D||O>=k)&&(!L||O>=x))Mu[c][d]=O,Qw[c][d]=3,hl[c][d]=0;else if(D&&(!L||k>=x))Mu[c][d]=k,Qw[c][d]=2,hl[c][d]=0;else if(L)Mu[c][d]=x,Qw[c][d]=1,hl[c][d]=hl[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[Mu[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const w=Qw[c][b];if(w===3)b=b-2;else if(w===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!tC(b+o-1,i,s)&&p+1>hl[c][b]&&(b=d),b===d?p++:p=1,_||(_=b),c--,d=b-1,g.push(d)}l===a&&r.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function Gxe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(NT[r]=a,r--),a--}function Kxe(n,e,t,i,s,o,r,a,l,c,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=n[t]===s[r]?7:5:tC(r,s,o)&&(r===0||!tC(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):Jw(o,r)&&(r===0||!Jw(o,r-1))?u=5:(Jw(o,r-1)||S8(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=tC(r,s,o)||Jw(o,r-1)||S8(o,r-1)),t===i?r>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}const Yxe="$(",LP=new RegExp(`\\$\\(${Ae.iconNameExpression}(?:${Ae.iconModifierExpression})?\\)`,"g"),Zxe=new RegExp(`(\\\\)?${LP.source}`,"g");function Xxe(n){return n.replace(Zxe,(e,t)=>t?e:`\\${e}`)}const Qxe=new RegExp(`\\\\${LP.source}`,"g");function Jxe(n){return n.replace(Qxe,e=>`\\${e}`)}const eLe=new RegExp(`(\\s)?(\\\\)?${LP.source}(\\s)?`,"g");function $q(n){return n.indexOf(Yxe)===-1?n:n.replace(eLe,(e,t,i,s)=>i?e:t||s||"")}function tLe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const R2=new RegExp(`\\$\\(${Ae.iconNameCharacter}+\\)`,"g");function q0(n){R2.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=R2.lastIndex,o=R2.exec(n),r=n.substring(s,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` -`,this.value+=t,this.value+="\n```\n",this}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(pr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function Kb(n){return md(n)?!n.value:Array.isArray(n)?n.every(Kb):!0}function md(n){return n instanceof hm?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function Oxe(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&q4($e.from(n.baseUri),$e.from(e.baseUri)))}function Fxe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Gw(n){return n.replace(/"/g,""")}function A2(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Bxe(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var ST=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Wxe(n,e){Ms(e)?n.title=Dq(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class Vxe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return ST(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ms(e)||e instanceof HTMLElement)o=e;else if(!HC(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new yr;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?md(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function kq(n,e,t,i){let s,o;const r=(u,h)=>{var f;const g=o!==void 0;u&&(o==null||o.dispose(),o=void 0),h&&(s==null||s.dispose(),s=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(u,h,f)=>new hc(()=>ST(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new Vxe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new fe,h=p=>r(!1,p.fromElement===e);u.add(G(e,le.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(G(e,le.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const p=_=>{g.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&r(!0,!0)};u.add(G(e,le.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=G(e,le.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>ST(this,void 0,void 0,function*(){t=u,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),r(!0,!0)}}}function Hxe(n,e={}){const t=pP(e);return t.textContent=n,t}function zxe(n,e={}){const t=pP(e);return Eq(t,Uxe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function pP(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class $xe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function Eq(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Hi(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{Eq(s,o,t,i)})}function Uxe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new $xe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&xT(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&jxe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=xT(a,e);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` -`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function jxe(n,e){return xT(n,e)!==0}function xT(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const qxe=new RegExp(`(\\\\)?\\$\\((${Ae.iconNameExpression}(?:${Ae.iconModifierExpression})?)\\)`,"g");function Fh(n){const e=new Array;let t,i=0,s=0;for(;(t=qxe.exec(n))!==null;){s=t.index||0,iZ.length)&&(j=Z.length);for(var U=0,I=new Array(j);U=Z.length?{done:!0}:{done:!1,value:Z[I++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Z){e.defaults=Z}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(j){return f[j]};function p(Z,j){if(j){if(c.test(Z))return Z.replace(d,g)}else if(u.test(Z))return Z.replace(h,g);return Z}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(Z){return Z.replace(_,function(j,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var b=/(^|[^\[])\^/g;function w(Z,j){Z=typeof Z=="string"?Z:Z.source,j=j||"";var U={replace:function(T,W){return W=W.source||W,W=W.replace(b,"$1"),Z=Z.replace(T,W),U},getRegex:function(){return new RegExp(Z,j)}};return U}var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Z,j,U){if(Z){var I;try{I=decodeURIComponent(v(U)).replace(y,"").toLowerCase()}catch{return null}if(I.indexOf("javascript:")===0||I.indexOf("vbscript:")===0||I.indexOf("data:")===0)return null}j&&!S.test(U)&&(U=R(j,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch{return null}return U}var x={},D=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,O=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(Z,j){x[" "+Z]||(D.test(Z)?x[" "+Z]=Z+"/":x[" "+Z]=Y(Z,"/",!0)),Z=x[" "+Z];var U=Z.indexOf(":")===-1;return j.substring(0,2)==="//"?U?j:Z.replace(k,"$1")+j:j.charAt(0)==="/"?U?j:Z.replace(O,"$1")+j:Z+j}var P={exec:function(){}};function M(Z){for(var j=1,U,I;j=0&&X[Ce]==="\\";)ae=!ae;return ae?"|":" |"}),I=U.split(/ \|/),T=0;if(I[0].trim()||I.shift(),I.length>0&&!I[I.length-1].trim()&&I.pop(),I.length>j)I.splice(j);else for(;I.length1;)j&1&&(U+=Z),j>>=1,Z+=Z;return U+Z}function se(Z,j,U,I){var T=j.href,W=j.title?p(j.title):null,F=Z[1].replace(/\\([\[\]])/g,"$1");if(Z[0].charAt(0)!=="!"){I.state.inLink=!0;var X={type:"link",raw:U,href:T,title:W,text:F,tokens:I.inlineTokens(F)};return I.state.inLink=!1,X}return{type:"image",raw:U,href:T,title:W,text:p(F)}}function Se(Z,j){var U=Z.match(/^(\s+)(?:```)/);if(U===null)return j;var I=U[1];return j.split(` -`).map(function(T){var W=T.match(/^\s+/);if(W===null)return T;var F=W[0];return F.length>=I.length?T.slice(I.length):T}).join(` -`)}var Ie=function(){function Z(U){this.options=U||e.defaults}var j=Z.prototype;return j.space=function(I){var T=this.rules.block.newline.exec(I);if(T&&T[0].length>0)return{type:"space",raw:T[0]}},j.code=function(I){var T=this.rules.block.code.exec(I);if(T){var W=T[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?W:Y(W,` -`)}}},j.fences=function(I){var T=this.rules.block.fences.exec(I);if(T){var W=T[0],F=Se(W,T[3]||"");return{type:"code",raw:W,lang:T[2]?T[2].trim():T[2],text:F}}},j.heading=function(I){var T=this.rules.block.heading.exec(I);if(T){var W=T[2].trim();if(/#$/.test(W)){var F=Y(W,"#");(this.options.pedantic||!F||/ $/.test(F))&&(W=F.trim())}return{type:"heading",raw:T[0],depth:T[1].length,text:W,tokens:this.lexer.inline(W)}}},j.hr=function(I){var T=this.rules.block.hr.exec(I);if(T)return{type:"hr",raw:T[0]}},j.blockquote=function(I){var T=this.rules.block.blockquote.exec(I);if(T){var W=T[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(W,[]),text:W}}},j.list=function(I){var T=this.rules.block.list.exec(I);if(T){var W,F,X,ae,Ce,Le,Ve,Pe,At,Dt,Ne,ai,li=T[1].trim(),Xo=li.length>1,wt={type:"list",raw:"",ordered:Xo,start:Xo?+li.slice(0,-1):"",loose:!1,items:[]};li=Xo?"\\d{1,9}\\"+li.slice(-1):"\\"+li,this.options.pedantic&&(li=Xo?li:"[*+-]");for(var Fi=new RegExp("^( {0,3}"+li+")((?:[ ][^\\n]*)?(?:\\n|$))");I&&(ai=!1,!(!(T=Fi.exec(I))||this.rules.block.hr.test(I)));){if(W=T[0],I=I.substring(W.length),Pe=T[2].split(` +`,this.value+=t,this.value+="\n```\n",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(mr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function Zb(n){return vd(n)?!n.value:Array.isArray(n)?n.every(Zb):!0}function vd(n){return n instanceof gm?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function iLe(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&nP(je.from(n.baseUri),je.from(e.baseUri)))}function nLe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function ey(n){return n.replace(/"/g,""")}function O2(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function sLe(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var MT=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function oLe(n,e){Ns(e)?n.title=$q(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class rLe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return MT(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ns(e)||e instanceof HTMLElement)o=e;else if(!jC(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Cr;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?vd(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function Uq(n,e,t,i){let s,o;const r=(u,h)=>{var f;const g=o!==void 0;u&&(o==null||o.dispose(),o=void 0),h&&(s==null||s.dispose(),s=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(u,h,f)=>new pc(()=>MT(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new rLe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new fe,h=p=>r(!1,p.fromElement===e);u.add(K(e,le.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(K(e,le.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const p=_=>{g.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&r(!0,!0)};u.add(K(e,le.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=K(e,le.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>MT(this,void 0,void 0,function*(){t=u,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),r(!0,!0)}}}function aLe(n,e={}){const t=DP(e);return t.textContent=n,t}function lLe(n,e={}){const t=DP(e);return jq(t,dLe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function DP(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class cLe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function jq(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Hi(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{jq(s,o,t,i)})}function dLe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new cLe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&RT(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&uLe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=RT(a,e);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` +`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function uLe(n,e){return RT(n,e)!==0}function RT(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const hLe=new RegExp(`(\\\\)?\\$\\((${Ae.iconNameExpression}(?:${Ae.iconModifierExpression})?)\\)`,"g");function Bh(n){const e=new Array;let t,i=0,s=0;for(;(t=hLe.exec(n))!==null;){s=t.index||0,iZ.length)&&(j=Z.length);for(var U=0,I=new Array(j);U=Z.length?{done:!0}:{done:!1,value:Z[I++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Z){e.defaults=Z}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(j){return f[j]};function p(Z,j){if(j){if(c.test(Z))return Z.replace(d,g)}else if(u.test(Z))return Z.replace(h,g);return Z}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(Z){return Z.replace(_,function(j,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var b=/(^|[^\[])\^/g;function w(Z,j){Z=typeof Z=="string"?Z:Z.source,j=j||"";var U={replace:function(T,V){return V=V.source||V,V=V.replace(b,"$1"),Z=Z.replace(T,V),U},getRegex:function(){return new RegExp(Z,j)}};return U}var y=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Z,j,U){if(Z){var I;try{I=decodeURIComponent(v(U)).replace(y,"").toLowerCase()}catch{return null}if(I.indexOf("javascript:")===0||I.indexOf("vbscript:")===0||I.indexOf("data:")===0)return null}j&&!S.test(U)&&(U=O(j,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch{return null}return U}var x={},D=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(Z,j){x[" "+Z]||(D.test(Z)?x[" "+Z]=Z+"/":x[" "+Z]=G(Z,"/",!0)),Z=x[" "+Z];var U=Z.indexOf(":")===-1;return j.substring(0,2)==="//"?U?j:Z.replace(k,"$1")+j:j.charAt(0)==="/"?U?j:Z.replace(P,"$1")+j:Z+j}var R={exec:function(){}};function M(Z){for(var j=1,U,I;j=0&&X[Ce]==="\\";)ae=!ae;return ae?"|":" |"}),I=U.split(/ \|/),T=0;if(I[0].trim()||I.shift(),I.length>0&&!I[I.length-1].trim()&&I.pop(),I.length>j)I.splice(j);else for(;I.length1;)j&1&&(U+=Z),j>>=1,Z+=Z;return U+Z}function se(Z,j,U,I){var T=j.href,V=j.title?p(j.title):null,F=Z[1].replace(/\\([\[\]])/g,"$1");if(Z[0].charAt(0)!=="!"){I.state.inLink=!0;var X={type:"link",raw:U,href:T,title:V,text:F,tokens:I.inlineTokens(F)};return I.state.inLink=!1,X}return{type:"image",raw:U,href:T,title:V,text:p(F)}}function Se(Z,j){var U=Z.match(/^(\s+)(?:```)/);if(U===null)return j;var I=U[1];return j.split(` +`).map(function(T){var V=T.match(/^\s+/);if(V===null)return T;var F=V[0];return F.length>=I.length?T.slice(I.length):T}).join(` +`)}var Ie=function(){function Z(U){this.options=U||e.defaults}var j=Z.prototype;return j.space=function(I){var T=this.rules.block.newline.exec(I);if(T&&T[0].length>0)return{type:"space",raw:T[0]}},j.code=function(I){var T=this.rules.block.code.exec(I);if(T){var V=T[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?V:G(V,` +`)}}},j.fences=function(I){var T=this.rules.block.fences.exec(I);if(T){var V=T[0],F=Se(V,T[3]||"");return{type:"code",raw:V,lang:T[2]?T[2].trim():T[2],text:F}}},j.heading=function(I){var T=this.rules.block.heading.exec(I);if(T){var V=T[2].trim();if(/#$/.test(V)){var F=G(V,"#");(this.options.pedantic||!F||/ $/.test(F))&&(V=F.trim())}return{type:"heading",raw:T[0],depth:T[1].length,text:V,tokens:this.lexer.inline(V)}}},j.hr=function(I){var T=this.rules.block.hr.exec(I);if(T)return{type:"hr",raw:T[0]}},j.blockquote=function(I){var T=this.rules.block.blockquote.exec(I);if(T){var V=T[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(V,[]),text:V}}},j.list=function(I){var T=this.rules.block.list.exec(I);if(T){var V,F,X,ae,Ce,Le,ze,Pe,At,Dt,Ne,li,ci=T[1].trim(),Xo=ci.length>1,wt={type:"list",raw:"",ordered:Xo,start:Xo?+ci.slice(0,-1):"",loose:!1,items:[]};ci=Xo?"\\d{1,9}\\"+ci.slice(-1):"\\"+ci,this.options.pedantic&&(ci=Xo?ci:"[*+-]");for(var Fi=new RegExp("^( {0,3}"+ci+")((?:[ ][^\\n]*)?(?:\\n|$))");I&&(li=!1,!(!(T=Fi.exec(I))||this.rules.block.hr.test(I)));){if(V=T[0],I=I.substring(V.length),Pe=T[2].split(` `,1)[0],At=I.split(` -`,1)[0],this.options.pedantic?(ae=2,Ne=Pe.trimLeft()):(ae=T[2].search(/[^ ]/),ae=ae>4?1:ae,Ne=Pe.slice(ae),ae+=T[1].length),Le=!1,!Pe&&/^ *$/.test(At)&&(W+=At+` -`,I=I.substring(At.length+1),ai=!0),!ai)for(var bu=new RegExp("^ {0,"+Math.min(3,ae-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),vu=new RegExp("^ {0,"+Math.min(3,ae-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Lr=new RegExp("^ {0,"+Math.min(3,ae-1)+"}(?:```|~~~)"),_c=new RegExp("^ {0,"+Math.min(3,ae-1)+"}#");I&&(Dt=I.split(` -`,1)[0],Pe=Dt,this.options.pedantic&&(Pe=Pe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Lr.test(Pe)||_c.test(Pe)||bu.test(Pe)||vu.test(I)));){if(Pe.search(/[^ ]/)>=ae||!Pe.trim())Ne+=` +`,1)[0],this.options.pedantic?(ae=2,Ne=Pe.trimLeft()):(ae=T[2].search(/[^ ]/),ae=ae>4?1:ae,Ne=Pe.slice(ae),ae+=T[1].length),Le=!1,!Pe&&/^ *$/.test(At)&&(V+=At+` +`,I=I.substring(At.length+1),li=!0),!li)for(var Su=new RegExp("^ {0,"+Math.min(3,ae-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),xu=new RegExp("^ {0,"+Math.min(3,ae-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Dr=new RegExp("^ {0,"+Math.min(3,ae-1)+"}(?:```|~~~)"),wc=new RegExp("^ {0,"+Math.min(3,ae-1)+"}#");I&&(Dt=I.split(` +`,1)[0],Pe=Dt,this.options.pedantic&&(Pe=Pe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Dr.test(Pe)||wc.test(Pe)||Su.test(Pe)||xu.test(I)));){if(Pe.search(/[^ ]/)>=ae||!Pe.trim())Ne+=` `+Pe.slice(ae);else if(!Le)Ne+=` -`+Pe;else break;!Le&&!Pe.trim()&&(Le=!0),W+=Dt+` -`,I=I.substring(Dt.length+1)}wt.loose||(Ve?wt.loose=!0:/\n *\n *$/.test(W)&&(Ve=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Ne),F&&(X=F[0]!=="[ ] ",Ne=Ne.replace(/^\[[ xX]\] +/,""))),wt.items.push({type:"list_item",raw:W,task:!!F,checked:X,loose:!1,text:Ne}),wt.raw+=W}wt.items[wt.items.length-1].raw=W.trimRight(),wt.items[wt.items.length-1].text=Ne.trimRight(),wt.raw=wt.raw.trimRight();var wu=wt.items.length;for(Ce=0;Ce1)return!0}return!1});!wt.loose&&yu.length&&Uf&&(wt.loose=!0,wt.items[Ce].loose=!0)}return wt}},j.html=function(I){var T=this.rules.block.html.exec(I);if(T){var W={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]);W.type="paragraph",W.text=F,W.tokens=this.lexer.inline(F)}return W}},j.def=function(I){var T=this.rules.block.def.exec(I);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var W=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:W,raw:T[0],href:T[2],title:T[3]}}},j.table=function(I){var T=this.rules.block.table.exec(I);if(T){var W={type:"table",header:$(T[1]).map(function(Ve){return{text:Ve}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]&&T[3].trim()?T[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(W.header.length===W.align.length){W.raw=T[0];var F=W.align.length,X,ae,Ce,Le;for(X=0;X/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]):T[0]}},j.link=function(I){var T=this.rules.inline.link.exec(I);if(T){var W=T[2].trim();if(!this.options.pedantic&&/^$/.test(W))return;var F=Y(W.slice(0,-1),"\\");if((W.length-F.length)%2===0)return}else{var X=ne(T[2],"()");if(X>-1){var ae=T[0].indexOf("!")===0?5:4,Ce=ae+T[1].length+X;T[2]=T[2].substring(0,X),T[0]=T[0].substring(0,Ce).trim(),T[3]=""}}var Le=T[2],Ve="";if(this.options.pedantic){var Pe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Pe&&(Le=Pe[1],Ve=Pe[3])}else Ve=T[3]?T[3].slice(1,-1):"";return Le=Le.trim(),/^$/.test(W)?Le=Le.slice(1):Le=Le.slice(1,-1)),se(T,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},j.reflink=function(I,T){var W;if((W=this.rules.inline.reflink.exec(I))||(W=this.rules.inline.nolink.exec(I))){var F=(W[2]||W[1]).replace(/\s+/g," ");if(F=T[F.toLowerCase()],!F||!F.href){var X=W[0].charAt(0);return{type:"text",raw:X,text:X}}return se(W,F,W[0],this.lexer)}},j.emStrong=function(I,T,W){W===void 0&&(W="");var F=this.rules.inline.emStrong.lDelim.exec(I);if(F&&!(F[3]&&W.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var X=F[1]||F[2]||"";if(!X||X&&(W===""||this.rules.inline.punctuation.exec(W))){var ae=F[0].length-1,Ce,Le,Ve=ae,Pe=0,At=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(At.lastIndex=0,T=T.slice(-1*I.length+ae);(F=At.exec(T))!=null;)if(Ce=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!Ce){if(Le=Ce.length,F[3]||F[4]){Ve+=Le;continue}else if((F[5]||F[6])&&ae%3&&!((ae+Le)%3)){Pe+=Le;continue}if(Ve-=Le,!(Ve>0)){if(Le=Math.min(Le,Le+Ve+Pe),Math.min(ae,Le)%2){var Dt=I.slice(1,ae+F.index+Le);return{type:"em",raw:I.slice(0,ae+F.index+Le+1),text:Dt,tokens:this.lexer.inlineTokens(Dt)}}var Ne=I.slice(2,ae+F.index+Le-1);return{type:"strong",raw:I.slice(0,ae+F.index+Le+1),text:Ne,tokens:this.lexer.inlineTokens(Ne)}}}}}},j.codespan=function(I){var T=this.rules.inline.code.exec(I);if(T){var W=T[2].replace(/\n/g," "),F=/[^ ]/.test(W),X=/^ /.test(W)&&/ $/.test(W);return F&&X&&(W=W.substring(1,W.length-1)),W=p(W,!0),{type:"codespan",raw:T[0],text:W}}},j.br=function(I){var T=this.rules.inline.br.exec(I);if(T)return{type:"br",raw:T[0]}},j.del=function(I){var T=this.rules.inline.del.exec(I);if(T)return{type:"del",raw:T[0],text:T[2],tokens:this.lexer.inlineTokens(T[2])}},j.autolink=function(I,T){var W=this.rules.inline.autolink.exec(I);if(W){var F,X;return W[2]==="@"?(F=p(this.options.mangle?T(W[1]):W[1]),X="mailto:"+F):(F=p(W[1]),X=F),{type:"link",raw:W[0],text:F,href:X,tokens:[{type:"text",raw:F,text:F}]}}},j.url=function(I,T){var W;if(W=this.rules.inline.url.exec(I)){var F,X;if(W[2]==="@")F=p(this.options.mangle?T(W[0]):W[0]),X="mailto:"+F;else{var ae;do ae=W[0],W[0]=this.rules.inline._backpedal.exec(W[0])[0];while(ae!==W[0]);F=p(W[0]),W[1]==="www."?X="http://"+F:X=F}return{type:"link",raw:W[0],text:F,href:X,tokens:[{type:"text",raw:F,text:F}]}}},j.inlineText=function(I,T){var W=this.rules.inline.text.exec(I);if(W){var F;return this.lexer.state.inRawBlock?F=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):p(W[0]):W[0]:F=p(this.options.smartypants?T(W[0]):W[0]),{type:"text",raw:W[0],text:F}}},Z}(),pe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=w(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.listItemStart=w(/^( *)(bull) */).replace("bull",pe.bullet).getRegex(),pe.list=w(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=/|$)/,pe.html=w(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=w(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=w(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=M({},pe),pe.gfm=M({},pe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.table=w(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.paragraph=w(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",pe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=M({},pe.normal,{html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,paragraph:w(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ee.punctuation=w(ee.punctuation).replace(/punctuation/g,ee._punctuation).getRegex(),ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ee.escapedEmSt=/\\\*|\\_/g,ee._comment=w(pe._comment).replace("(?:-->|$)","-->").getRegex(),ee.emStrong.lDelim=w(ee.emStrong.lDelim).replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimAst=w(ee.emStrong.rDelimAst,"g").replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimUnd=w(ee.emStrong.rDelimUnd,"g").replace(/punct/g,ee._punctuation).getRegex(),ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ee._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])?)+(?![-_])/,ee.autolink=w(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex(),ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ee.tag=w(ee.tag).replace("comment",ee._comment).replace("attribute",ee._attribute).getRegex(),ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ee.link=w(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex(),ee.reflink=w(ee.reflink).replace("label",ee._label).replace("ref",pe._label).getRegex(),ee.nolink=w(ee.nolink).replace("ref",pe._label).getRegex(),ee.reflinkSearch=w(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex(),ee.normal=M({},ee),ee.pedantic=M({},ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()}),ee.gfm=M({},ee.normal,{escape:w(ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(I="x"+I.toString(16)),j+="&#"+I+";";return j}var It=function(){function Z(U){this.tokens=[],this.tokens.links=Object.create(null),this.options=U||e.defaults,this.options.tokenizer=this.options.tokenizer||new Ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var I={block:pe.normal,inline:ee.normal};this.options.pedantic?(I.block=pe.pedantic,I.inline=ee.pedantic):this.options.gfm&&(I.block=pe.gfm,this.options.breaks?I.inline=ee.breaks:I.inline=ee.gfm),this.tokenizer.rules=I}Z.lex=function(I,T){var W=new Z(T);return W.lex(I)},Z.lexInline=function(I,T){var W=new Z(T);return W.inlineTokens(I)};var j=Z.prototype;return j.lex=function(I){I=I.replace(/\r\n|\r/g,` -`),this.blockTokens(I,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},j.blockTokens=function(I,T){var W=this;T===void 0&&(T=[]),this.options.pedantic?I=I.replace(/\t/g," ").replace(/^ +$/gm,""):I=I.replace(/^( *)(\t+)/gm,function(Ve,Pe,At){return Pe+" ".repeat(At.length)});for(var F,X,ae,Ce;I;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Ve){return(F=Ve.call({lexer:W},I,T))?(I=I.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.space(I)){I=I.substring(F.raw.length),F.raw.length===1&&T.length>0?T[T.length-1].raw+=` +`+Pe;else break;!Le&&!Pe.trim()&&(Le=!0),V+=Dt+` +`,I=I.substring(Dt.length+1)}wt.loose||(ze?wt.loose=!0:/\n *\n *$/.test(V)&&(ze=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Ne),F&&(X=F[0]!=="[ ] ",Ne=Ne.replace(/^\[[ xX]\] +/,""))),wt.items.push({type:"list_item",raw:V,task:!!F,checked:X,loose:!1,text:Ne}),wt.raw+=V}wt.items[wt.items.length-1].raw=V.trimRight(),wt.items[wt.items.length-1].text=Ne.trimRight(),wt.raw=wt.raw.trimRight();var Lu=wt.items.length;for(Ce=0;Ce1)return!0}return!1});!wt.loose&&Du.length&&Uf&&(wt.loose=!0,wt.items[Ce].loose=!0)}return wt}},j.html=function(I){var T=this.rules.block.html.exec(I);if(T){var V={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]);V.type="paragraph",V.text=F,V.tokens=this.lexer.inline(F)}return V}},j.def=function(I){var T=this.rules.block.def.exec(I);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var V=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:V,raw:T[0],href:T[2],title:T[3]}}},j.table=function(I){var T=this.rules.block.table.exec(I);if(T){var V={type:"table",header:W(T[1]).map(function(ze){return{text:ze}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]&&T[3].trim()?T[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(V.header.length===V.align.length){V.raw=T[0];var F=V.align.length,X,ae,Ce,Le;for(X=0;X/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]):T[0]}},j.link=function(I){var T=this.rules.inline.link.exec(I);if(T){var V=T[2].trim();if(!this.options.pedantic&&/^$/.test(V))return;var F=G(V.slice(0,-1),"\\");if((V.length-F.length)%2===0)return}else{var X=ne(T[2],"()");if(X>-1){var ae=T[0].indexOf("!")===0?5:4,Ce=ae+T[1].length+X;T[2]=T[2].substring(0,X),T[0]=T[0].substring(0,Ce).trim(),T[3]=""}}var Le=T[2],ze="";if(this.options.pedantic){var Pe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Pe&&(Le=Pe[1],ze=Pe[3])}else ze=T[3]?T[3].slice(1,-1):"";return Le=Le.trim(),/^$/.test(V)?Le=Le.slice(1):Le=Le.slice(1,-1)),se(T,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},j.reflink=function(I,T){var V;if((V=this.rules.inline.reflink.exec(I))||(V=this.rules.inline.nolink.exec(I))){var F=(V[2]||V[1]).replace(/\s+/g," ");if(F=T[F.toLowerCase()],!F||!F.href){var X=V[0].charAt(0);return{type:"text",raw:X,text:X}}return se(V,F,V[0],this.lexer)}},j.emStrong=function(I,T,V){V===void 0&&(V="");var F=this.rules.inline.emStrong.lDelim.exec(I);if(F&&!(F[3]&&V.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var X=F[1]||F[2]||"";if(!X||X&&(V===""||this.rules.inline.punctuation.exec(V))){var ae=F[0].length-1,Ce,Le,ze=ae,Pe=0,At=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(At.lastIndex=0,T=T.slice(-1*I.length+ae);(F=At.exec(T))!=null;)if(Ce=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!Ce){if(Le=Ce.length,F[3]||F[4]){ze+=Le;continue}else if((F[5]||F[6])&&ae%3&&!((ae+Le)%3)){Pe+=Le;continue}if(ze-=Le,!(ze>0)){if(Le=Math.min(Le,Le+ze+Pe),Math.min(ae,Le)%2){var Dt=I.slice(1,ae+F.index+Le);return{type:"em",raw:I.slice(0,ae+F.index+Le+1),text:Dt,tokens:this.lexer.inlineTokens(Dt)}}var Ne=I.slice(2,ae+F.index+Le-1);return{type:"strong",raw:I.slice(0,ae+F.index+Le+1),text:Ne,tokens:this.lexer.inlineTokens(Ne)}}}}}},j.codespan=function(I){var T=this.rules.inline.code.exec(I);if(T){var V=T[2].replace(/\n/g," "),F=/[^ ]/.test(V),X=/^ /.test(V)&&/ $/.test(V);return F&&X&&(V=V.substring(1,V.length-1)),V=p(V,!0),{type:"codespan",raw:T[0],text:V}}},j.br=function(I){var T=this.rules.inline.br.exec(I);if(T)return{type:"br",raw:T[0]}},j.del=function(I){var T=this.rules.inline.del.exec(I);if(T)return{type:"del",raw:T[0],text:T[2],tokens:this.lexer.inlineTokens(T[2])}},j.autolink=function(I,T){var V=this.rules.inline.autolink.exec(I);if(V){var F,X;return V[2]==="@"?(F=p(this.options.mangle?T(V[1]):V[1]),X="mailto:"+F):(F=p(V[1]),X=F),{type:"link",raw:V[0],text:F,href:X,tokens:[{type:"text",raw:F,text:F}]}}},j.url=function(I,T){var V;if(V=this.rules.inline.url.exec(I)){var F,X;if(V[2]==="@")F=p(this.options.mangle?T(V[0]):V[0]),X="mailto:"+F;else{var ae;do ae=V[0],V[0]=this.rules.inline._backpedal.exec(V[0])[0];while(ae!==V[0]);F=p(V[0]),V[1]==="www."?X="http://"+F:X=F}return{type:"link",raw:V[0],text:F,href:X,tokens:[{type:"text",raw:F,text:F}]}}},j.inlineText=function(I,T){var V=this.rules.inline.text.exec(I);if(V){var F;return this.lexer.state.inRawBlock?F=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(V[0]):p(V[0]):V[0]:F=p(this.options.smartypants?T(V[0]):V[0]),{type:"text",raw:V[0],text:F}}},Z}(),pe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:R,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=w(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.listItemStart=w(/^( *)(bull) */).replace("bull",pe.bullet).getRegex(),pe.list=w(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=/|$)/,pe.html=w(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=w(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=w(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=M({},pe),pe.gfm=M({},pe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.table=w(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.paragraph=w(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",pe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=M({},pe.normal,{html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:R,paragraph:w(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:R,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:R,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ee.punctuation=w(ee.punctuation).replace(/punctuation/g,ee._punctuation).getRegex(),ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ee.escapedEmSt=/\\\*|\\_/g,ee._comment=w(pe._comment).replace("(?:-->|$)","-->").getRegex(),ee.emStrong.lDelim=w(ee.emStrong.lDelim).replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimAst=w(ee.emStrong.rDelimAst,"g").replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimUnd=w(ee.emStrong.rDelimUnd,"g").replace(/punct/g,ee._punctuation).getRegex(),ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ee._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])?)+(?![-_])/,ee.autolink=w(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex(),ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ee.tag=w(ee.tag).replace("comment",ee._comment).replace("attribute",ee._attribute).getRegex(),ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ee.link=w(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex(),ee.reflink=w(ee.reflink).replace("label",ee._label).replace("ref",pe._label).getRegex(),ee.nolink=w(ee.nolink).replace("ref",pe._label).getRegex(),ee.reflinkSearch=w(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex(),ee.normal=M({},ee),ee.pedantic=M({},ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()}),ee.gfm=M({},ee.normal,{escape:w(ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(I="x"+I.toString(16)),j+="&#"+I+";";return j}var It=function(){function Z(U){this.tokens=[],this.tokens.links=Object.create(null),this.options=U||e.defaults,this.options.tokenizer=this.options.tokenizer||new Ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var I={block:pe.normal,inline:ee.normal};this.options.pedantic?(I.block=pe.pedantic,I.inline=ee.pedantic):this.options.gfm&&(I.block=pe.gfm,this.options.breaks?I.inline=ee.breaks:I.inline=ee.gfm),this.tokenizer.rules=I}Z.lex=function(I,T){var V=new Z(T);return V.lex(I)},Z.lexInline=function(I,T){var V=new Z(T);return V.inlineTokens(I)};var j=Z.prototype;return j.lex=function(I){I=I.replace(/\r\n|\r/g,` +`),this.blockTokens(I,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},j.blockTokens=function(I,T){var V=this;T===void 0&&(T=[]),this.options.pedantic?I=I.replace(/\t/g," ").replace(/^ +$/gm,""):I=I.replace(/^( *)(\t+)/gm,function(ze,Pe,At){return Pe+" ".repeat(At.length)});for(var F,X,ae,Ce;I;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(ze){return(F=ze.call({lexer:V},I,T))?(I=I.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.space(I)){I=I.substring(F.raw.length),F.raw.length===1&&T.length>0?T[T.length-1].raw+=` `:T.push(F);continue}if(F=this.tokenizer.code(I)){I=I.substring(F.raw.length),X=T[T.length-1],X&&(X.type==="paragraph"||X.type==="text")?(X.raw+=` `+F.raw,X.text+=` `+F.text,this.inlineQueue[this.inlineQueue.length-1].src=X.text):T.push(F);continue}if(F=this.tokenizer.fences(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.heading(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.hr(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.blockquote(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.list(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.html(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.def(I)){I=I.substring(F.raw.length),X=T[T.length-1],X&&(X.type==="paragraph"||X.type==="text")?(X.raw+=` `+F.raw,X.text+=` -`+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=X.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.lheading(I)){I=I.substring(F.raw.length),T.push(F);continue}if(ae=I,this.options.extensions&&this.options.extensions.startBlock&&function(){var Ve=1/0,Pe=I.slice(1),At=void 0;W.options.extensions.startBlock.forEach(function(Dt){At=Dt.call({lexer:this},Pe),typeof At=="number"&&At>=0&&(Ve=Math.min(Ve,At))}),Ve<1/0&&Ve>=0&&(ae=I.substring(0,Ve+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ae))){X=T[T.length-1],Ce&&X.type==="paragraph"?(X.raw+=` +`+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=X.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.lheading(I)){I=I.substring(F.raw.length),T.push(F);continue}if(ae=I,this.options.extensions&&this.options.extensions.startBlock&&function(){var ze=1/0,Pe=I.slice(1),At=void 0;V.options.extensions.startBlock.forEach(function(Dt){At=Dt.call({lexer:this},Pe),typeof At=="number"&&At>=0&&(ze=Math.min(ze,At))}),ze<1/0&&ze>=0&&(ae=I.substring(0,ze+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ae))){X=T[T.length-1],Ce&&X.type==="paragraph"?(X.raw+=` `+F.raw,X.text+=` `+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=X.text):T.push(F),Ce=ae.length!==I.length,I=I.substring(F.raw.length);continue}if(F=this.tokenizer.text(I)){I=I.substring(F.raw.length),X=T[T.length-1],X&&X.type==="text"?(X.raw+=` `+F.raw,X.text+=` -`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=X.text):T.push(F);continue}if(I){var Le="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(Le);break}else throw new Error(Le)}}return this.state.top=!0,T},j.inline=function(I,T){return T===void 0&&(T=[]),this.inlineQueue.push({src:I,tokens:T}),T},j.inlineTokens=function(I,T){var W=this;T===void 0&&(T=[]);var F,X,ae,Ce=I,Le,Ve,Pe;if(this.tokens.links){var At=Object.keys(this.tokens.links);if(At.length>0)for(;(Le=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)At.includes(Le[0].slice(Le[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,Le.index)+"["+ge("a",Le[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Le=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,Le.index)+"["+ge("a",Le[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Le=this.tokenizer.rules.inline.escapedEmSt.exec(Ce))!=null;)Ce=Ce.slice(0,Le.index)+"++"+Ce.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;I;)if(Ve||(Pe=""),Ve=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Ne){return(F=Ne.call({lexer:W},I,T))?(I=I.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.escape(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.tag(I)){I=I.substring(F.raw.length),X=T[T.length-1],X&&F.type==="text"&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(F=this.tokenizer.link(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.reflink(I,this.tokens.links)){I=I.substring(F.raw.length),X=T[T.length-1],X&&F.type==="text"&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(F=this.tokenizer.emStrong(I,Ce,Pe)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.codespan(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.br(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.del(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.autolink(I,xt)){I=I.substring(F.raw.length),T.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(I,xt))){I=I.substring(F.raw.length),T.push(F);continue}if(ae=I,this.options.extensions&&this.options.extensions.startInline&&function(){var Ne=1/0,ai=I.slice(1),li=void 0;W.options.extensions.startInline.forEach(function(Xo){li=Xo.call({lexer:this},ai),typeof li=="number"&&li>=0&&(Ne=Math.min(Ne,li))}),Ne<1/0&&Ne>=0&&(ae=I.substring(0,Ne+1))}(),F=this.tokenizer.inlineText(ae,Gt)){I=I.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Pe=F.raw.slice(-1)),Ve=!0,X=T[T.length-1],X&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(I){var Dt="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return T},i(Z,null,[{key:"rules",get:function(){return{block:pe,inline:ee}}}]),Z}(),je=function(){function Z(U){this.options=U||e.defaults}var j=Z.prototype;return j.code=function(I,T,W){var F=(T||"").match(/\S*/)[0];if(this.options.highlight){var X=this.options.highlight(I,F);X!=null&&X!==I&&(W=!0,I=X)}return I=I.replace(/\n$/,"")+` -`,F?'
'+(W?I:p(I,!0))+`
-`:"
"+(W?I:p(I,!0))+`
+`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=X.text):T.push(F);continue}if(I){var Le="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(Le);break}else throw new Error(Le)}}return this.state.top=!0,T},j.inline=function(I,T){return T===void 0&&(T=[]),this.inlineQueue.push({src:I,tokens:T}),T},j.inlineTokens=function(I,T){var V=this;T===void 0&&(T=[]);var F,X,ae,Ce=I,Le,ze,Pe;if(this.tokens.links){var At=Object.keys(this.tokens.links);if(At.length>0)for(;(Le=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)At.includes(Le[0].slice(Le[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,Le.index)+"["+ge("a",Le[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Le=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,Le.index)+"["+ge("a",Le[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Le=this.tokenizer.rules.inline.escapedEmSt.exec(Ce))!=null;)Ce=Ce.slice(0,Le.index)+"++"+Ce.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;I;)if(ze||(Pe=""),ze=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Ne){return(F=Ne.call({lexer:V},I,T))?(I=I.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.escape(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.tag(I)){I=I.substring(F.raw.length),X=T[T.length-1],X&&F.type==="text"&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(F=this.tokenizer.link(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.reflink(I,this.tokens.links)){I=I.substring(F.raw.length),X=T[T.length-1],X&&F.type==="text"&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(F=this.tokenizer.emStrong(I,Ce,Pe)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.codespan(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.br(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.del(I)){I=I.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.autolink(I,xt)){I=I.substring(F.raw.length),T.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(I,xt))){I=I.substring(F.raw.length),T.push(F);continue}if(ae=I,this.options.extensions&&this.options.extensions.startInline&&function(){var Ne=1/0,li=I.slice(1),ci=void 0;V.options.extensions.startInline.forEach(function(Xo){ci=Xo.call({lexer:this},li),typeof ci=="number"&&ci>=0&&(Ne=Math.min(Ne,ci))}),Ne<1/0&&Ne>=0&&(ae=I.substring(0,Ne+1))}(),F=this.tokenizer.inlineText(ae,Kt)){I=I.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Pe=F.raw.slice(-1)),ze=!0,X=T[T.length-1],X&&X.type==="text"?(X.raw+=F.raw,X.text+=F.text):T.push(F);continue}if(I){var Dt="Infinite loop on byte: "+I.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return T},i(Z,null,[{key:"rules",get:function(){return{block:pe,inline:ee}}}]),Z}(),Ge=function(){function Z(U){this.options=U||e.defaults}var j=Z.prototype;return j.code=function(I,T,V){var F=(T||"").match(/\S*/)[0];if(this.options.highlight){var X=this.options.highlight(I,F);X!=null&&X!==I&&(V=!0,I=X)}return I=I.replace(/\n$/,"")+` +`,F?'
'+(V?I:p(I,!0))+`
+`:"
"+(V?I:p(I,!0))+`
`},j.blockquote=function(I){return`
`+I+`
-`},j.html=function(I){return I},j.heading=function(I,T,W,F){if(this.options.headerIds){var X=this.options.headerPrefix+F.slug(W);return"'+I+" +`},j.html=function(I){return I},j.heading=function(I,T,V,F){if(this.options.headerIds){var X=this.options.headerPrefix+F.slug(V);return"'+I+" `}return""+I+" `},j.hr=function(){return this.options.xhtml?`
`:`
-`},j.list=function(I,T,W){var F=T?"ol":"ul",X=T&&W!==1?' start="'+W+'"':"";return"<"+F+X+`> +`},j.list=function(I,T,V){var F=T?"ol":"ul",X=T&&V!==1?' start="'+V+'"':"";return"<"+F+X+`> `+I+" `},j.listitem=function(I){return"
  • "+I+`
  • `},j.checkbox=function(I){return" "},j.paragraph=function(I){return"

    "+I+`

    @@ -2737,30 +2784,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+T+` `},j.tablerow=function(I){return` `+I+` -`},j.tablecell=function(I,T){var W=T.header?"th":"td",F=T.align?"<"+W+' align="'+T.align+'">':"<"+W+">";return F+I+(" -`)},j.strong=function(I){return""+I+""},j.em=function(I){return""+I+""},j.codespan=function(I){return""+I+""},j.br=function(){return this.options.xhtml?"
    ":"
    "},j.del=function(I){return""+I+""},j.link=function(I,T,W){if(I=L(this.options.sanitize,this.options.baseUrl,I),I===null)return W;var F='",F},j.image=function(I,T,W){if(I=L(this.options.sanitize,this.options.baseUrl,I),I===null)return W;var F=''+W+'":">",F},j.text=function(I){return I},Z}(),ei=function(){function Z(){}var j=Z.prototype;return j.strong=function(I){return I},j.em=function(I){return I},j.codespan=function(I){return I},j.del=function(I){return I},j.html=function(I){return I},j.text=function(I){return I},j.link=function(I,T,W){return""+W},j.image=function(I,T,W){return""+W},j.br=function(){return""},Z}(),De=function(){function Z(){this.seen={}}var j=Z.prototype;return j.serialize=function(I){return I.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},j.getNextSafeSlug=function(I,T){var W=I,F=0;if(this.seen.hasOwnProperty(W)){F=this.seen[I];do F++,W=I+"-"+F;while(this.seen.hasOwnProperty(W))}return T||(this.seen[I]=F,this.seen[W]=0),W},j.slug=function(I,T){T===void 0&&(T={});var W=this.serialize(I);return this.getNextSafeSlug(W,T.dryrun)},Z}(),Be=function(){function Z(U){this.options=U||e.defaults,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ei,this.slugger=new De}Z.parse=function(I,T){var W=new Z(T);return W.parse(I)},Z.parseInline=function(I,T){var W=new Z(T);return W.parseInline(I)};var j=Z.prototype;return j.parse=function(I,T){T===void 0&&(T=!0);var W="",F,X,ae,Ce,Le,Ve,Pe,At,Dt,Ne,ai,li,Xo,wt,Fi,bu,vu,Lr,_c,wu=I.length;for(F=0;F0&&Fi.tokens[0].type==="paragraph"?(Fi.tokens[0].text=Lr+" "+Fi.tokens[0].text,Fi.tokens[0].tokens&&Fi.tokens[0].tokens.length>0&&Fi.tokens[0].tokens[0].type==="text"&&(Fi.tokens[0].tokens[0].text=Lr+" "+Fi.tokens[0].tokens[0].text)):Fi.tokens.unshift({type:"text",text:Lr}):wt+=Lr),wt+=this.parse(Fi.tokens,Xo),Dt+=this.renderer.listitem(wt,vu,bu);W+=this.renderer.list(Dt,ai,li);continue}case"html":{W+=this.renderer.html(Ne.text);continue}case"paragraph":{W+=this.renderer.paragraph(this.parseInline(Ne.tokens));continue}case"text":{for(Dt=Ne.tokens?this.parseInline(Ne.tokens):Ne.text;F+1"u"||Z===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");if(typeof j=="function"&&(U=j,j=null),j=M({},he.defaults,j||{}),ce(j),U){var I=j.highlight,T;try{T=It.lex(Z,j)}catch(Ce){return U(Ce)}var W=function(Le){var Ve;if(!Le)try{j.walkTokens&&he.walkTokens(T,j.walkTokens),Ve=Be.parse(T,j)}catch(Pe){Le=Pe}return j.highlight=I,Le?U(Le):U(null,Ve)};if(!I||I.length<3||(delete j.highlight,!T.length))return W();var F=0;he.walkTokens(T,function(Ce){Ce.type==="code"&&(F++,setTimeout(function(){I(Ce.text,Ce.lang,function(Le,Ve){if(Le)return W(Le);Ve!=null&&Ve!==Ce.text&&(Ce.text=Ve,Ce.escaped=!0),F--,F===0&&W()})},0))}),F===0&&W();return}function X(Ce){if(Ce.message+=` -Please report this to https://github.com/markedjs/marked.`,j.silent)return"

    An error occurred:

    "+p(Ce.message+"",!0)+"
    ";throw Ce}try{var ae=It.lex(Z,j);if(j.walkTokens){if(j.async)return Promise.all(he.walkTokens(ae,j.walkTokens)).then(function(){return Be.parse(ae,j)}).catch(X);he.walkTokens(ae,j.walkTokens)}return Be.parse(ae,j)}catch(Ce){X(Ce)}}he.options=he.setOptions=function(Z){return M(he.defaults,Z),l(he.defaults),he},he.getDefaults=a,he.defaults=e.defaults,he.use=function(){for(var Z=arguments.length,j=new Array(Z),U=0;U"u"||Z===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");j=M({},he.defaults,j||{}),ce(j);try{var U=It.lexInline(Z,j);return j.walkTokens&&he.walkTokens(U,j.walkTokens),Be.parseInline(U,j)}catch(I){if(I.message+=` -Please report this to https://github.com/markedjs/marked.`,j.silent)return"

    An error occurred:

    "+p(I.message+"",!0)+"
    ";throw I}},he.Parser=Be,he.parser=Be.parse,he.Renderer=je,he.TextRenderer=ei,he.Lexer=It,he.lexer=It.lex,he.Tokenizer=Ie,he.Slugger=De,he.parse=he;var ue=he.options,xi=he.setOptions,Lt=he.use,Et=he.walkTokens,pi=he.parseInline,Zo=he,_u=Be.parse,OD=It.lex;e.Lexer=It,e.Parser=Be,e.Renderer=je,e.Slugger=De,e.TextRenderer=ei,e.Tokenizer=Ie,e.getDefaults=a,e.lexer=OD,e.marked=he,e.options=ue,e.parse=Zo,e.parseInline=pi,e.parser=_u,e.setOptions=xi,e.use=Lt,e.walkTokens=Et,Object.defineProperty(e,"__esModule",{value:!0})})})();ps.Lexer||exports.Lexer;ps.Parser||exports.Parser;ps.Renderer||exports.Renderer;ps.Slugger||exports.Slugger;ps.TextRenderer||exports.TextRenderer;ps.Tokenizer||exports.Tokenizer;ps.getDefaults||exports.getDefaults;ps.lexer||exports.lexer;var ka=ps.marked||exports.marked;ps.options||exports.options;ps.parse||exports.parse;ps.parseInline||exports.parseInline;ps.parser||exports.parser;ps.setOptions||exports.setOptions;ps.use||exports.use;ps.walkTokens||exports.walkTokens;function Gxe(n){return JSON.stringify(n,Kxe)}function kT(n){let e=JSON.parse(n);return e=ET(e),e}function Kxe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function ET(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return $e.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof p4||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=Bxe(n),s.push(`src="${Gw(n)}"`)),t&&s.push(`alt="${Gw(t)}"`),e&&s.push(`title="${Gw(e)}"`),i.length&&(s=s.concat(i)),""},paragraph:n=>`

    ${n}

    `,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=A2(t)),e=typeof e=="string"?Gw(A2(e)):"",n=A2(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function sD(n,e={},t={}){var i,s;const o=new fe;let r=!1;const a=pP(e),l=function(v){let b;try{b=kT(decodeURIComponent(v))}catch{}return b?(b=s$(b,w=>{if(n.uris&&n.uris[w])return $e.revive(n.uris[w])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const w=n.uris&&n.uris[v];let y=$e.revive(w);return b?v.startsWith(it.data+":")?v:(y||(y=$e.parse(v)),X$.uriToBrowserUri(y).toString(!0)):!y||$e.parse(v).toString()===y.toString()?v:(y.query&&(y=y.with({query:l(y.query)})),y.toString())},d=new ka.Renderer;d.image=T2.image,d.link=T2.link,d.paragraph=T2.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const w=DT.nextId(),y=e.codeBlockRendererSync(u8(b),v);return h.push([w,y]),`
    ${YC(v)}
    `}:e.codeBlockRenderer&&(d.code=(v,b)=>{const w=DT.nextId(),y=e.codeBlockRenderer(u8(b),v);return u.push(y.then(S=>[w,S])),`
    ${YC(v)}
    `}),e.actionHandler){const v=function(y){let S=y.target;if(!(S.tagName!=="A"&&(S=S.parentElement,!S||S.tagName!=="A")))try{let L=S.dataset.href;L&&(n.baseUri&&(L=N2($e.from(n.baseUri),L)),e.actionHandler.callback(L,y))}catch(L){pt(L)}finally{y.preventDefault()}},b=e.actionHandler.disposables.add(new rt(a,"click")),w=e.actionHandler.disposables.add(new rt(a,"auxclick"));e.actionHandler.disposables.add(de.any(b.event,w.event)(y=>{const S=new rr(y);!S.leftButton&&!S.middleButton||v(S)})),e.actionHandler.disposables.add(G(a,"keydown",y=>{const S=new Wt(y);!S.equals(10)&&!S.equals(3)||v(S)}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=Mxe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},ka.defaults),t),b=ka.lexer(f,v),w=iLe(b);g=ka.parser(w,v)}else g=ka.parse(f,t);n.supportThemeIcons&&(g=Fh(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(IT(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let w=b;try{n.baseUri&&(w=N2($e.from(n.baseUri),w))}catch{}v.src=c(w,!0)}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let w=c(b,!1);n.baseUri&&(w=N2($e.from(n.baseUri),b)),v.dataset.href=w}}),a.innerHTML=IT(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,w;if(r)return;const y=new Map(v),S=a.querySelectorAll("div[data-code]");for(const L of S){const x=y.get((b=L.dataset.code)!==null&&b!==void 0?b:"");x&&ds(L,x)}(w=e.asyncRenderCallback)===null||w===void 0||w.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const w of b){const y=v.get((s=w.dataset.code)!==null&&s!==void 0?s:"");y&&ds(w,y)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(G(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function u8(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function N2(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?s7(n,e).toString():s7(G4(n),e).toString()}function IT(n,e){const{config:t,allowedSchemes:i}=Zxe(n);K$("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const s=Uge(i);try{return G$(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{Y$("uponSanitizeAttribute"),s.dispose()}}const Yxe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Zxe(n){const e=[it.http,it.https,it.mailto,it.data,it.file,it.vscodeFileResource,it.vscodeRemote,it.vscodeRemoteResource];return n.isTrusted&&e.push(it.command),{config:{ALLOWED_TAGS:[...jge],ALLOWED_ATTR:Yxe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Xxe(n){return typeof n=="string"?n:Qxe(n)}function Qxe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=ka.parse(t,{renderer:eLe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=Jxe.get(s))!==null&&o!==void 0?o:s});return IT({isTrusted:!1},i).toString()}const Jxe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),eLe=new Sf(()=>{const n=new ka.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` +`},j.tablecell=function(I,T){var V=T.header?"th":"td",F=T.align?"<"+V+' align="'+T.align+'">':"<"+V+">";return F+I+(" +`)},j.strong=function(I){return""+I+""},j.em=function(I){return""+I+""},j.codespan=function(I){return""+I+""},j.br=function(){return this.options.xhtml?"
    ":"
    "},j.del=function(I){return""+I+""},j.link=function(I,T,V){if(I=L(this.options.sanitize,this.options.baseUrl,I),I===null)return V;var F='",F},j.image=function(I,T,V){if(I=L(this.options.sanitize,this.options.baseUrl,I),I===null)return V;var F=''+V+'":">",F},j.text=function(I){return I},Z}(),ti=function(){function Z(){}var j=Z.prototype;return j.strong=function(I){return I},j.em=function(I){return I},j.codespan=function(I){return I},j.del=function(I){return I},j.html=function(I){return I},j.text=function(I){return I},j.link=function(I,T,V){return""+V},j.image=function(I,T,V){return""+V},j.br=function(){return""},Z}(),De=function(){function Z(){this.seen={}}var j=Z.prototype;return j.serialize=function(I){return I.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},j.getNextSafeSlug=function(I,T){var V=I,F=0;if(this.seen.hasOwnProperty(V)){F=this.seen[I];do F++,V=I+"-"+F;while(this.seen.hasOwnProperty(V))}return T||(this.seen[I]=F,this.seen[V]=0),V},j.slug=function(I,T){T===void 0&&(T={});var V=this.serialize(I);return this.getNextSafeSlug(V,T.dryrun)},Z}(),Ve=function(){function Z(U){this.options=U||e.defaults,this.options.renderer=this.options.renderer||new Ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ti,this.slugger=new De}Z.parse=function(I,T){var V=new Z(T);return V.parse(I)},Z.parseInline=function(I,T){var V=new Z(T);return V.parseInline(I)};var j=Z.prototype;return j.parse=function(I,T){T===void 0&&(T=!0);var V="",F,X,ae,Ce,Le,ze,Pe,At,Dt,Ne,li,ci,Xo,wt,Fi,Su,xu,Dr,wc,Lu=I.length;for(F=0;F0&&Fi.tokens[0].type==="paragraph"?(Fi.tokens[0].text=Dr+" "+Fi.tokens[0].text,Fi.tokens[0].tokens&&Fi.tokens[0].tokens.length>0&&Fi.tokens[0].tokens[0].type==="text"&&(Fi.tokens[0].tokens[0].text=Dr+" "+Fi.tokens[0].tokens[0].text)):Fi.tokens.unshift({type:"text",text:Dr}):wt+=Dr),wt+=this.parse(Fi.tokens,Xo),Dt+=this.renderer.listitem(wt,xu,Su);V+=this.renderer.list(Dt,li,ci);continue}case"html":{V+=this.renderer.html(Ne.text);continue}case"paragraph":{V+=this.renderer.paragraph(this.parseInline(Ne.tokens));continue}case"text":{for(Dt=Ne.tokens?this.parseInline(Ne.tokens):Ne.text;F+1"u"||Z===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");if(typeof j=="function"&&(U=j,j=null),j=M({},he.defaults,j||{}),ce(j),U){var I=j.highlight,T;try{T=It.lex(Z,j)}catch(Ce){return U(Ce)}var V=function(Le){var ze;if(!Le)try{j.walkTokens&&he.walkTokens(T,j.walkTokens),ze=Ve.parse(T,j)}catch(Pe){Le=Pe}return j.highlight=I,Le?U(Le):U(null,ze)};if(!I||I.length<3||(delete j.highlight,!T.length))return V();var F=0;he.walkTokens(T,function(Ce){Ce.type==="code"&&(F++,setTimeout(function(){I(Ce.text,Ce.lang,function(Le,ze){if(Le)return V(Le);ze!=null&&ze!==Ce.text&&(Ce.text=ze,Ce.escaped=!0),F--,F===0&&V()})},0))}),F===0&&V();return}function X(Ce){if(Ce.message+=` +Please report this to https://github.com/markedjs/marked.`,j.silent)return"

    An error occurred:

    "+p(Ce.message+"",!0)+"
    ";throw Ce}try{var ae=It.lex(Z,j);if(j.walkTokens){if(j.async)return Promise.all(he.walkTokens(ae,j.walkTokens)).then(function(){return Ve.parse(ae,j)}).catch(X);he.walkTokens(ae,j.walkTokens)}return Ve.parse(ae,j)}catch(Ce){X(Ce)}}he.options=he.setOptions=function(Z){return M(he.defaults,Z),l(he.defaults),he},he.getDefaults=a,he.defaults=e.defaults,he.use=function(){for(var Z=arguments.length,j=new Array(Z),U=0;U"u"||Z===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");j=M({},he.defaults,j||{}),ce(j);try{var U=It.lexInline(Z,j);return j.walkTokens&&he.walkTokens(U,j.walkTokens),Ve.parseInline(U,j)}catch(I){if(I.message+=` +Please report this to https://github.com/markedjs/marked.`,j.silent)return"

    An error occurred:

    "+p(I.message+"",!0)+"
    ";throw I}},he.Parser=Ve,he.parser=Ve.parse,he.Renderer=Ge,he.TextRenderer=ti,he.Lexer=It,he.lexer=It.lex,he.Tokenizer=Ie,he.Slugger=De,he.parse=he;var ue=he.options,Di=he.setOptions,Lt=he.use,Et=he.walkTokens,mi=he.parseInline,Zo=he,Cu=Ve.parse,UD=It.lex;e.Lexer=It,e.Parser=Ve,e.Renderer=Ge,e.Slugger=De,e.TextRenderer=ti,e.Tokenizer=Ie,e.getDefaults=a,e.lexer=UD,e.marked=he,e.options=ue,e.parse=Zo,e.parseInline=mi,e.parser=Cu,e.setOptions=Di,e.use=Lt,e.walkTokens=Et,Object.defineProperty(e,"__esModule",{value:!0})})})();gs.Lexer||exports.Lexer;gs.Parser||exports.Parser;gs.Renderer||exports.Renderer;gs.Slugger||exports.Slugger;gs.TextRenderer||exports.TextRenderer;gs.Tokenizer||exports.Tokenizer;gs.getDefaults||exports.getDefaults;gs.lexer||exports.lexer;var ka=gs.marked||exports.marked;gs.options||exports.options;gs.parse||exports.parse;gs.parseInline||exports.parseInline;gs.parser||exports.parser;gs.setOptions||exports.setOptions;gs.use||exports.use;gs.walkTokens||exports.walkTokens;function fLe(n){return JSON.stringify(n,gLe)}function FT(n){let e=JSON.parse(n);return e=BT(e),e}function gLe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function BT(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return je.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof D4||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=sLe(n),s.push(`src="${ey(n)}"`)),t&&s.push(`alt="${ey(t)}"`),e&&s.push(`title="${ey(e)}"`),i.length&&(s=s.concat(i)),""},paragraph:n=>`

    ${n}

    `,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=O2(t)),e=typeof e=="string"?ey(O2(e)):"",n=O2(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function hD(n,e={},t={}){var i,s;const o=new fe;let r=!1;const a=DP(e),l=function(v){let b;try{b=FT(decodeURIComponent(v))}catch{}return b?(b=y$(b,w=>{if(n.uris&&n.uris[w])return je.revive(n.uris[w])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const w=n.uris&&n.uris[v];let y=je.revive(w);return b?v.startsWith(it.data+":")?v:(y||(y=je.parse(v)),gU.uriToBrowserUri(y).toString(!0)):!y||je.parse(v).toString()===y.toString()?v:(y.query&&(y=y.with({query:l(y.query)})),y.toString())},d=new ka.Renderer;d.image=F2.image,d.link=F2.link,d.paragraph=F2.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const w=OT.nextId(),y=e.codeBlockRendererSync(x8(b),v);return h.push([w,y]),`
    ${JC(v)}
    `}:e.codeBlockRenderer&&(d.code=(v,b)=>{const w=OT.nextId(),y=e.codeBlockRenderer(x8(b),v);return u.push(y.then(S=>[w,S])),`
    ${JC(v)}
    `}),e.actionHandler){const v=function(y){let S=y.target;if(!(S.tagName!=="A"&&(S=S.parentElement,!S||S.tagName!=="A")))try{let L=S.dataset.href;L&&(n.baseUri&&(L=B2(je.from(n.baseUri),L)),e.actionHandler.callback(L,y))}catch(L){pt(L)}finally{y.preventDefault()}},b=e.actionHandler.disposables.add(new rt(a,"click")),w=e.actionHandler.disposables.add(new rt(a,"auxclick"));e.actionHandler.disposables.add(de.any(b.event,w.event)(y=>{const S=new rr(y);!S.leftButton&&!S.middleButton||v(S)})),e.actionHandler.disposables.add(K(a,"keydown",y=>{const S=new Wt(y);!S.equals(10)&&!S.equals(3)||v(S)}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=Jxe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},ka.defaults),t),b=ka.lexer(f,v),w=CLe(b);g=ka.parser(w,v)}else g=ka.parse(f,t);n.supportThemeIcons&&(g=Bh(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(WT(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let w=b;try{n.baseUri&&(w=B2(je.from(n.baseUri),w))}catch{}v.src=c(w,!0)}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let w=c(b,!1);n.baseUri&&(w=B2(je.from(n.baseUri),b)),v.dataset.href=w}}),a.innerHTML=WT(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,w;if(r)return;const y=new Map(v),S=a.querySelectorAll("div[data-code]");for(const L of S){const x=y.get((b=L.dataset.code)!==null&&b!==void 0?b:"");x&&cs(L,x)}(w=e.asyncRenderCallback)===null||w===void 0||w.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const w of b){const y=v.get((s=w.dataset.code)!==null&&s!==void 0?s:"");y&&cs(w,y)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(K(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function x8(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function B2(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?_7(n,e).toString():_7(sP(n),e).toString()}function WT(n,e){const{config:t,allowedSchemes:i}=mLe(n);uU("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const s=dpe(i);try{return dU(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{hU("uponSanitizeAttribute"),s.dispose()}}const pLe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function mLe(n){const e=[it.http,it.https,it.mailto,it.data,it.file,it.vscodeFileResource,it.vscodeRemote,it.vscodeRemoteResource];return n.isTrusted&&e.push(it.command),{config:{ALLOWED_TAGS:[...upe],ALLOWED_ATTR:pLe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function _Le(n){return typeof n=="string"?n:bLe(n)}function bLe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=ka.parse(t,{renderer:wLe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=vLe.get(s))!==null&&o!==void 0?o:s});return WT({isTrusted:!1},i).toString()}const vLe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),wLe=new Sf(()=>{const n=new ka.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` `,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+` `,n.paragraph=e=>e+` `,n.table=(e,t)=>e+t+` `,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>` -`,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function _P(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function tLe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(` -`),i=t[t.length-1];if(i.includes("`"))return sLe(n);if(i.includes("**"))return cLe(n);if(i.match(/\*\w/))return oLe(n);if(i.match(/(^|\s)__\w/))return dLe(n);if(i.match(/(^|\s)_\w/))return rLe(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return aLe(n);if(i.match(/(^|\s)\[\w/))return lLe(n)}}function iLe(n){let e,t;for(e=0;ee,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function EP(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function yLe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(` +`),i=t[t.length-1];if(i.includes("`"))return xLe(n);if(i.includes("**"))return ILe(n);if(i.match(/\*\w/))return LLe(n);if(i.match(/(^|\s)__\w/))return ALe(n);if(i.match(/(^|\s)_\w/))return DLe(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return kLe(n);if(i.match(/(^|\s)\[\w/))return ELe(n)}}function CLe(n){let e,t;for(e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const o=s?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return ka.lexer(a)}}class hLe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class ag extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function h8(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class f8{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=h8({start:0,end:e},this.groups),r=h8({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:AT(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=gLe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var gc=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Iu={CurrentDragAndDropData:void 0},ua={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class L1{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class _Le{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class bLe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Ko{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Bk(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=ua){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Ko.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new cu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=K.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=K.None,this.onDragLeaveTimeout=K.None,this.disposables=new fe,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new f8((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const w of i)this.renderers.set(w.templateId,w);this.cache=this.disposables.add(new mLe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=(r=s.horizontalScrolling)!==null&&r!==void 0?r:ua.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new wLe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:ua.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Tt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new v1({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:w=>$o(w)})),this.scrollableElement=this.disposables.add(new F4(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:ua.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:ua.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:ua.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(G(this.rowsContainer,Mt.Change,w=>this.onTouchChange(w))),this.disposables.add(G(this.scrollableElement.getDomNode(),"scroll",w=>w.target.scrollTop=0)),this.disposables.add(G(this.domNode,"dragover",w=>this.onDragOver(this.toDragEvent(w)))),this.disposables.add(G(this.domNode,"drop",w=>this.onDrop(this.toDragEvent(w)))),this.disposables.add(G(this.domNode,"dragleave",w=>this.onDragLeave(this.toDragEvent(w)))),this.disposables.add(G(this.domNode,"dragend",w=>this.onDragEnd(w))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:ua.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:ua.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:ua.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(ua.dnd),this.layout((_=s.initialSize)===null||_===void 0?void 0:_.height,(v=s.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=kn.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const x=this.items[L];if(x.dragStartDisposable.dispose(),x.checkedDisposable.dispose(),x.row){let D=a.get(x.templateId);D||(D=[],a.set(x.templateId,D));const k=this.renderers.get(x.templateId);k&&k.disposeElement&&k.disposeElement(x.element,L,x.row.templateData,x.size),D.push(x.row)}x.row=null}const l={start:e+t,end:this.items.length},c=kn.intersect(l,s),d=kn.relativeComplement(l,s),u=i.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:K.None,checkedDisposable:K.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new f8(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=AT(c,f),_=kn.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=kn.relativeComplement(p,g);for(const L of v)for(let x=L.start;xAT(L,f)),y=[{start:e,end:e+i.length},...b].map(L=>kn.intersect(g,L)),S=this.getNextToLastElement(y);for(const L of y)for(let x=L.start;xL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=$o(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t{for(const u of c)for(let h=u.start;hs.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),s.checkedDisposable=a.onDidChange(d)}(o||!s.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(s.row.domNode,t):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const l=this.renderers.get(s.templateId);if(!l)throw new Error(`No renderer found for template id ${s.templateId}`);l==null||l.renderElement(s.element,e,s.row.templateData,s.size);const c=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!c,c&&(s.dragStartDisposable=G(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Bk(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return de.map(this.disposables.add(new rt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return de.map(this.disposables.add(new rt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return de.filter(de.map(this.disposables.add(new rt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return de.map(this.disposables.add(new rt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return de.map(this.disposables.add(new rt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return de.map(this.disposables.add(new rt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return de.any(de.map(this.disposables.add(new rt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),de.map(this.disposables.add(new rt(this.domNode,Mt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return de.map(this.disposables.add(new rt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return de.map(this.disposables.add(new rt(this.rowsContainer,Mt.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var s,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(pq.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=we(".monaco-drag-image");l.textContent=a;const d=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||document.body})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new L1(r),Iu.CurrentDragAndDropData=new _Le(r),(o=(s=this.dnd).onDragStart)===null||o===void 0||o.call(s,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Iu.CurrentDragAndDropData&&Iu.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Iu.CurrentDragAndDropData)this.currentDragData=Iu.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new bLe}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let s;if(typeof i!="boolean"&&i.feedback?s=i.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=Qh(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,vLe(this.currentDragFeedback,s))return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Ke(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of s){const r=this.items[o];r.dropTarget=!0,(t=r.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Ke(()=>{var o;for(const r of s){const a=this.items[r];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=iS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Iu.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Iu.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=K.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=eU(this.domNode).top;this.dragOverAnimationDisposable=$ge(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=iS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},g8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class yLe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let FS=class{get name(){return this._trait}get renderer(){return new yLe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[];let l=0;for(;l=r;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(s=this.sortedIndexes.find(u=>u>=e))!==null&&s!==void 0?s:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(m8),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=TT(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return Yz(this.sortedIndexes,e,m8)>=0}dispose(){Pt(this._onChange)}};Pf([Si],FS.prototype,"renderer",null);class CLe extends FS{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class M2{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function _d(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function Wg(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Wg(n.parentElement)}function Iq(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Iq(n.parentElement)}class Aq{get onKeyDown(){return de.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!_d(t.target)).map(t=>new Wt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new fe,this.multipleSelectionDisposables=new fe,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(gt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(ts(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Pf([Si],Aq.prototype,"onKeyDown",null);var Ea;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Ea||(Ea={}));var Vg;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(Vg||(Vg={}));const SLe=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class xLe{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=Vg.Idle,this.mode=Ea.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new fe,this.disposables=new fe,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:Ea.Automatic}enable(){if(this.enabled)return;let e=!1;const t=de.chain(this.enabledDisposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.filter(r=>!_d(r.target)).filter(()=>this.mode===Ea.Automatic||this.triggered).map(r=>new Wt(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>ze.stop(r,!0)).map(r=>r.browserEvent.key)),i=de.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);de.reduce(de.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&_1(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Vg.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===Vg.Idle?1:0;this.state=Vg.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||OS(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class LLe{constructor(e,t){this.list=e,this.view=t,this.disposables=new fe;const i=de.chain(this.disposables.add(new rt(t.domNode,"keydown")).event,o=>o.filter(r=>!_d(r.target)).map(r=>new Wt(r)));de.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function Tq(n){return gt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Nq(n){return n.browserEvent.shiftKey}function DLe(n){return n instanceof MouseEvent&&n.button===2}const p8={isSelectionSingleChangeEvent:Tq,isSelectionRangeChangeEvent:Nq};class Mq{constructor(e){this.list=e,this.disposables=new fe,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||p8),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Tt.addTarget(e.getHTMLElement()))),de.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||p8))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){Wg(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(_d(e.browserEvent.target)||Wg(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||_d(e.browserEvent.target)||Wg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),DLe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(_d(e.browserEvent.target)||Wg(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=ts(s,o+1),a=this.list.getSelection(),l=ILe(TT(a,[i]),i);if(l.length===0)return;const c=TT(r,ALe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Rq{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${s} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` +|${" --- |".repeat(i)}`;return ka.lexer(a)}}class NLe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class ag extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function L8(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class D8{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=L8({start:0,end:e},this.groups),r=L8({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:VT(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=RLe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var _c=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Ru={CurrentDragAndDropData:void 0},ha={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class N1{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class FLe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class BLe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Ko{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Uk(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=ha){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Ko.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new gu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Y.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Y.None,this.onDragLeaveTimeout=Y.None,this.disposables=new fe,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new D8((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const w of i)this.renderers.set(w.templateId,w);this.cache=this.disposables.add(new OLe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=(r=s.horizontalScrolling)!==null&&r!==void 0?r:ha.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new VLe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:ha.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Tt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new D1({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:w=>$o(w)})),this.scrollableElement=this.disposables.add(new K4(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:ha.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:ha.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:ha.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(K(this.rowsContainer,Mt.Change,w=>this.onTouchChange(w))),this.disposables.add(K(this.scrollableElement.getDomNode(),"scroll",w=>w.target.scrollTop=0)),this.disposables.add(K(this.domNode,"dragover",w=>this.onDragOver(this.toDragEvent(w)))),this.disposables.add(K(this.domNode,"drop",w=>this.onDrop(this.toDragEvent(w)))),this.disposables.add(K(this.domNode,"dragleave",w=>this.onDragLeave(this.toDragEvent(w)))),this.disposables.add(K(this.domNode,"dragend",w=>this.onDragEnd(w))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:ha.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:ha.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:ha.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(ha.dnd),this.layout((_=s.initialSize)===null||_===void 0?void 0:_.height,(v=s.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=kn.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const x=this.items[L];if(x.dragStartDisposable.dispose(),x.checkedDisposable.dispose(),x.row){let D=a.get(x.templateId);D||(D=[],a.set(x.templateId,D));const k=this.renderers.get(x.templateId);k&&k.disposeElement&&k.disposeElement(x.element,L,x.row.templateData,x.size),D.push(x.row)}x.row=null}const l={start:e+t,end:this.items.length},c=kn.intersect(l,s),d=kn.relativeComplement(l,s),u=i.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Y.None,checkedDisposable:Y.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new D8(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=VT(c,f),_=kn.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=kn.relativeComplement(p,g);for(const L of v)for(let x=L.start;xVT(L,f)),y=[{start:e,end:e+i.length},...b].map(L=>kn.intersect(g,L)),S=this.getNextToLastElement(y);for(const L of y)for(let x=L.start;xL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=$o(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t{for(const u of c)for(let h=u.start;hs.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),s.checkedDisposable=a.onDidChange(d)}(o||!s.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(s.row.domNode,t):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const l=this.renderers.get(s.templateId);if(!l)throw new Error(`No renderer found for template id ${s.templateId}`);l==null||l.renderElement(s.element,e,s.row.templateData,s.size);const c=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!c,c&&(s.dragStartDisposable=K(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Uk(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return de.map(this.disposables.add(new rt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return de.map(this.disposables.add(new rt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return de.filter(de.map(this.disposables.add(new rt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return de.map(this.disposables.add(new rt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return de.map(this.disposables.add(new rt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return de.map(this.disposables.add(new rt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return de.any(de.map(this.disposables.add(new rt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),de.map(this.disposables.add(new rt(this.domNode,Mt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return de.map(this.disposables.add(new rt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return de.map(this.disposables.add(new rt(this.rowsContainer,Mt.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var s,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(Nq.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=we(".monaco-drag-image");l.textContent=a;const d=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||document.body})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new N1(r),Ru.CurrentDragAndDropData=new FLe(r),(o=(s=this.dnd).onDragStart)===null||o===void 0||o.call(s,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Ru.CurrentDragAndDropData&&Ru.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Ru.CurrentDragAndDropData)this.currentDragData=Ru.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new BLe}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let s;if(typeof i!="boolean"&&i.feedback?s=i.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=Qh(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,WLe(this.currentDragFeedback,s))return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Ze(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of s){const r=this.items[o];r.dropTarget=!0,(t=r.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Ze(()=>{var o;for(const r of s){const a=this.items[r];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=rS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Ru.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Ru.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Y.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=_U(this.domNode).top;this.dragOverAnimationDisposable=cpe(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=rS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class HLe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let HS=class{get name(){return this._trait}get renderer(){return new HLe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[];let l=0;for(;l=r;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(s=this.sortedIndexes.find(u=>u>=e))!==null&&s!==void 0?s:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(I8),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=HT(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return h$(this.sortedIndexes,e,I8)>=0}dispose(){Pt(this._onChange)}};Pf([Li],HS.prototype,"renderer",null);class zLe extends HS{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class W2{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function wd(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function Wg(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Wg(n.parentElement)}function qq(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:qq(n.parentElement)}class Gq{get onKeyDown(){return de.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!wd(t.target)).map(t=>new Wt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new fe,this.multipleSelectionDisposables=new fe,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(gt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(es(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Pf([Li],Gq.prototype,"onKeyDown",null);var Ea;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Ea||(Ea={}));var Vg;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(Vg||(Vg={}));const $Le=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class ULe{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=Vg.Idle,this.mode=Ea.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new fe,this.disposables=new fe,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:Ea.Automatic}enable(){if(this.enabled)return;let e=!1;const t=de.chain(this.enabledDisposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.filter(r=>!wd(r.target)).filter(()=>this.mode===Ea.Automatic||this.triggered).map(r=>new Wt(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>Ue.stop(r,!0)).map(r=>r.browserEvent.key)),i=de.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);de.reduce(de.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&x1(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Vg.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===Vg.Idle?1:0;this.state=Vg.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||VS(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class jLe{constructor(e,t){this.list=e,this.view=t,this.disposables=new fe;const i=de.chain(this.disposables.add(new rt(t.domNode,"keydown")).event,o=>o.filter(r=>!wd(r.target)).map(r=>new Wt(r)));de.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function Kq(n){return gt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Yq(n){return n.browserEvent.shiftKey}function qLe(n){return n instanceof MouseEvent&&n.button===2}const E8={isSelectionSingleChangeEvent:Kq,isSelectionRangeChangeEvent:Yq};class Zq{constructor(e){this.list=e,this.disposables=new fe,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||E8),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Tt.addTarget(e.getHTMLElement()))),de.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||E8))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){Wg(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(wd(e.browserEvent.target)||Wg(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||wd(e.browserEvent.target)||Wg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),qLe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(wd(e.browserEvent.target)||Wg(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=es(s,o+1),a=this.list.getSelection(),l=YLe(HT(a,[i]),i);if(l.length===0)return;const c=HT(r,ZLe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Xq{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${s} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${s} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${s} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${s} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Ah(e.listFocusAndSelectionOutline,Ah(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` + `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${s} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${s} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${s} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Th(e.listFocusAndSelectionOutline,Th(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${s}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const a=Ah(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${s} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${s} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${s} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${s} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(` + `);const a=Th(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${s} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${s} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${s} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${s} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(` .monaco-list${s}.drop-target, .monaco-list${s} .monaco-list-rows.drop-target, .monaco-list${s} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; } @@ -2783,17 +2830,17 @@ Please report this to https://github.com/markedjs/marked.`,j.silent)return"

    An background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` -`)}}const kLe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:H.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:H.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:H.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},ELe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function ILe(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class TLe{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,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class NLe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class MLe{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){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}dispose(){this.dnd.dispose()}}class ra{get onDidChangeFocus(){return de.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return de.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=de.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.map(r=>new Wt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>ze.stop(r,!0)).filter(()=>!1)),i=de.chain(this.disposables.add(new rt(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Wt(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>ze.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=de.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new rr(l),browserEvent:l})));return de.any(t,i,s)}get onKeyDown(){return this.disposables.add(new rt(this.view.domNode,"keydown")).event}get onDidFocus(){return de.signal(this.disposables.add(new rt(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=ELe){var r,a,l,c;this.user=e,this._options=o,this.focus=new FS("focused"),this.anchor=new FS("anchor"),this.eventBufferer=new KR,this._ariaLabel="",this.disposables=new fe,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new CLe(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new NLe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new TLe(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new MLe(this,o.dnd)});if(this.view=this.createListView(t,i,s,h),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=br(this.view.domNode);this.styleController=new Rq(f,this.view.domId)}if(this.spliceable=new hLe([new M2(this.focus,this.view,o.identityProvider),new M2(this.selection,this.view,o.identityProvider),new M2(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new LLe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Aq(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||SLe;this.typeNavigationController=new xLe(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Ko(e,t,i,s)}createMouseController(e){return new Mq(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new ag(this.user,`Invalid start index: ${e}`);if(t<0)throw new ag(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new ag(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new ag(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return Qz(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new ag(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return g8(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),yield bb(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return g8(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const r=this.findNextIndex(i,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==r&&(this.setFocus([]),yield bb(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new ag(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(Fd(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*co(t,0,1)+s)}else{const r=s+o,a=i+this.view.renderHeight;s=a||(s=a&&o>=this.view.renderHeight?this.view.setScrollTop(s):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Pf([Si],ra.prototype,"onDidChangeFocus",null);Pf([Si],ra.prototype,"onDidChangeSelection",null);Pf([Si],ra.prototype,"onContextMenu",null);Pf([Si],ra.prototype,"onKeyDown",null);Pf([Si],ra.prototype,"onDidFocus",null);const uh=we,Pq="selectOption.entry.template";class RLe{get templateId(){return Pq}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=re(e,uh(".option-text")),t.detail=re(e,uh(".option-detail")),t.decoratorRight=re(e,uh(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Ia extends K{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Ia.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new B,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return Pq}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=we(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=re(this.selectDropDownContainer,uh(".select-box-details-pane"));const t=re(this.selectDropDownContainer,uh(".select-box-dropdown-container-width-control")),i=re(t,uh(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",re(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=br(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(G(this.selectDropDownContainer,le.DRAG_START,s=>{ze.stop(s,!0)}))}registerListeners(){this._register(Hi(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(G(this.selectElement,le.CLICK,t=>{ze.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(G(this.selectElement,le.MOUSE_DOWN,t=>{ze.stop(t)}));let e;this._register(G(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(G(this.selectElement,"touchend",t=>{ze.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(G(this.selectElement,le.KEY_DOWN,t=>{const i=new Wt(t);let s=!1;gt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),ze.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ki(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){var e,t,i;const s=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=s,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=Ah(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=s,this.selectionDetailsPane.style.backgroundColor=s;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}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=Nn(this.selectElement),i=getComputedStyle(this.selectElement),s=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),r=t.top-Ia.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,h=d+s+u,f=Math.floor((o-s-u)/this.getHeight()),g=Math.floor((r-s-u)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topo&&(d=f*this.getHeight())}else h>r&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ys(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=re(e,uh(".select-box-dropdown-list-container")),this.listRenderer=new RLe,this.selectList=new ra("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>gt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new rt(this.selectDropDownListContainer,"keydown")),i=de.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new Wt(o)));this._register(de.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(G(this.selectList.getHTMLElement(),le.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(G(this.selectDropDownContainer,le.FOCUS_OUT,s=>{!this._isVisible||Cn(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;ze.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(ze.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){ze.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){ze.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){ze.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Al.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(G(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Hi(this.selectElement,"click",e=>{ze.stop(e,!0)})),this._register(Hi(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Hi(this.selectElement,"keydown",e=>{let t=!1;gt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ki(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Yp)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Tt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,mr&&this._register(G(e,le.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(pq.TEXT,this._action.label)}))),this._register(G(t,Mt.Tap,s=>this.onClick(s,!0))),this._register(G(t,le.MOUSE_DOWN,s=>{i||ze.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),gt&&this._register(G(t,le.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(G(t,le.CLICK,s=>{ze.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(G(t,le.DBLCLICK,s=>{ze.stop(s,!0)})),[le.MOUSE_UP,le.MOUSE_OUT].forEach(s=>{this._register(G(t,s,o=>{ze.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;ze.stop(e,!0);const s=go(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=kq(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class oD extends Hr{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=re(this.element,we("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(re(this.element,we("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Rn.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=m({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class FLe extends Hr{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new OLe(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class BLe extends Yp{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=re(e,we(".monaco-dropdown")),this._label=re(this._element,we(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[le.CLICK,le.MOUSE_DOWN,Mt.Tap])this._register(G(this.element,o,r=>ze.stop(r,!0)));for(const o of[le.MOUSE_DOWN,Mt.Tap])this._register(G(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(G(this._label,le.KEY_UP,o=>{const r=new Wt(o);(r.equals(3)||r.equals(10))&&(ze.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Tt.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class WLe extends BLe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class BS extends Hr{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=re(o,we("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new WLe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}function VLe(n){return n?n.condition!==void 0:!1}var j0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},fp;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(fp||(fp={}));var Hg;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Hg||(Hg={}));class gp extends K{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new cb),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Hg.None,this.cache=new Map,this.flushDelayer=this._register(new hU(gp.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Hg.Closed)return;let i=!1;go(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return go(i)?t:i}getBoolean(e,t){const i=this.get(e);return go(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return go(i)?t:parseInt(i,10)}set(e,t,i=!1){return j0(this,void 0,void 0,function*(){if(this.state===Hg.Closed)return;if(go(t))return this.delete(e,i);const s=Ds(t)||Array.isArray(t)?Gxe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return j0(this,void 0,void 0,function*(){if(!(this.state===Hg.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return j0(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return j0(this,void 0,void 0,function*(){return this.options.hint===fp.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}gp.DEFAULT_FLUSH_DELAY=100;class R2{constructor(){this.onDidChangeItemsExternal=de.None,this.items=new Map}updateItems(e){var t,i;return j0(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)===null||i===void 0||i.forEach(s=>this.items.delete(s))})}}const Yy="__$__targetStorageMarker",Of=at("storageService");var _8;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(_8||(_8={}));function HLe(n){const e=n.get(Yy);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class rD extends K{constructor(e={flushInterval:rD.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new cb),this._onDidChangeTarget=this._register(new cb),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return de.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===Yy){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(go(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))===null||s===void 0||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(Yy,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(Yy,JSON.stringify(a),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?HLe(t):Object.create(null)}}rD.DEFAULT_FLUSH_INTERVAL=60*1e3;class zLe extends rD{constructor(){super(),this.applicationStorage=this._register(new gp(new R2,{hint:fp.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new gp(new R2,{hint:fp.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new gp(new R2,{hint:fp.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function $Le(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?oe(s):void 0}return t}const ULe={keybindingLabelBackground:oe(I_e),keybindingLabelForeground:oe(A_e),keybindingLabelBorder:oe(T_e),keybindingLabelBottomBorder:oe(N_e),keybindingLabelShadow:oe(Hl)},jLe={buttonForeground:oe(N0),buttonSeparator:oe(p_e),buttonBackground:oe(M0),buttonHoverBackground:oe(m_e),buttonSecondaryForeground:oe(b_e),buttonSecondaryBackground:oe(WA),buttonSecondaryHoverBackground:oe(v_e),buttonBorder:oe(__e)},qLe={progressBarBackground:oe(C_e)},WS={inputActiveOptionBorder:oe(I4),inputActiveOptionForeground:oe(A4),inputActiveOptionBackground:oe(lh)};oe(rbe),oe(lbe),oe(abe);oe(Vi),oe(Ra),oe(Hl),oe(Xe),oe(xbe),oe(Lbe),oe(Dbe),oe(t_e);const VS={inputBackground:oe(i_e),inputForeground:oe(n_e),inputBorder:oe(s_e),inputValidationInfoBorder:oe(a_e),inputValidationInfoBackground:oe(o_e),inputValidationInfoForeground:oe(r_e),inputValidationWarningBorder:oe(d_e),inputValidationWarningBackground:oe(l_e),inputValidationWarningForeground:oe(c_e),inputValidationErrorBorder:oe(f_e),inputValidationErrorBackground:oe(u_e),inputValidationErrorForeground:oe(h_e)},GLe={listFilterWidgetBackground:oe(J_e),listFilterWidgetOutline:oe(ebe),listFilterWidgetNoMatchesOutline:oe(tbe),listFilterWidgetShadow:oe(ibe),inputBoxStyles:VS,toggleStyles:WS},Oq={badgeBackground:oe(Vy),badgeForeground:oe(w_e),badgeBorder:oe(Xe)};oe(_be),oe(mbe),oe(S9),oe(S9),oe(bbe);const Ff={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:oe($_e),listFocusForeground:oe(U_e),listFocusOutline:oe(j_e),listActiveSelectionBackground:oe($l),listActiveSelectionForeground:oe(Oa),listActiveSelectionIconForeground:oe(F0),listFocusAndSelectionOutline:oe(q_e),listFocusAndSelectionBackground:oe($l),listFocusAndSelectionForeground:oe(Oa),listInactiveSelectionBackground:oe(G_e),listInactiveSelectionIconForeground:oe(Y_e),listInactiveSelectionForeground:oe(K_e),listInactiveFocusBackground:oe(Z_e),listInactiveFocusOutline:oe(X_e),listHoverBackground:oe(YU),listHoverForeground:oe(ZU),listDropBackground:oe(Q_e),listSelectionOutline:oe($t),listHoverOutline:oe($t),treeIndentGuidesStroke:oe(B0),treeInactiveIndentGuidesStroke:oe(nbe),tableColumnsBorder:oe(sbe),tableOddRowsBackgroundColor:oe(obe)};function D1(n){return $Le(n,Ff)}const KLe={selectBackground:oe(Na),selectListBackground:oe(g_e),selectForeground:oe(zl),decoratorRightForeground:oe(GU),selectBorder:oe(Eg),focusBorder:oe(vo),listFocusBackground:oe($A),listInactiveSelectionIconForeground:oe(XU),listFocusForeground:oe(zA),listFocusOutline:Q0e($t,H.transparent.toString()),listHoverBackground:oe(YU),listHoverForeground:oe(ZU),listHoverOutline:oe($t),selectListBorder:oe(Ig),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},YLe={shadowColor:oe(Hl),borderColor:oe(cbe),foregroundColor:oe(dbe),backgroundColor:oe(ube),selectionForegroundColor:oe(hbe),selectionBackgroundColor:oe(fbe),selectionBorderColor:oe(gbe),separatorColor:oe(pbe),scrollbarShadow:oe(y_e),scrollbarSliderBackground:oe(R0),scrollbarSliderHoverBackground:oe(P0),scrollbarSliderActiveBackground:oe(O0)};var aD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xs=function(n,e){return function(t,i){e(t,i,n)}},Fq=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function ZLe(n,e,t,i){const s=n.getActions(e),o=Gc.getInstance(),r=o.keyStatus.altKey||(Rs||Zn)&&o.keyStatus.shiftKey;Wq(s,t,r,i?a=>a===i:a=>a==="navigation")}function Bq(n,e,t,i,s,o){const r=n.getActions(e);Wq(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function Wq(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let u;i(c)?(u=r,u.length>0&&o&&u.push(new Rn)):(u=a,u.length>0&&u.push(new Rn));for(let h of d){t&&(h=h instanceof qa&&h.alt?h.alt:h);const f=u.push(h);h instanceof vL&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=i(c)?r:a,f=d.actions;s(d,c,h.length)&&h.splice(u,1,...f)}}let fm=class extends oD{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Qr),this._altKey=Gc.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Fq(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var s;const o=!!(!((s=this._menuItemAction.alt)===null||s===void 0)&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(G(e,"mouseleave",s=>{t=!1,i()})),this._register(G(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),s=this._commandAction.tooltip||this._commandAction.label;let o=i?m("titleAndKb","{0} ({1})",s,i):s;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?m("titleAndKb","{0} ({1})",r,l):r;o=m("titleAndKbAndAlt",`{0} -[{1}] {2}`,o,lP.modifierLabels[bo].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&VLe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(Ae.isThemeIcon(s)){const o=Ae.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ke(()=>{i.classList.remove(...o)})}else{const o=GL(this._themeService.getColorTheme().type)?Hd(s.dark):Hd(s.light),r=we("span");r.style.webkitMask=r.style.mask=`${o} no-repeat 50% 50%`,r.style.background="var(--vscode-icon-foreground)",r.style.display="inline-block",r.style.width="100%",r.style.height="100%",i.appendChild(r),i.classList.add("icon"),this._itemClassDispose.value=ur(Ke(()=>{i.classList.remove("icon"),ds(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};fm=aD([xs(2,gi),xs(3,Ln),xs(4,Je),xs(5,oo),xs(6,gu),xs(7,uu)],fm);let NT=class extends BS{constructor(e,t,i,s,o){var r,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Ae.isThemeIcon(e.item.icon)?Ae.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},s,c),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Ls(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ae.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=GL(this._themeService.getColorTheme().type)?Hd(i.dark):Hd(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};NT=aD([xs(2,gi),xs(3,gu),xs(4,oo)],NT);let MT=class extends Hr{constructor(e,t,i,s,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(fm,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new Yp});this._dropdown=new BS(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof qa&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(fm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Yp{runAction(i,s){return Fq(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(nU(this._container,we(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(i=`(${s.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=we(".action-container");this._defaultAction.render(re(this._container,t)),this._register(G(t,le.KEY_DOWN,s=>{const o=new Wt(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=we(".dropdown-action-container");this._dropdown.render(re(this._container,i)),this._register(G(i,le.KEY_DOWN,s=>{var o;const r=new Wt(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};MT=aD([xs(2,gi),xs(3,Ln),xs(4,gu),xs(5,lu),xs(6,bt),xs(7,Of)],MT);let RT=class extends FLe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Rn.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,KLe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=oe(Eg)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};RT=aD([xs(1,fu)],RT);function XLe(n,e,t){return e instanceof qa?n.createInstance(fm,e,t):e instanceof eS?e.item.isSelection?n.createInstance(RT,e):e.item.rememberDefaultAction?n.createInstance(MT,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(NT,e,t):void 0}var QLe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Xa extends K{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new fe),this.viewItemDisposables=this._register(new qR),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Yp,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(u=>this._onDidRun.fire(u))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(u=>this._onWillRun.fire(u))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,d;switch(this._orientation){case 0:c=[15],d=[17];break;case 1:c=[16],d=[18],this.domNode.className+=" vertical";break}this._register(G(this.domNode,le.KEY_DOWN,u=>{const h=new Wt(u);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():d&&(h.equals(d[0])||h.equals(d[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof Hr&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(G(this.domNode,le.KEY_UP,u=>{const h=new Wt(u);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(Vd(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Gr()===this.domNode||!Cn(Gr(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Hr&&i.isEnabled());t instanceof Hr&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Hr&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new oD(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,G(r,le.CONTEXT_MENU,c=>{ze.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Hr&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Pt(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Do(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])===null||s===void 0||s.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let r=!0;HC(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&HC(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===Rn.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Hr){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return QLe(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=Pt(this.viewItems),this.getContainer().remove(),super.dispose()}}const PT=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,P2=/(&)?(&)([^\s&])/g;var HS;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(HS||(HS={}));class pp extends Xa{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...gt||Zn?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new fe),this.initializeOrUpdateStyleSheet(e,s),this._register(Tt.addTarget(o)),G(o,le.KEY_DOWN,l=>{new Wt(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(G(o,le.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){ze.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof b8&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(l)),d.length>1){const u=d.shift();u&&u.container&&(this.focusItemByElement(u.container),d.push(u)),this.mnemonics.set(c,d)}}})),Zn&&this._register(G(o,le.KEY_DOWN,l=>{const c=new Wt(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),ze.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),ze.stop(l,!0))})),this._register(G(this.domNode,le.MOUSE_OUT,l=>{const c=l.relatedTarget;Cn(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(G(this.actionsList,le.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Cn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}})),this._register(Tt.addTarget(this.actionsList)),this._register(G(this.actionsList,Mt.Tap,l=>{let c=l.initialTarget;if(!(!c||!Cn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new B4(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(G(o,Mt.Change,l=>{ze.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(G(a,le.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof v8)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(vA(e)?this.styleSheet=br(e):(pp.globalStyleSheet||(pp.globalStyleSheet=br()),this.styleSheet=pp.globalStyleSheet)),this.styleSheet.textContent=eDe(t,vA(e))}styleScrollElement(e,t){var i,s;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(s=t.backgroundColor)!==null&&s!==void 0?s:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(G(this.element,le.MOUSE_UP,o=>{if(ze.stop(o,!0),mr){if(new rr(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(G(this.element,le.CONTEXT_MENU,o=>{ze.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=re(this.element,we("a.action-menu-item")),this._action.id===Rn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=re(this.item,we("span.menu-item-check"+Ae.asCSSSelector(ie.menuSelection))),this.check.setAttribute("role","none"),this.label=re(this.item,we("span.action-label")),this.options.label&&this.options.keybinding&&(re(this.item,we("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Do(this.label);let t=Dq(this.action.label);if(t){const i=JLe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=PT.exec(t);if(s){t=YC(t),P2.lastIndex=0;let o=P2.exec(t);for(;o&&o[1];)o=P2.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(bL(r(t.substr(0,o.index))," "),we("u",{"aria-hidden":"true"},o[3]),rfe(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class b8 extends Vq{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new fe),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:HS.Right,this.showScheduler=new Ci(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Ci(()=>{this.element&&!Cn(Gr(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=re(this.item,we("span.submenu-indicator"+Ae.asCSSSelector(ie.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(G(this.element,le.KEY_UP,t=>{const i=new Wt(t);(i.equals(17)||i.equals(3))&&(ze.stop(t,!0),this.createSubmenu(!0))})),this._register(G(this.element,le.KEY_DOWN,t=>{const i=new Wt(t);Gr()===this.item&&(i.equals(17)||i.equals(3))&&ze.stop(t,!0)})),this._register(G(this.element,le.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(G(this.element,le.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(G(this.element,le.FOCUS_OUT,t=>{this.element&&!Cn(Gr(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){ze.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=Bg(e.width,t.width,{position:s===HS.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Wt(c).equals(15)&&(ze.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(G(this.submenuContainer,le.KEY_DOWN,c=>{new Wt(c).equals(15)&&ze.stop(c,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class v8 extends oD{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function JLe(n){const e=PT,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function w8(n){const e=k$()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function eDe(n,e){let t=` +`)}}const GLe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:z.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:z.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:z.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},KLe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function YLe(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class XLe{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,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class QLe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class JLe{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){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}dispose(){this.dnd.dispose()}}class aa{get onDidChangeFocus(){return de.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return de.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=de.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.map(r=>new Wt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ue.stop(r,!0)).filter(()=>!1)),i=de.chain(this.disposables.add(new rt(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Wt(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ue.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=de.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new rr(l),browserEvent:l})));return de.any(t,i,s)}get onKeyDown(){return this.disposables.add(new rt(this.view.domNode,"keydown")).event}get onDidFocus(){return de.signal(this.disposables.add(new rt(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=KLe){var r,a,l,c;this.user=e,this._options=o,this.focus=new HS("focused"),this.anchor=new HS("anchor"),this.eventBufferer=new o4,this._ariaLabel="",this.disposables=new fe,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new zLe(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new QLe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new XLe(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new JLe(this,o.dnd)});if(this.view=this.createListView(t,i,s,h),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=vr(this.view.domNode);this.styleController=new Xq(f,this.view.domId)}if(this.spliceable=new NLe([new W2(this.focus,this.view,o.identityProvider),new W2(this.selection,this.view,o.identityProvider),new W2(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new jLe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Gq(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||$Le;this.typeNavigationController=new ULe(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Ko(e,t,i,s)}createMouseController(e){return new Zq(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new ag(this.user,`Invalid start index: ${e}`);if(t<0)throw new ag(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new ag(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new ag(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return p$(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new ag(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return k8(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),yield wb(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return k8(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const r=this.findNextIndex(i,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==r&&(this.setFocus([]),yield wb(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new ag(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(zd(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*co(t,0,1)+s)}else{const r=s+o,a=i+this.view.renderHeight;s=a||(s=a&&o>=this.view.renderHeight?this.view.setScrollTop(s):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Pf([Li],aa.prototype,"onDidChangeFocus",null);Pf([Li],aa.prototype,"onDidChangeSelection",null);Pf([Li],aa.prototype,"onContextMenu",null);Pf([Li],aa.prototype,"onKeyDown",null);Pf([Li],aa.prototype,"onDidFocus",null);const ph=we,Qq="selectOption.entry.template";class eDe{get templateId(){return Qq}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=re(e,ph(".option-text")),t.detail=re(e,ph(".option-detail")),t.decoratorRight=re(e,ph(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Ia extends Y{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Ia.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new B,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return Qq}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=we(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=re(this.selectDropDownContainer,ph(".select-box-details-pane"));const t=re(this.selectDropDownContainer,ph(".select-box-dropdown-container-width-control")),i=re(t,ph(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",re(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=vr(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(K(this.selectDropDownContainer,le.DRAG_START,s=>{Ue.stop(s,!0)}))}registerListeners(){this._register(Hi(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(K(this.selectElement,le.CLICK,t=>{Ue.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,le.MOUSE_DOWN,t=>{Ue.stop(t)}));let e;this._register(K(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(K(this.selectElement,"touchend",t=>{Ue.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,le.KEY_DOWN,t=>{const i=new Wt(t);let s=!1;gt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),Ue.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ki(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,i;const s=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=s,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=Th(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=s,this.selectionDetailsPane.style.backgroundColor=s;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}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=Nn(this.selectElement),i=getComputedStyle(this.selectElement),s=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),r=t.top-Ia.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,h=d+s+u,f=Math.floor((o-s-u)/this.getHeight()),g=Math.floor((r-s-u)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topo&&(d=f*this.getHeight())}else h>r&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ws(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=re(e,ph(".select-box-dropdown-list-container")),this.listRenderer=new eDe,this.selectList=new aa("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>gt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new rt(this.selectDropDownListContainer,"keydown")),i=de.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new Wt(o)));this._register(de.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(de.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(K(this.selectList.getHTMLElement(),le.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(K(this.selectDropDownContainer,le.FOCUS_OUT,s=>{!this._isVisible||Cn(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Ue.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Ue.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Ue.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Ue.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Ue.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Nl.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(K(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Hi(this.selectElement,"click",e=>{Ue.stop(e,!0)})),this._register(Hi(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Hi(this.selectElement,"keydown",e=>{let t=!1;gt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ki(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Xp)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Tt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,_r&&this._register(K(e,le.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(Nq.TEXT,this._action.label)}))),this._register(K(t,Mt.Tap,s=>this.onClick(s,!0))),this._register(K(t,le.MOUSE_DOWN,s=>{i||Ue.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),gt&&this._register(K(t,le.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(K(t,le.CLICK,s=>{Ue.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(K(t,le.DBLCLICK,s=>{Ue.stop(s,!0)})),[le.MOUSE_UP,le.MOUSE_OUT].forEach(s=>{this._register(K(t,s,o=>{Ue.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Ue.stop(e,!0);const s=go(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=Uq(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class fD extends $r{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=re(this.element,we("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(re(this.element,we("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Rn.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=m({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class nDe extends $r{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new iDe(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class sDe extends Xp{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=re(e,we(".monaco-dropdown")),this._label=re(this._element,we(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[le.CLICK,le.MOUSE_DOWN,Mt.Tap])this._register(K(this.element,o,r=>Ue.stop(r,!0)));for(const o of[le.MOUSE_DOWN,Mt.Tap])this._register(K(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(K(this._label,le.KEY_UP,o=>{const r=new Wt(o);(r.equals(3)||r.equals(10))&&(Ue.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Tt.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class oDe extends sDe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class zS extends $r{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=re(o,we("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new oDe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}function rDe(n){return n?n.condition!==void 0:!1}var G0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},gp;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(gp||(gp={}));var Hg;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Hg||(Hg={}));class pp extends Y{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new ub),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Hg.None,this.cache=new Map,this.flushDelayer=this._register(new IU(pp.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Hg.Closed)return;let i=!1;go(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return go(i)?t:i}getBoolean(e,t){const i=this.get(e);return go(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return go(i)?t:parseInt(i,10)}set(e,t,i=!1){return G0(this,void 0,void 0,function*(){if(this.state===Hg.Closed)return;if(go(t))return this.delete(e,i);const s=Ls(t)||Array.isArray(t)?fLe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return G0(this,void 0,void 0,function*(){if(!(this.state===Hg.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return G0(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return G0(this,void 0,void 0,function*(){return this.options.hint===gp.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}pp.DEFAULT_FLUSH_DELAY=100;class V2{constructor(){this.onDidChangeItemsExternal=de.None,this.items=new Map}updateItems(e){var t,i;return G0(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)===null||i===void 0||i.forEach(s=>this.items.delete(s))})}}const iC="__$__targetStorageMarker",Of=at("storageService");var A8;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(A8||(A8={}));function aDe(n){const e=n.get(iC);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class gD extends Y{constructor(e={flushInterval:gD.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new ub),this._onDidChangeTarget=this._register(new ub),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return de.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===iC){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(go(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))===null||s===void 0||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(iC,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(iC,JSON.stringify(a),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?aDe(t):Object.create(null)}}gD.DEFAULT_FLUSH_INTERVAL=60*1e3;class lDe extends gD{constructor(){super(),this.applicationStorage=this._register(new pp(new V2,{hint:gp.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new pp(new V2,{hint:gp.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new pp(new V2,{hint:gp.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function cDe(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?oe(s):void 0}return t}const dDe={keybindingLabelBackground:oe(Y_e),keybindingLabelForeground:oe(Z_e),keybindingLabelBorder:oe(X_e),keybindingLabelBottomBorder:oe(Q_e),keybindingLabelShadow:oe($l)},uDe={buttonForeground:oe(R0),buttonSeparator:oe(P_e),buttonBackground:oe(P0),buttonHoverBackground:oe(O_e),buttonSecondaryForeground:oe(B_e),buttonSecondaryBackground:oe(YA),buttonSecondaryHoverBackground:oe(W_e),buttonBorder:oe(F_e)},hDe={progressBarBackground:oe(z_e)},$S={inputActiveOptionBorder:oe(V4),inputActiveOptionForeground:oe(H4),inputActiveOptionBackground:oe(hh)};oe(Dbe),oe(Ebe),oe(kbe);oe(Vi),oe(Ra),oe($l),oe(Je),oe(Ube),oe(jbe),oe(qbe),oe(y_e);const US={inputBackground:oe(C_e),inputForeground:oe(S_e),inputBorder:oe(x_e),inputValidationInfoBorder:oe(k_e),inputValidationInfoBackground:oe(L_e),inputValidationInfoForeground:oe(D_e),inputValidationWarningBorder:oe(A_e),inputValidationWarningBackground:oe(E_e),inputValidationWarningForeground:oe(I_e),inputValidationErrorBorder:oe(M_e),inputValidationErrorBackground:oe(T_e),inputValidationErrorForeground:oe(N_e)},fDe={listFilterWidgetBackground:oe(vbe),listFilterWidgetOutline:oe(wbe),listFilterWidgetNoMatchesOutline:oe(ybe),listFilterWidgetShadow:oe(Cbe),inputBoxStyles:US,toggleStyles:$S},Jq={badgeBackground:oe(Gy),badgeForeground:oe(V_e),badgeBorder:oe(Je)};oe(Fbe),oe(Obe),oe(O9),oe(O9),oe(Bbe);const Ff={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:oe(cbe),listFocusForeground:oe(dbe),listFocusOutline:oe(ube),listActiveSelectionBackground:oe(jl),listActiveSelectionForeground:oe(Oa),listActiveSelectionIconForeground:oe(W0),listFocusAndSelectionOutline:oe(hbe),listFocusAndSelectionBackground:oe(jl),listFocusAndSelectionForeground:oe(Oa),listInactiveSelectionBackground:oe(fbe),listInactiveSelectionIconForeground:oe(pbe),listInactiveSelectionForeground:oe(gbe),listInactiveFocusBackground:oe(mbe),listInactiveFocusOutline:oe(_be),listHoverBackground:oe(hj),listHoverForeground:oe(fj),listDropBackground:oe(bbe),listSelectionOutline:oe(Ut),listHoverOutline:oe(Ut),treeIndentGuidesStroke:oe(V0),treeInactiveIndentGuidesStroke:oe(Sbe),tableColumnsBorder:oe(xbe),tableOddRowsBackgroundColor:oe(Lbe)};function M1(n){return cDe(n,Ff)}const gDe={selectBackground:oe(Na),selectListBackground:oe(R_e),selectForeground:oe(Ul),decoratorRightForeground:oe(dj),selectBorder:oe(Eg),focusBorder:oe(bo),listFocusBackground:oe(JA),listInactiveSelectionIconForeground:oe(gj),listFocusForeground:oe(QA),listFocusOutline:b_e(Ut,z.transparent.toString()),listHoverBackground:oe(hj),listHoverForeground:oe(fj),listHoverOutline:oe(Ut),selectListBorder:oe(Ig),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},pDe={shadowColor:oe($l),borderColor:oe(Ibe),foregroundColor:oe(Abe),backgroundColor:oe(Tbe),selectionForegroundColor:oe(Nbe),selectionBackgroundColor:oe(Mbe),selectionBorderColor:oe(Rbe),separatorColor:oe(Pbe),scrollbarShadow:oe(H_e),scrollbarSliderBackground:oe(O0),scrollbarSliderHoverBackground:oe(F0),scrollbarSliderActiveBackground:oe(B0)};var pD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ss=function(n,e){return function(t,i){e(t,i,n)}},eG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function mDe(n,e,t,i){const s=n.getActions(e),o=Zc.getInstance(),r=o.keyStatus.altKey||(Ms||Zn)&&o.keyStatus.shiftKey;iG(s,t,r,i?a=>a===i:a=>a==="navigation")}function tG(n,e,t,i,s,o){const r=n.getActions(e);iG(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function iG(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let u;i(c)?(u=r,u.length>0&&o&&u.push(new Rn)):(u=a,u.length>0&&u.push(new Rn));for(let h of d){t&&(h=h instanceof qa&&h.alt?h.alt:h);const f=u.push(h);h instanceof kL&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=i(c)?r:a,f=d.actions;s(d,c,h.length)&&h.splice(u,1,...f)}}let pm=class extends fD{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Jr),this._altKey=Zc.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return eG(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var s;const o=!!(!((s=this._menuItemAction.alt)===null||s===void 0)&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(K(e,"mouseleave",s=>{t=!1,i()})),this._register(K(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),s=this._commandAction.tooltip||this._commandAction.label;let o=i?m("titleAndKb","{0} ({1})",s,i):s;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?m("titleAndKb","{0} ({1})",r,l):r;o=m("titleAndKbAndAlt",`{0} +[{1}] {2}`,o,vP.modifierLabels[_o].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&rDe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(Ae.isThemeIcon(s)){const o=Ae.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ze(()=>{i.classList.remove(...o)})}else{const o=tD(this._themeService.getColorTheme().type)?qd(s.dark):qd(s.light),r=we("span");r.style.webkitMask=r.style.mask=`${o} no-repeat 50% 50%`,r.style.background="var(--vscode-icon-foreground)",r.style.display="inline-block",r.style.width="100%",r.style.height="100%",i.appendChild(r),i.classList.add("icon"),this._itemClassDispose.value=ur(Ze(()=>{i.classList.remove("icon"),cs(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};pm=pD([Ss(2,pi),Ss(3,Ln),Ss(4,tt),Ss(5,oo),Ss(6,vu),Ss(7,mu)],pm);let zT=class extends zS{constructor(e,t,i,s,o){var r,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Ae.isThemeIcon(e.item.icon)?Ae.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},s,c),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),xs(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ae.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=tD(this._themeService.getColorTheme().type)?qd(i.dark):qd(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};zT=pD([Ss(2,pi),Ss(3,vu),Ss(4,oo)],zT);let $T=class extends $r{constructor(e,t,i,s,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(pm,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new Xp});this._dropdown=new zS(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof qa&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(pm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Xp{runAction(i,s){return eG(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(wU(this._container,we(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(i=`(${s.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=we(".action-container");this._defaultAction.render(re(this._container,t)),this._register(K(t,le.KEY_DOWN,s=>{const o=new Wt(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=we(".dropdown-action-container");this._dropdown.render(re(this._container,i)),this._register(K(i,le.KEY_DOWN,s=>{var o;const r=new Wt(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};$T=pD([Ss(2,pi),Ss(3,Ln),Ss(4,vu),Ss(5,fu),Ss(6,bt),Ss(7,Of)],$T);let UT=class extends nDe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Rn.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,gDe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=oe(Eg)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};UT=pD([Ss(1,bu)],UT);function _De(n,e,t){return e instanceof qa?n.createInstance(pm,e,t):e instanceof sS?e.item.isSelection?n.createInstance(UT,e):e.item.rememberDefaultAction?n.createInstance($T,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(zT,e,t):void 0}var bDe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Xa extends Y{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new fe),this.viewItemDisposables=this._register(new n4),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Xp,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(u=>this._onDidRun.fire(u))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(u=>this._onWillRun.fire(u))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,d;switch(this._orientation){case 0:c=[15],d=[17];break;case 1:c=[16],d=[18],this.domNode.className+=" vertical";break}this._register(K(this.domNode,le.KEY_DOWN,u=>{const h=new Wt(u);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():d&&(h.equals(d[0])||h.equals(d[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof $r&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(K(this.domNode,le.KEY_UP,u=>{const h=new Wt(u);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(jd(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Yr()===this.domNode||!Cn(Yr(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof $r&&i.isEnabled());t instanceof $r&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof $r&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new fD(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,K(r,le.CONTEXT_MENU,c=>{Ue.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof $r&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Pt(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Lo(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])===null||s===void 0||s.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let r=!0;jC(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&jC(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===Rn.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof $r){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return bDe(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=Pt(this.viewItems),this.getContainer().remove(),super.dispose()}}const jT=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,H2=/(&)?(&)([^\s&])/g;var jS;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(jS||(jS={}));class mp extends Xa{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...gt||Zn?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new fe),this.initializeOrUpdateStyleSheet(e,s),this._register(Tt.addTarget(o)),K(o,le.KEY_DOWN,l=>{new Wt(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(K(o,le.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){Ue.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof T8&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(l)),d.length>1){const u=d.shift();u&&u.container&&(this.focusItemByElement(u.container),d.push(u)),this.mnemonics.set(c,d)}}})),Zn&&this._register(K(o,le.KEY_DOWN,l=>{const c=new Wt(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Ue.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Ue.stop(l,!0))})),this._register(K(this.domNode,le.MOUSE_OUT,l=>{const c=l.relatedTarget;Cn(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(K(this.actionsList,le.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Cn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}})),this._register(Tt.addTarget(this.actionsList)),this._register(K(this.actionsList,Mt.Tap,l=>{let c=l.initialTarget;if(!(!c||!Cn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Y4(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(K(o,Mt.Change,l=>{Ue.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(K(a,le.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof N8)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(IA(e)?this.styleSheet=vr(e):(mp.globalStyleSheet||(mp.globalStyleSheet=vr()),this.styleSheet=mp.globalStyleSheet)),this.styleSheet.textContent=wDe(t,IA(e))}styleScrollElement(e,t){var i,s;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(s=t.backgroundColor)!==null&&s!==void 0?s:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(K(this.element,le.MOUSE_UP,o=>{if(Ue.stop(o,!0),_r){if(new rr(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(K(this.element,le.CONTEXT_MENU,o=>{Ue.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=re(this.element,we("a.action-menu-item")),this._action.id===Rn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=re(this.item,we("span.menu-item-check"+Ae.asCSSSelector(ie.menuSelection))),this.check.setAttribute("role","none"),this.label=re(this.item,we("span.action-label")),this.options.label&&this.options.keybinding&&(re(this.item,we("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Lo(this.label);let t=$q(this.action.label);if(t){const i=vDe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=jT.exec(t);if(s){t=JC(t),H2.lastIndex=0;let o=H2.exec(t);for(;o&&o[1];)o=H2.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(DL(r(t.substr(0,o.index))," "),we("u",{"aria-hidden":"true"},o[3]),Dfe(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class T8 extends nG{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new fe),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:jS.Right,this.showScheduler=new xi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new xi(()=>{this.element&&!Cn(Yr(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=re(this.item,we("span.submenu-indicator"+Ae.asCSSSelector(ie.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(K(this.element,le.KEY_UP,t=>{const i=new Wt(t);(i.equals(17)||i.equals(3))&&(Ue.stop(t,!0),this.createSubmenu(!0))})),this._register(K(this.element,le.KEY_DOWN,t=>{const i=new Wt(t);Yr()===this.item&&(i.equals(17)||i.equals(3))&&Ue.stop(t,!0)})),this._register(K(this.element,le.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(K(this.element,le.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(K(this.element,le.FOCUS_OUT,t=>{this.element&&!Cn(Yr(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Ue.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=Bg(e.width,t.width,{position:s===jS.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Wt(c).equals(15)&&(Ue.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(K(this.submenuContainer,le.KEY_DOWN,c=>{new Wt(c).equals(15)&&Ue.stop(c,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class N8 extends fD{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function vDe(n){const e=jT,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function M8(n){const e=U$()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function wDe(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${w8(ie.menuSelection)} -${w8(ie.menuSubmenu)} +${M8(ie.menuSelection)} +${M8(ie.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -3153,42 +3200,42 @@ ${w8(ie.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class tDe{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const s=f4(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(we(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=G(this.block,le.MOUSE_DOWN,d=>d.stopPropagation()));const l=new fe,c=e.actionRunner||new Yp;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new pp(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},YLe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(G(window,le.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(G(window,le.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new rr(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),ur(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Gr()===this.lastContainer||Cn(Gr(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Cf(e.error)&&this.notificationService.error(e.error)}}var iDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lg=function(n,e){return function(t,i){e(t,i,n)}};let OT=class extends K{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new tDe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=FT.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Gc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};OT=iDe([lg(0,cc),lg(1,Ln),lg(2,fu),lg(3,gi),lg(4,lu),lg(5,Je)],OT);var FT;(function(n){function e(i){return i&&i.menuId instanceof A}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(r){const d=s.createMenu(r,l??o);ZLe(d,a,c),d.dispose()}return i.getActions?Rn.join(i.getActions(),c):c}})}n.transform=t})(FT||(FT={}));var zS;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(zS||(zS={}));var bP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$S=function(n,e){return function(t,i){e(t,i,n)}},Yu=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let BT=class{constructor(e){this._commandService=e}open(e,t){return Yu(this,void 0,void 0,function*(){if(!oP(e,it.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=$e.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=kT(decodeURIComponent(e.query))}catch{try{i=kT(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};BT=bP([$S(0,gs)],BT);let WT=class{constructor(e){this._editorService=e}open(e,t){return Yu(this,void 0,void 0,function*(){typeof e=="string"&&(e=$e.parse(e));const{selection:i,uri:s}=rSe(e);return e=s,e.scheme===it.file&&(e=Vwe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?zS.USER:zS.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};WT=bP([$S(0,zt)],WT);let VT=class{constructor(e,t){this._openers=new ks,this._validators=new ks,this._resolvers=new ks,this._resolvedUriTargets=new Tn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ks,this._defaultExternalOpener={openExternal:i=>Yu(this,void 0,void 0,function*(){return W7(i,it.http,it.https)?oU(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>Yu(this,void 0,void 0,function*(){return s!=null&&s.openExternal||W7(i,it.mailto,it.http,it.https,it.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new BT(t)),this._openers.push(new WT(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return Yu(this,void 0,void 0,function*(){const s=typeof e=="string"?$e.parse(e):e,o=(i=this._resolvedUriTargets.get(s))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return Yu(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const s=yield i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return Yu(this,void 0,void 0,function*(){const i=typeof e=="string"?$e.parse(e):e;let s;try{s=(yield this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},rn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},rn.None)})}dispose(){this._validators.clear()}};VT=bP([$S(0,zt),$S(1,gs)],VT);const k1=at("editorWorkerService");var Xt;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Xt||(Xt={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=m("sev.error","Error"),t[n.Warning]=m("sev.warning","Warning"),t[n.Info]=m("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case fi.Error:return n.Error;case fi.Warning:return n.Warning;case fi.Info:return n.Info;case fi.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return fi.Error;case n.Warning:return fi.Warning;case n.Info:return fi.Info;case n.Hint:return fi.Ignore}}n.toSeverity=o})(Xt||(Xt={}));var US;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Xt.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(US||(US={}));const ol=at("markerService");function nDe(n,e){const t=[],i=[];for(const s of n)e.has(s)||t.push(s);for(const s of e)n.has(s)||i.push(s);return{removed:t,added:i}}function sDe(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var oDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},y8=function(n,e){return function(t,i){e(t,i,n)}};let HT=class extends K{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new Tn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new rDe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===it.inMemory||e.uri.scheme===it.internal||e.uri.scheme===it.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};HT=oDe([y8(0,fs),y8(1,ol)],HT);class rDe extends K{constructor(e){super(),this.model=e,this._map=new zme,this._register(Ke(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=nDe(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new N(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var aDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},h0=function(n,e){return function(t,i){e(t,i,n)}},gg;function Au(n){return n.toString()}class lDe{constructor(e,t,i){this.model=e,this._modelEventListeners=new fe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const cDe=Zn||gt?1:2;class dDe{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let jS=gg=class extends K{constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let s=An.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(s=f),s<1&&(s=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let r=An.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=cDe;const l=e.eol;l===`\r + `)}return t}class yDe{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const s=x4(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(we(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=K(this.block,le.MOUSE_DOWN,d=>d.stopPropagation()));const l=new fe,c=e.actionRunner||new Xp;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new mp(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},pDe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(K(window,le.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(K(window,le.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new rr(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),ur(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Yr()===this.lastContainer||Cn(Yr(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Cf(e.error)&&this.notificationService.error(e.error)}}var CDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lg=function(n,e){return function(t,i){e(t,i,n)}};let qT=class extends Y{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new yDe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=GT.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Zc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};qT=CDe([lg(0,hc),lg(1,Ln),lg(2,bu),lg(3,pi),lg(4,fu),lg(5,tt)],qT);var GT;(function(n){function e(i){return i&&i.menuId instanceof A}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(r){const d=s.createMenu(r,l??o);mDe(d,a,c),d.dispose()}return i.getActions?Rn.join(i.getActions(),c):c}})}n.transform=t})(GT||(GT={}));var qS;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(qS||(qS={}));var IP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},GS=function(n,e){return function(t,i){e(t,i,n)}},eh=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let KT=class{constructor(e){this._commandService=e}open(e,t){return eh(this,void 0,void 0,function*(){if(!mP(e,it.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=je.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=FT(decodeURIComponent(e.query))}catch{try{i=FT(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};KT=IP([GS(0,fs)],KT);let YT=class{constructor(e){this._editorService=e}open(e,t){return eh(this,void 0,void 0,function*(){typeof e=="string"&&(e=je.parse(e));const{selection:i,uri:s}=DSe(e);return e=s,e.scheme===it.file&&(e=rye(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?qS.USER:qS.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};YT=IP([GS(0,$t)],YT);let ZT=class{constructor(e,t){this._openers=new Ds,this._validators=new Ds,this._resolvers=new Ds,this._resolvedUriTargets=new Tn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ds,this._defaultExternalOpener={openExternal:i=>eh(this,void 0,void 0,function*(){return Q7(i,it.http,it.https)?CU(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>eh(this,void 0,void 0,function*(){return s!=null&&s.openExternal||Q7(i,it.mailto,it.http,it.https,it.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new KT(t)),this._openers.push(new YT(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return eh(this,void 0,void 0,function*(){const s=typeof e=="string"?je.parse(e):e,o=(i=this._resolvedUriTargets.get(s))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return eh(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const s=yield i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return eh(this,void 0,void 0,function*(){const i=typeof e=="string"?je.parse(e):e;let s;try{s=(yield this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},rn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},rn.None)})}dispose(){this._validators.clear()}};ZT=IP([GS(0,$t),GS(1,fs)],ZT);const R1=at("editorWorkerService");var Qt;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Qt||(Qt={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=m("sev.error","Error"),t[n.Warning]=m("sev.warning","Warning"),t[n.Info]=m("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case gi.Error:return n.Error;case gi.Warning:return n.Warning;case gi.Info:return n.Info;case gi.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return gi.Error;case n.Warning:return gi.Warning;case n.Info:return gi.Info;case n.Hint:return gi.Ignore}}n.toSeverity=o})(Qt||(Qt={}));var KS;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Qt.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(KS||(KS={}));const ol=at("markerService");function SDe(n,e){const t=[],i=[];for(const s of n)e.has(s)||t.push(s);for(const s of e)n.has(s)||i.push(s);return{removed:t,added:i}}function xDe(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var LDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},R8=function(n,e){return function(t,i){e(t,i,n)}};let XT=class extends Y{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new Tn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new DDe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===it.inMemory||e.uri.scheme===it.internal||e.uri.scheme===it.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};XT=LDe([R8(0,hs),R8(1,ol)],XT);class DDe extends Y{constructor(e){super(),this.model=e,this._map=new l0e,this._register(Ze(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=SDe(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new N(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var kDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},g0=function(n,e){return function(t,i){e(t,i,n)}},gg;function Pu(n){return n.toString()}class EDe{constructor(e,t,i){this.model=e,this._modelEventListeners=new fe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const IDe=Zn||gt?1:2;class ADe{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let YS=gg=class extends Y{constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let s=An.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(s=f),s<1&&(s=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let r=An.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=IDe;const l=e.eol;l===`\r `?a=2:l===` -`&&(a=1);let c=An.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=An.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=An.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=An.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:s,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,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:bo===3||bo===2?` +`&&(a=1);let c=An.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=An.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=An.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=An.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:s,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,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:_o===3||_o===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=gg._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.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,s){const o=this.getCreationOptions(t,i,s),r=new Za(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Au(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)Sl(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Sl(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Sl(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Au(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new lDe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Vo,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)Sl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Sl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=gg.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Sl(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new dDe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);gg._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new lD}};jS.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;jS=gg=aDe([h0(0,Jt),h0(1,PU),h0(2,QL),h0(3,ki),h0(4,no)],jS);class lD{canComputeSHA1(e){return e.getValueLength()<=lD.MAX_MODEL_SIZE}computeSHA1(e){const t=new WL,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}lD.MAX_MODEL_SIZE=10*1024*1024;class uDe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:K.None}}renderElement(e,t,i,s){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const a=new yr,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class hDe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function fDe(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new hDe(n,e.accessibilityProvider)})}class gDe{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new uDe(l,r));this.list=new ra(e,t,i,a,fDe(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return de.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return de.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return de.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,ts(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Fm=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const pDe=!1;var qS;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(qS||(qS={}));let mDe=4;const _De=new B;let bDe=300;const vDe=new B;class vP{constructor(){this.disposables=new fe}get onPointerMove(){return this.disposables.add(new rt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new rt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}Fm([Si],vP.prototype,"onPointerMove",null);Fm([Si],vP.prototype,"onPointerUp",null);class wP{get onPointerMove(){return this.disposables.add(new rt(this.el,Mt.Change)).event}get onPointerUp(){return this.disposables.add(new rt(this.el,Mt.End)).event}constructor(e){this.el=e,this.disposables=new fe}dispose(){this.disposables.dispose()}}Fm([Si],wP.prototype,"onPointerMove",null);Fm([Si],wP.prototype,"onPointerUp",null);class GS{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}Fm([Si],GS.prototype,"onPointerMove",null);Fm([Si],GS.prototype,"onPointerUp",null);const C8="pointer-events-disabled";class En extends K{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=re(this.el,we(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ke(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=re(this.el,we(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ke(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=bDe,this.hoverDelayer=this._register(new cu(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new fe),this.orthogonalStartDragHandleDisposables=this._register(new fe),this.orthogonalEndSashDisposables=this._register(new fe),this.orthogonalEndDragHandleDisposables=this._register(new fe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=re(e,we(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),gt&&this.el.classList.add("mac");const s=this._register(new rt(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new vP),this));const o=this._register(new rt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new rt(this.el,"mouseenter")).event;this._register(r(()=>En.onMouseEnter(this)));const a=this._register(new rt(this.el,"mouseleave")).event;this._register(a(()=>En.onMouseLeave(this))),this._register(Tt.addTarget(this.el));const l=this._register(new rt(this.el,Mt.Start)).event;this._register(l(u=>this.onPointerStart(u,new wP(this.el)),this));const c=this._register(new rt(this.el,Mt.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=mDe,this._register(_De.event(u=>{this.size=u,this.layout()}))),this._register(vDe.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",pDe),this.layout()}onPointerStart(e,t){ze.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new GS(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new GS(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(C8);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=br(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=gt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=gt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new fe;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{ze.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{ze.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of s)p.classList.remove(C8)};t.onPointerMove(h,null,u),t.onPointerUp(f,null,u),u.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&En.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&En.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){En.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const wDe={separatorBorder:H.transparent};class Hq{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;e!==this.visible&&(e?(this.size=co(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(s=(i=this.view).setVisible)===null||s===void 0||s.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class yDe extends Hq{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class CDe extends Hq{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var vl;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(vl||(vl={}));var KS;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(KS||(KS={}));class zq extends K{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,s,o,r,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=vl.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(s=t.inverseAltBehavior)!==null&&s!==void 0?s:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=re(this.el,we(".sash-container")),this.viewContainer=we(".split-view-container"),this.scrollable=this._register(new v1({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:$o})),this.scrollableElement=this._register(new F4(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new rt(this.viewContainer,"scroll")).event;this._register(l(c=>{const d=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),re(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||wDe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=Us(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,u,d,!0)}),this.contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;othis.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=ur(G(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),G(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=ts(s,-1),p=ts(s+1,this.viewItems.length),_=g.reduce((D,k)=>D+(this.viewItems[k].minimumSize-c[k]),0),v=g.reduce((D,k)=>D+(this.viewItems[k].viewMaximumSize-c[k]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].viewMaximumSize),0),y=Math.max(_,w),S=Math.min(b,v),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const D=this.viewItems[L],k=Math.floor(D.viewMinimumSize/2);h={index:L,limitDelta:D.visible?y-k:y+k,size:D.size}}if(typeof x=="number"){const D=this.viewItems[x],k=Math.floor(D.viewMinimumSize/2);f={index:x,limitDelta:D.visible?S+k:S-k,size:D.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=h?t:t+1,p=this.viewItems[g],_=p.size-p.maximumSize,v=p.size-p.minimumSize,b=h?t-1:t+1;this.resize(b,-u,f,void 0,void 0,_,v)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=co(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==vl.Idle)throw new Error("Cant modify splitview");if(this.state=vl.Busy,e<0||e>=this.viewItems.length)return;const i=ts(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=co(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=vl.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=co(i,a.minimumSize,a.maximumSize);const s=ts(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==vl.Idle)throw new Error("Cant modify splitview");this.state=vl.Busy;const o=we(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(d,h)),a=Ke(()=>this.viewContainer.removeChild(o)),l=ur(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new yDe(o,e,c,l):new CDe(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new En(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new En(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=de.map(f.onDidStart,g)(this.onSashStart,this),b=de.map(f.onDidChange,g)(this.onSashChange,this),y=de.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const D=this.sashItems.findIndex(M=>M.sash===f),k=ts(D,-1),O=ts(D+1,this.viewItems.length),R=this.findFirstSnapIndex(k),P=this.findFirstSnapIndex(O);typeof R=="number"&&!this.viewItems[R].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(D)}),L=ur(_,b,y,S,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=vl.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=ts(e,-1),u=ts(e+1,this.viewItems.length);if(o)for(const x of o)Sk(d,x),Sk(u,x);if(s)for(const x of s)cw(d,x),cw(u,x);const h=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=u.map(x=>this.viewItems[x]),p=u.map(x=>i[x]),_=d.reduce((x,D)=>x+(this.viewItems[D].minimumSize-i[D]),0),v=d.reduce((x,D)=>x+(this.viewItems[D].maximumSize-i[D]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].minimumSize),0),w=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].maximumSize),0),y=Math.max(_,w,r),S=Math.min(b,v,a);let L=!1;if(l){const x=this.viewItems[l.index],D=t>=l.limitDelta;L=D!==x.visible,x.setVisible(D,l.size)}if(!L&&c){const x=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const s=ts(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)Sk(s,a);for(const a of o)cw(s,a);typeof e=="number"&&cw(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Pt(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class E1{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=E1.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=re(e,we(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew xDe(d,u)),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new zq(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new E1(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new ra(e,this.domNode,SDe(i),[c],r)),de.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=s.reduce((f,g)=>f+g.weight,0),h=s[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=br(this.domNode),this.style(kLe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=gg._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.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,s){const o=this.getCreationOptions(t,i,s),r=new Za(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Pu(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)xl(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)xl(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>xl(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Pu(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new EDe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Vo,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)xl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)xl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=gg.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>xl(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new ADe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);gg._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new mD}};YS.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;YS=gg=kDe([g0(0,ei),g0(1,QU),g0(2,rD),g0(3,Ii),g0(4,no)],YS);class mD{canComputeSHA1(e){return e.getValueLength()<=mD.MAX_MODEL_SIZE}computeSHA1(e){const t=new GL,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}mD.MAX_MODEL_SIZE=10*1024*1024;class TDe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Y.None}}renderElement(e,t,i,s){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const a=new Cr,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class NDe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function MDe(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new NDe(n,e.accessibilityProvider)})}class RDe{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new TDe(l,r));this.list=new aa(e,t,i,a,MDe(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return de.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return de.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return de.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,es(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Wm=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const PDe=!1;var ZS;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(ZS||(ZS={}));let ODe=4;const FDe=new B;let BDe=300;const WDe=new B;class AP{constructor(){this.disposables=new fe}get onPointerMove(){return this.disposables.add(new rt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new rt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}Wm([Li],AP.prototype,"onPointerMove",null);Wm([Li],AP.prototype,"onPointerUp",null);class TP{get onPointerMove(){return this.disposables.add(new rt(this.el,Mt.Change)).event}get onPointerUp(){return this.disposables.add(new rt(this.el,Mt.End)).event}constructor(e){this.el=e,this.disposables=new fe}dispose(){this.disposables.dispose()}}Wm([Li],TP.prototype,"onPointerMove",null);Wm([Li],TP.prototype,"onPointerUp",null);class XS{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}Wm([Li],XS.prototype,"onPointerMove",null);Wm([Li],XS.prototype,"onPointerUp",null);const P8="pointer-events-disabled";class En extends Y{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=re(this.el,we(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ze(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=re(this.el,we(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ze(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=BDe,this.hoverDelayer=this._register(new gu(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new fe),this.orthogonalStartDragHandleDisposables=this._register(new fe),this.orthogonalEndSashDisposables=this._register(new fe),this.orthogonalEndDragHandleDisposables=this._register(new fe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=re(e,we(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),gt&&this.el.classList.add("mac");const s=this._register(new rt(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new AP),this));const o=this._register(new rt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new rt(this.el,"mouseenter")).event;this._register(r(()=>En.onMouseEnter(this)));const a=this._register(new rt(this.el,"mouseleave")).event;this._register(a(()=>En.onMouseLeave(this))),this._register(Tt.addTarget(this.el));const l=this._register(new rt(this.el,Mt.Start)).event;this._register(l(u=>this.onPointerStart(u,new TP(this.el)),this));const c=this._register(new rt(this.el,Mt.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=ODe,this._register(FDe.event(u=>{this.size=u,this.layout()}))),this._register(WDe.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",PDe),this.layout()}onPointerStart(e,t){Ue.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new XS(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new XS(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(P8);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=vr(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=gt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=gt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new fe;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{Ue.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{Ue.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of s)p.classList.remove(P8)};t.onPointerMove(h,null,u),t.onPointerUp(f,null,u),u.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&En.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&En.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){En.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const VDe={separatorBorder:z.transparent};class sG{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;e!==this.visible&&(e?(this.size=co(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(s=(i=this.view).setVisible)===null||s===void 0||s.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class HDe extends sG{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class zDe extends sG{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var wl;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(wl||(wl={}));var QS;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(QS||(QS={}));class oG extends Y{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,s,o,r,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=wl.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(s=t.inverseAltBehavior)!==null&&s!==void 0?s:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=re(this.el,we(".sash-container")),this.viewContainer=we(".split-view-container"),this.scrollable=this._register(new D1({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:$o})),this.scrollableElement=this._register(new K4(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new rt(this.viewContainer,"scroll")).event;this._register(l(c=>{const d=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),re(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||VDe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=$s(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,u,d,!0)}),this.contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;othis.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=ur(K(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),K(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=es(s,-1),p=es(s+1,this.viewItems.length),_=g.reduce((D,k)=>D+(this.viewItems[k].minimumSize-c[k]),0),v=g.reduce((D,k)=>D+(this.viewItems[k].viewMaximumSize-c[k]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].viewMaximumSize),0),y=Math.max(_,w),S=Math.min(b,v),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const D=this.viewItems[L],k=Math.floor(D.viewMinimumSize/2);h={index:L,limitDelta:D.visible?y-k:y+k,size:D.size}}if(typeof x=="number"){const D=this.viewItems[x],k=Math.floor(D.viewMinimumSize/2);f={index:x,limitDelta:D.visible?S+k:S-k,size:D.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=h?t:t+1,p=this.viewItems[g],_=p.size-p.maximumSize,v=p.size-p.minimumSize,b=h?t-1:t+1;this.resize(b,-u,f,void 0,void 0,_,v)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=co(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==wl.Idle)throw new Error("Cant modify splitview");if(this.state=wl.Busy,e<0||e>=this.viewItems.length)return;const i=es(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=co(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=wl.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=co(i,a.minimumSize,a.maximumSize);const s=es(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==wl.Idle)throw new Error("Cant modify splitview");this.state=wl.Busy;const o=we(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(d,h)),a=Ze(()=>this.viewContainer.removeChild(o)),l=ur(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new HDe(o,e,c,l):new zDe(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new En(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new En(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=de.map(f.onDidStart,g)(this.onSashStart,this),b=de.map(f.onDidChange,g)(this.onSashChange,this),y=de.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const D=this.sashItems.findIndex(M=>M.sash===f),k=es(D,-1),P=es(D+1,this.viewItems.length),O=this.findFirstSnapIndex(k),R=this.findFirstSnapIndex(P);typeof O=="number"&&!this.viewItems[O].visible||typeof R=="number"&&!this.viewItems[R].visible||this._onDidSashReset.fire(D)}),L=ur(_,b,y,S,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=wl.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=es(e,-1),u=es(e+1,this.viewItems.length);if(o)for(const x of o)Ik(d,x),Ik(u,x);if(s)for(const x of s)mw(d,x),mw(u,x);const h=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=u.map(x=>this.viewItems[x]),p=u.map(x=>i[x]),_=d.reduce((x,D)=>x+(this.viewItems[D].minimumSize-i[D]),0),v=d.reduce((x,D)=>x+(this.viewItems[D].maximumSize-i[D]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].minimumSize),0),w=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].maximumSize),0),y=Math.max(_,w,r),S=Math.min(b,v,a);let L=!1;if(l){const x=this.viewItems[l.index],D=t>=l.limitDelta;L=D!==x.visible,x.setVisible(D,l.size)}if(!L&&c){const x=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const s=es(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)Ik(s,a);for(const a of o)mw(s,a);typeof e=="number"&&mw(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Pt(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class P1{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=P1.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=re(e,we(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew UDe(d,u)),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new oG(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new P1(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new aa(e,this.domNode,$De(i),[c],r)),de.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=s.reduce((f,g)=>f+g.weight,0),h=s[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=vr(this.domNode),this.style(GLe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}cD.InstanceCount=0;class Bm extends oa{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ae.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const LDe=m("caseDescription","Match Case"),DDe=m("wordsDescription","Match Whole Word"),kDe=m("regexDescription","Use Regular Expression");class $q extends Bm{constructor(e){super({icon:ie.caseSensitive,title:LDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Uq extends Bm{constructor(e){super({icon:ie.wholeWord,title:DDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jq extends Bm{constructor(e){super({icon:ie.regex,title:kDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class EDe{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class IDe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new EDe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const f0=we;let ADe=class extends oa{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=re(e,f0(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=re(this.element,f0(".ibwrapper"));if(this.input=re(r,f0(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=re(r,f0("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new aj(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),re(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new rt(document,"selectionchange")),l=de.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Xa(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:ah(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&So(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Ah(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ys(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=re(s,f0(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?zxe(this.message.content,a):Hxe(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",re(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=m("alertWarningMessage","Warning: {0}",this.message.content):i=m("alertInfoMessage","Info: {0}",this.message.content),_1(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const s=this.options.inputBoxStyles,o=(e=s.inputBackground)!==null&&e!==void 0?e:"",r=(t=s.inputForeground)!==null&&t!==void 0?t:"",a=(i=s.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${Ah(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=ah(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class qq extends ADe{constructor(e,t,i){const s=m({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${s}`,r=` (⇅ ${s})`;super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new IDe(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:r,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(d=>{d.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const d=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(r)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Eb(this.value?this.value:m("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Eb(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const TDe=m("defaultLabel","input");class Gq extends oa{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Qr),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||TDe,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qq(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new jq(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new Uq(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new $q(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),ze.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(G(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(G(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new fe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(s=this.wholeWords)===null||s===void 0?void 0:s.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var ma;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(ma||(ma={}));var hh;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(hh||(hh={}));class po extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class yP{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 CP(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function Yb(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function O2(n){return typeof n.collapsible=="boolean"}class NDe{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new KR,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new cu(uU),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element: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=dt.empty(),s={}){if(e.length===0)throw new po(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,o,r){var a;s===void 0&&(s=dt.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],d=t[t.length-1],u=new Rl({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let w=0;wb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,dt.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=dt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=dt.map(i,x=>this.createTreeNode(x,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let x=f;x>=0&&xr.getId(x.element).toString())):a.lastDiffIds=a.children.map(x=>r.getId(x.element).toString()):a.lastDiffIds=void 0;let y=0;for(const x of w)x.visible&&y++;if(y!==0)for(let x=f+_.length;xD+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-x),this.list.splice(l,x,u)}if(w.length>0&&o){const x=D=>{o(D),D.children.forEach(x)};w.forEach(x)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:w});const S=a.children.length>0;g!==S&&this.setCollapsible(e.slice(0,-1),S);let L=a;for(;L;){if(L.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}L=L.parent}}rerender(e){if(e.length===0)throw new po(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!O2(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(O2(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!O2(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||dt.empty(),d=s&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):CP(i)?(e.filterData=i.data,Yb(i.visibility)):(e.filterData=void 0,Yb(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new po(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new po(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new po(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function F2(n){return n instanceof L1?new MDe(n):n}class RDe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=K.None,this.disposables=new fe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,F2(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(F2(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=iS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const h=typeof r=="boolean"?r:r.accept,f=typeof r=="boolean"?void 0:r.effect;return{accept:h,effect:f,feedback:[i]}}return r}if(r.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),_=g&&h.getListIndex(g);return this.onDragOver(e,p,_,s,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},r),{feedback:ts(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(F2(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function PDe(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new RDe(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class SP{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)===null||s===void 0||s.call(i,e.element,t)}}var Zb;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(Zb||(Zb={}));class ODe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new fe,this.onDidChange=de.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class Xb{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Xb.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=K.None,this.disposables=new fe,this.templateId=e.templateId,this.updateOptions(r),de.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=co(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Zb.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=re(e,we(".monaco-tl-row")),i=re(t,we(".monaco-tl-indent")),s=re(t,we(".monaco-tl-twistie")),o=re(t,we(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:K.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Xb.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ae.asClassNameArray(ie.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...Ae.asClassNameArray(ie.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Do(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new fe,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=we(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Ke(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Pt(this.disposables)}}Xb.DefaultIndent=8;class FDe{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new fe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:CP(r)?i=Yb(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Oh.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:Oh.Default,visibility:i};let l;if(this.tree.findMatchType===rf.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=Lq(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Fa.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Oh.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Pt(this.disposables)}}var Fa;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Fa||(Fa={}));var rf;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(rf||(rf={}));let BDe=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new fe,this.disposables=new fe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Fa.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:rf.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,s;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:m("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(s=this.widget)===null||s===void 0||s.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Fa.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Oh.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function S8(n){let e=hh.Unknown;return Wk(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=hh.Twistie:Wk(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=hh.Element:Wk(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=hh.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function Zy(n,e){e(n),n.children.forEach(t=>Zy(t,e))}class B2{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Ki(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>Zy(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>Zy(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>Zy(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=o.get(c);u&&u.visible&&a.push(u)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class WDe extends Mq{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(Iq(e.browserEvent.target)||_d(e.browserEvent.target)||Wg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([r]),this.tree.toggleCollapsed(r,a),o&&s){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class VDe extends ra{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new WDe(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(Qh([...super.getFocus(),...s])),o.length>0&&super.setSelection(Qh([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class Kq{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return de.filter(de.map(this.view.onMouseDblClick,S8),e=>e.target!==hh.Filter)}get onPointer(){return de.map(this.view.onPointer,S8)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return de.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Fa.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:rf.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new KR,this.onDidChangeFindOpenState=de.None,this.disposables=new fe,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B;const a=new SP(i),l=new XO,c=new XO,d=this.disposables.add(new ODe(c.event)),u=new TU;this.renderers=s.map(_=>new Xb(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new FDe(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new B2(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new B2(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new B2(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new VDe(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},PDe(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=de.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new B),p=this.disposables.add(new cu(0));if(this.disposables.add(de.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const _=new Set;for(const v of this.focus.getNodes())_.add(v);for(const v of this.selection.getNodes())_.add(v);g.fire([..._.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const _=de.chain(this.view.onKeyDown,v=>v.filter(b=>!_d(b.target)).map(b=>new Wt(b)));de.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),de.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),de.chain(_,v=>v.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new BDe(this,this.model,this.view,h,o.contextViewProvider,_),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=de.None,this.onDidChangeFindMatchType=de.None;this.styleElement=br(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Zb.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Zb.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Fd(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` -`),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){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);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],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!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],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Pt(this.disposables),this.view.dispose()}}class xP{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new NDe(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=dt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=dt.empty(),i){const s=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=dt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),dt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===ma.Collapsed||t.collapsed===ma.PreserveOrCollapsed?r=!0:t.collapsed===ma.Expanded||t.collapsed===ma.PreserveOrExpanded?r=!1:r=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:r})}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===ma.PreserveOrCollapsed||t.collapsed===ma.PreserveOrExpanded?o=i.collapsed:t.collapsed===ma.Collapsed?o=!0:t.collapsed===ma.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new po(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function Xy(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:dt.map(dt.from(n.children),Xy),collapsible:n.collapsible,collapsed:n.collapsed}}function Qy(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=dt.consume(dt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:dt.map(dt.concat(s,i),Qy),collapsible:n.collapsible,collapsed:n.collapsed}}function zT(n,e=0){let t;return ezT(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function x8(n){return zT(n,0)}function Yq(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:dt.map(dt.from(n.children),i=>Yq(i,e,t))})}const HDe=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class zDe{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new xP(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=dt.empty(),i){const s=i.diffIdentityProvider&&HDe(i.diffIdentityProvider);if(e===null){const g=dt.map(t,this.enabled?Qy:Xy);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new po(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=x8(r),d=Yq(c,e,t),u=(this.enabled?Qy:Xy)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Ki(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||dt.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?u:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=dt.map(i,x8),o=dt.map(s,e?Qy:Xy);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return t}}const $De=n=>n[n.length-1];class LP{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new LP(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function UDe(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function jDe(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class qDe{get onDidSplice(){return de.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return de.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return de.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||$De;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new yP(o=>new LP(s,o)),this.model=new zDe(e,UDe(this.nodeMapper,t),jDe(s,i))}setChildren(e,t=dt.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var GDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class DP extends Kq{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=dt.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new xP(e,t,i)}}class Zq{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}GDe([Si],Zq.prototype,"compressedTreeNodeProvider",null);function KDe(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class Xq extends DP{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new Zq(r,l));super(e,t,i,a,KDe(r,o))}setChildren(e,t=dt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new qDe(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var xc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function W2(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function $T(n,e){return e.parent?e.parent===n?!0:$T(n,e.parent):!1}function YDe(n,e){return n===e||$T(n,e)||$T(e,n)}class kP{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new kP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class ZDe{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ae.asClassNameArray(ie.treeItemLoading)),!0):(t.classList.remove(...Ae.asClassNameArray(ie.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function L8(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function D8(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class XDe extends L1{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function V2(n){return n instanceof L1?new XDe(n):n}class QDe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,V2(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(V2(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(V2(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function Qq(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new QDe(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function UT(n,e){e(n),n.children.forEach(t=>UT(t,e))}class Jq{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return de.map(this.tree.onDidChangeFocus,L8)}get onDidChangeSelection(){return de.map(this.tree.onDidChangeSelection,L8)}get onMouseDblClick(){return de.map(this.tree.onMouseDblClick,D8)}get onPointer(){return de.map(this.tree.onPointer,D8)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new yP(a=>new kP(a)),this.disposables=new fe,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=W2({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new SP(i),a=s.map(c=>new ZDe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Qq(o)||{};return new DP(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return xc(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,o){return xc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new po(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return xc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new po(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new po(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return xc(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return xc(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&YDe(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return xc(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield CA.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return xc(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(dt.empty());else{const o=this.doGetChildren(e);if(jO(o))s=Promise.resolve(o);else{const r=bb(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=yield s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Cf(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return jO(i)?this.processChildren(i):(t=uc(()=>xc(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(pt))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)if(r.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=o.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=W2({element:d,parent:e,hasChildren:u});return u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(d).toString(),f=a.get(h);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,i?f.collapsed?(p.children.forEach(_=>UT(_,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=W2({element:d,parent:e,id:h,hasChildren:u});return s&&s.viewState.focus&&s.viewState.focus.indexOf(h)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(h)>-1&&s.selection.push(g),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(h)>-1?l.push(g):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const d of r.values())UT(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?dt.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class EP{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new EP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class JDe{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ae.asClassNameArray(ie.treeItemLoading)),!0):(t.classList.remove(...Ae.asClassNameArray(ie.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Pt(this.disposables)}}function eke(n){const e=n&&Qq(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class tke extends Jq{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new yP(l=>new EP(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new SP(i),a=s.map(c=>new JDe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=eke(o)||{};return new Xq(e,t,r,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=h=>this.identityProvider.getId(h).toString(),s=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(p.element)for(const _ of p.element.elements)f.add(i(_.element))}return f},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let d=!1;const u=h=>{const f=h.element;if(f)for(let g=0;g{const i=this.filter.filter(t,1),s=ike(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function ike(n){return typeof n=="boolean"?n?1:0:CP(n)?Yb(n.visibility):Yb(n)}class nke extends Kq{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new xP(e,t,i)}}new me("isMac",gt,m("isMac","Whether the operating system is macOS"));new me("isLinux",Zn,m("isLinux","Whether the operating system is Linux"));new me("isWindows",Rs,m("isWindows","Whether the operating system is Windows"));const eG=new me("isWeb",Em,m("isWeb","Whether the platform is a web browser"));new me("isMacNative",gt&&!Em,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new me("isIOS",Bd,m("isIOS","Whether the operating system is iOS"));new me("isMobile",Cue,m("isMobile","Whether the platform is a mobile web browser"));new me("isDevelopment",!1,!0);new me("productQualityType","",m("productQualityType","Quality type of VS Code"));const tG="inputFocus";new me(tG,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var pc=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ot=function(n,e){return function(t,i){e(t,i,n)}};const Yo=at("listService");class ske{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new fe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Rq(br(),"").style(Ff)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),ur(e.onDidFocus(()=>this.setLastFocusedList(e)),Ke(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const Qb=new me("listScrollAtBoundary","none");xe.or(Qb.isEqualTo("top"),Qb.isEqualTo("both"));xe.or(Qb.isEqualTo("bottom"),Qb.isEqualTo("both"));const iG=new me("listFocus",!0),dD=new me("listSupportsMultiselect",!0),nG=xe.and(iG,xe.not(tG)),IP=new me("listHasSelectionOrFocus",!1),AP=new me("listDoubleSelection",!1),TP=new me("listMultiSelection",!1),uD=new me("listSelectionNavigation",!1),oke=new me("listSupportsFind",!0),NP=new me("treeElementCanCollapse",!1),rke=new me("treeElementHasParent",!1),MP=new me("treeElementCanExpand",!1),ake=new me("treeElementHasChild",!1),lke=new me("treeFindOpen",!1),sG="listTypeNavigationMode",oG="listAutomaticKeyboardNavigation";function hD(n,e){const t=n.createScoped(e.getHTMLElement());return iG.bindTo(t),t}function fD(n,e){const t=Qb.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const Bf="workbench.list.multiSelectModifier",Jy="workbench.list.openMode",zo="workbench.list.horizontalScrolling",RP="workbench.list.defaultFindMode",PP="workbench.list.typeNavigationMode",YS="workbench.list.keyboardNavigation",ia="workbench.list.scrollByPage",OP="workbench.list.defaultFindMatchType",Jb="workbench.tree.indent",ZS="workbench.tree.renderIndentGuides",na="workbench.list.smoothScrolling",Qa="workbench.list.mouseWheelScrollSensitivity",Ja="workbench.list.fastScrollSensitivity",XS="workbench.tree.expandMode";function el(n){return n.getValue(Bf)==="alt"}class cke extends K{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=el(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Bf)&&(this.useAltAsMultipleSelectionModifier=el(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Tq(e)}isSelectionRangeChangeEvent(e){return Nq(e)}}function gD(n,e){var t;const i=n.get(Jt),s=n.get(gi),o=new fe;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(na),mouseWheelScrollSensitivity:i.getValue(Qa),fastScrollSensitivity:i.getValue(Ja),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new cke(i)),keyboardNavigationEventFilter:hke(s),scrollByPage:!!i.getValue(ia)}),o]}let jT=class extends ra{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(zo),[u,h]=c.invokeFunction(gD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=hD(r,this),this.disposables.add(fD(this.contextKeyService,this)),this.listSupportsMultiSelect=dD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),uD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=IP.bindTo(this.contextKeyService),this.listDoubleSelection=AP.bindTo(this.contextKeyService),this.listMultiSelection=TP.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=el(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(l));let p={};if(g.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(zo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(ia)){const _=!!l.getValue(ia);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(na)){const _=!!l.getValue(na);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Qa)){const _=l.getValue(Qa);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(Ja)){const _=l.getValue(Ja);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new rG(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?D1(e):Ff)}};jT=pc([Ot(5,Je),Ot(6,Yo),Ot(7,Jt),Ot(8,bt)],jT);let k8=class extends gDe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(zo),[u,h]=c.invokeFunction(gD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new fe,this.disposables.add(h),this.contextKeyService=hD(r,this),this.disposables.add(fD(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=dD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),uD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=el(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(l));let p={};if(g.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(zo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(ia)){const _=!!l.getValue(ia);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(na)){const _=!!l.getValue(na);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Qa)){const _=l.getValue(Qa);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(Ja)){const _=l.getValue(Ja);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new rG(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?D1(e):Ff)}dispose(){this.disposables.dispose(),super.dispose()}};k8=pc([Ot(5,Je),Ot(6,Yo),Ot(7,Jt),Ot(8,bt)],k8);let E8=class extends cD{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(zo),[h,f]=d.invokeFunction(gD,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=hD(a,this),this.disposables.add(fD(this.contextKeyService,this)),this.listSupportsMultiSelect=dD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),uD.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=IP.bindTo(this.contextKeyService),this.listDoubleSelection=AP.bindTo(this.contextKeyService),this.listMultiSelection=TP.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=el(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(c));let _={};if(p.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const v=!!c.getValue(zo);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(ia)){const v=!!c.getValue(ia);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(na)){const v=!!c.getValue(na);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(Qa)){const v=c.getValue(Qa);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(Ja)){const v=c.getValue(Ja);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new dke(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?D1(e):Ff)}dispose(){this.disposables.dispose(),super.dispose()}};E8=pc([Ot(6,Je),Ot(7,Yo),Ot(8,Jt),Ot(9,bt)],E8);class FP extends K{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(de.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Jy))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(Jy)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Jy))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i,o=!1;this._open(this.getSelectedElement(),i,s,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class rG extends FP{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class dke extends FP{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class uke extends FP{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function hke(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let I8=class extends DP{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(I1,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new af(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};I8=pc([Ot(5,bt),Ot(6,Je),Ot(7,Yo),Ot(8,Jt)],I8);let A8=class extends Xq{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(I1,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new af(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};A8=pc([Ot(5,bt),Ot(6,Je),Ot(7,Yo),Ot(8,Jt)],A8);let T8=class extends nke{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(I1,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new af(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};T8=pc([Ot(6,bt),Ot(7,Je),Ot(8,Yo),Ot(9,Jt)],T8);let qT=class extends Jq{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(I1,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new af(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};qT=pc([Ot(6,bt),Ot(7,Je),Ot(8,Yo),Ot(9,Jt)],qT);let N8=class extends tke{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(I1,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new af(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};N8=pc([Ot(7,bt),Ot(8,Je),Ot(9,Yo),Ot(10,Jt)],N8);function aG(n){const e=n.getValue(RP);if(e==="highlight")return Fa.Highlight;if(e==="filter")return Fa.Filter;const t=n.getValue(YS);if(t==="simple"||t==="highlight")return Fa.Highlight;if(t==="filter")return Fa.Filter}function lG(n){const e=n.getValue(OP);if(e==="fuzzy")return rf.Fuzzy;if(e==="contiguous")return rf.Contiguous}function I1(n,e){var t;const i=n.get(Jt),s=n.get(fu),o=n.get(Je),r=n.get(bt),a=()=>{const f=o.getContextKeyValue(sG);if(f==="automatic")return Ea.Automatic;if(f==="trigger"||o.getContextKeyValue(oG)===!1)return Ea.Trigger;const p=i.getValue(PP);if(p==="automatic")return Ea.Automatic;if(p==="trigger")return Ea.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(zo),[c,d]=r.invokeFunction(gD,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(ZS);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(Jb)=="number"?i.getValue(Jb):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(na),defaultFindMode:aG(i),defaultFindMatchType:lG(i),horizontalScrolling:l,scrollByPage:!!i.getValue(ia),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(XS)==="doubleClick",contextViewProvider:s,findWidgetStyles:GLe})}}let af=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=hD(o,e),this.disposables.push(fD(this.contextKeyService,e)),this.listSupportsMultiSelect=dD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),uD.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=oke.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=IP.bindTo(this.contextKeyService),this.hasDoubleSelection=AP.bindTo(this.contextKeyService),this.hasMultiSelection=TP.bindTo(this.contextKeyService),this.treeElementCanCollapse=NP.bindTo(this.contextKeyService),this.treeElementHasParent=rke.bindTo(this.contextKeyService),this.treeElementCanExpand=MP.bindTo(this.contextKeyService),this.treeElementHasChild=ake.bindTo(this.contextKeyService),this.treeFindOpen=lke.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=el(a),this.updateStyleOverrides(s);const d=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(sG),u.add(oG),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(a)),h.affectsConfiguration(Jb)){const g=a.getValue(Jb);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(ZS)&&t.renderIndentGuides===void 0){const g=a.getValue(ZS);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(na)){const g=!!a.getValue(na);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(RP)||h.affectsConfiguration(YS)){const g=aG(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(PP)||h.affectsConfiguration(YS)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(OP)){const g=lG(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(zo)&&t.horizontalScrolling===void 0){const g=!!a.getValue(zo);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(ia)){const g=!!a.getValue(ia);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(XS)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(XS)==="doubleClick"})),h.affectsConfiguration(Qa)){const g=a.getValue(Qa);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(Ja)){const g=a.getValue(Ja);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new uke(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?D1(e):Ff)}dispose(){this.disposables=Pt(this.disposables)}};af=pc([Ot(4,Je),Ot(5,Yo),Ot(6,Jt)],af);const fke=mn.as(Af.Configuration);fke.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Bf]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[Jy]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[zo]:{type:"boolean",default:!1,description:m("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[ia]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Jb]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[ZS]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[na]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Qa]:{type:"number",default:1,markdownDescription:m("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Ja]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[RP]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:m("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[YS]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[OP]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),m("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:m("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[XS]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[PP]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var GT;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(GT||(GT={}));const cG={Quickaccess:"workbench.contributions.quickaccess"};class gke{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ke(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return fL([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}mn.add(cG.Quickaccess,new gke);const pke={ctrlCmd:!1,alt:!1};var ev;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(ev||(ev={}));var ba;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(ba||(ba={}));const BP=at("quickInputService");var mke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},M8=function(n,e){return function(t,i){e(t,i,n)}};let KT=class extends K{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=mn.as(cG.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var s;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let f;if(a&&l&&l!==r){const g=a.value.substr(l.prefix.length);g&&(f=`${r.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===GT.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f=`${r.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new fe,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(s=i==null?void 0:i.itemActivation)!==null&&s!==void 0?s:ba.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new fU,c.add(de.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,o,r,e,i==null?void 0:i.providerOptions));const h=c.add(new yr);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),de.once(d.onDidHide)(()=>{d.selectedItems.length===0&&h.cancel(),c.dispose(),u==null||u.complete(d.selectedItems.slice(0))}),d.show(),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){var s;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(s=t==null?void 0:t.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,s,o){const r=new fe,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ke(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};KT=mke([M8(0,BP),M8(1,bt)],KT);H.white.toString(),H.white.toString();class R8 extends K{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),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,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",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")),e.appendChild(this._element),this._register(Tt.addTarget(this._element)),[le.CLICK,Mt.Tap].forEach(o=>{this._register(G(this._element,o,r=>{if(!this.enabled){ze.stop(r);return}this._onDidClick.fire(r)}))}),this._register(G(this._element,le.KEY_DOWN,o=>{const r=new Wt(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._element.blur(),a=!0),a&&ze.stop(r,!0)})),this._register(G(this._element,le.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(G(this._element,le.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Vd(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 Fh(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}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){var t;if(this._label===e||md(this._label)&&md(e)&&Oxe(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(md(e)){const s=sD(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=G$(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else ds(i)}else this.options.supportIcons?ds(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=Xxe(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class YT{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=re(e,we(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=ub(this.countFormat,this.count),this.element.title=ub(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const P8="done",O8="active",H2="infinite",z2="infinite-long-running",F8="discrete";class pD extends K{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Ci(()=>Ih(this.element),0)),this.longRunningScheduler=this._register(new Ci(()=>this.infiniteLongRunning(),pD.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(O8,H2,z2,F8),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(P8),this.element.classList.contains(H2)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(F8,P8,z2),this.element.classList.add(O8,H2),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(z2)}getContainer(){return this.element}}pD.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const _ke=we;class bke extends K{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>G(this.findInput.inputBox.inputElement,le.KEY_DOWN,r=>{o(new Wt(r))}),this.onMouseDown=o=>G(this.findInput.inputBox.inputElement,le.MOUSE_DOWN,r=>{o(new rr(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=re(this.parent,_ke(".quick-input-box")),this.findInput=this._register(new Gq(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===fi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===fi.Info?1:e===fi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===fi.Info?1:e===fi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class bd{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=re(e,we("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=bd.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&So(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class $2{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class ZT extends K{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new $2(re(e,we(".monaco-icon-label")))),this.labelContainer=re(this.domNode.element,we(".monaco-icon-label-container"));const i=re(this.labelContainer,we("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new yke(i,!!t.supportIcons):this.nameNode=new vke(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(r+=i.title)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof bd?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?bd.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)Wxe(e,t);else{const s=kq(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new $2(re(this.labelContainer,we("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new bd(re(t.element,we("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new $2(re(t.element,we("span.label-description"))))}return this.descriptionNode}}class vke{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&So(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=re(this.container,we("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>kn.intersect(o,a)).filter(a=>!kn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class yke{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&So(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new bd(re(this.container,we("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=wke(e,i,t==null?void 0:t.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function Ske(n,e,t=!1){const i=n||"",s=e||"",o=B8.value.collator.compare(i,s);return B8.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var Dke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class dG{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Dke([Si],dG.prototype,"toString",null);const kke=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Eke(n){const e=[];let t=0,i;for(;i=kke.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{Bge(f)&&ze.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new rt(a,le.CLICK)).event,d=t.disposables.add(new rt(a,le.KEY_DOWN)).event,u=de.chain(d,f=>f.filter(g=>{const p=new Wt(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Tt.addTarget(a));const h=t.disposables.add(new rt(a,Mt.Tap)).event;de.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var uG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Nr=we;class Tke{constructor(e,t,i,s,o,r,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=s,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=r,this._onChecked=a,this.onChecked=s?de.map(de.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):de.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(d=this.item.highlights)===null||d===void 0?void 0:d.detail,this.saneTooltip=this.item.tooltip),this._init=new Sf(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=U0(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>Pxe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class T1{constructor(e){this.themeService=e}get templateId(){return T1.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=re(e,Nr(".quick-input-list-entry"));const i=re(t.entry,Nr("label.quick-input-list-label"));t.toDisposeTemplate.push(Hi(i,le.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=re(i,Nr("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Hi(t.checkbox,le.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=re(i,Nr(".quick-input-list-rows")),o=re(s,Nr(".quick-input-list-row")),r=re(s,Nr(".quick-input-list-row"));t.label=new ZT(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=nU(t.label.element,Nr(".quick-input-list-icon"));const a=re(o,Nr(".quick-input-list-entry-keybinding"));t.keybinding=new A1(a,bo);const l=re(r,Nr(".quick-input-list-label-meta"));return t.detail=new ZT(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=re(t.entry,Nr(".quick-input-list-separator")),t.actionBar=new Xa(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var s,o,r,a;i.element=e,e.element=(s=i.entry)!==null&&s!==void 0?s:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=GL(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=$e.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Hd(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,p)=>{let _=g.iconClass||(g.iconPath?XT(g.iconPath):void 0);return g.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${p}`,class:_,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Pt(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Pt(e.toDisposeElement),e.toDisposeTemplate=Pt(e.toDisposeTemplate)}}T1.ID="listelement";class Nke{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return T1.ID}}var Ji;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(Ji||(Ji={}));class WP{constructor(e,t,i,s){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._listElementChecked=new B,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=re(this.parent,Nr(".quick-input-list"));const o=new Nke,r=new Pke;if(this.list=i.createList("QuickInput",this.container,o,[new T1(s)],{identityProvider:{getId:a=>{var l,c,d,u,h,f,g,p;return(p=(f=(u=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(d=a.item)===null||d===void 0?void 0:d.label)!==null&&u!==void 0?u:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:r}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Wt(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(gt?a.metaKey:a.ctrlKey)&&this.list.setFocus(ts(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(G(this.container,le.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new hU(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>W8(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Cn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>W8(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!Cf(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Cn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return de.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return de.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Pt(this.elementDisposables);const t=r=>this.fireButtonTriggered(r),i=r=>this.fireSeparatorButtonTriggered(r);this.inputElements=e;const s=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((r,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return r;const u=new Tke(a,d,l,o,t,i,this._listElementChecked),h=r.length;return r.push(u),s.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),r},[]),this.elementsToIndexes=s,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Ji.Second&&this.list.length<2&&(e=Ji.First),e){case Ji.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case Ji.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case Ji.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case Ji.Next:{this.list.focusNext(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ji.Previous:{this.list.focusPrevious(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ji.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case Ji.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,s;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(s=this._lastHover)===null||s===void 0||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(s=>{s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!1;const o=s.index&&this.inputElements[s.index-1];s.item&&(s.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let s;this.elements.forEach(o=>{var r,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(r=I2(e,U0(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=Mke(t,U0(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=I2(e,U0(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=I2(e,U0(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(o.labelHighlights=d,o.descriptionHighlights=u,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];s=f&&f.type==="separator"?f:s,s&&!o.hidden&&(o.separator=s,s=void 0)}})}const i=this.elements.filter(s=>!s.hidden);if(this.sortByLabel&&e){const s=e.toLowerCase();i.sort((o,r)=>Rke(o,r,s))}return this.elementsToIndexes=i.reduce((s,o,r)=>{var a;return s.set((a=o.item)!==null&&a!==void 0?a:o.separator,r),s},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Pt(this.elementDisposables),this.disposables=Pt(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new fe;i.add(this.list.onDidChangeFocus(s=>{s.indexes.length&&this.showHover(s.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}uG([Si],WP.prototype,"onDidChangeFocus",null);uG([Si],WP.prototype,"onDidChangeSelection",null);function Mke(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return V8(n,t);const s=bL(t," "),o=t.length-s.length,r=V8(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function V8(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function Rke(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:xke(n.saneSortLabel,e.saneSortLabel,t)}class Pke{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var H8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const QT={iconClass:Ae.asClassName(ie.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class N1 extends K{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=N1.noPromptMessage,this._severity=fi.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new fe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Bd;this._ignoreFocusOut=e&&!Bd,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=ev.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const s=this.getDescription();if(this.ui.description1.textContent!==s&&(this.ui.description1.textContent=s),this.ui.description2.textContent!==s&&(this.ui.description2.textContent=s),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ds(this.ui.widget,this._widget):ds(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new hc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===QT);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new xo(`id-${c}`,"",l.iconClass||XT(l.iconPath),!0,()=>H8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==QT);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new xo(`id-${c}`,"",l.iconClass||XT(l.iconPath),!0,()=>H8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof Bm))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ds(this.ui.message),Ake(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==fi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}N1.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class tv extends N1{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=ba.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?pke:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Ji.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Ji.Next),this.canSelectMany&&this.ui.list.domFocus(),ze.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Ji.Previous):this.ui.list.focus(Ji.Last),this.canSelectMany&&this.ui.list.domFocus(),ze.stop(e,!0);break;case 12:this.ui.list.focus(Ji.NextPage),this.canSelectMany&&this.ui.list.domFocus(),ze.stop(e,!0);break;case 11:this.ui.list.focus(Ji.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),ze.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ji.First),ze.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ji.Last),ze.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ki(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ki(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ki(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return G(this.ui.container,le.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Wt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;if(!s&&i.inputBox&&(s=this.placeholder||tv.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case ba.NONE:this._itemActivation=ba.FIRST;break;case ba.SECOND:this.ui.list.focus(Ji.Second),this._itemActivation=ba.FIRST;break;case ba.LAST:this.ui.list.focus(Ji.Last),this._itemActivation=ba.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ji.First)),this.keepScrollPosition&&(this.scrollTop=e)}}tv.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class Oke extends N1{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Ws=we;class mD extends K{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(G(window,le.KEY_DOWN,e,!0)),this._register(G(window,le.KEY_UP,e,!0)),this._register(G(window,le.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=re(this.parentElement,Ws(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=br(e),i=re(e,Ws(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new Xa(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=re(i,Ws(".quick-input-title")),a=this._register(new Xa(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=re(e,Ws(".quick-input-header")),c=re(l,Ws("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(Hi(c,le.CHANGE,M=>{const $=c.checked;R.setAllVisibleChecked($)})),this._register(G(c,le.CLICK,M=>{(M.x||M.y)&&f.setFocus()}));const d=re(l,Ws(".quick-input-description")),u=re(l,Ws(".quick-input-and-message")),h=re(u,Ws(".quick-input-filter")),f=this._register(new bke(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=re(h,Ws(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new YT(g,{countFormat:m({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),_=re(h,Ws(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new YT(_,{countFormat:m({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=re(l,Ws(".quick-input-action")),w=this._register(new R8(b,this.styles.button));w.label=m("ok","OK"),this._register(w.onDidClick(M=>{this.onDidAcceptEmitter.fire()}));const y=re(l,Ws(".quick-input-action")),S=this._register(new R8(y,this.styles.button));S.label=m("custom","Custom"),this._register(S.onDidClick(M=>{this.onDidCustomEmitter.fire()}));const L=re(u,Ws(`#${this.idPrefix}message.quick-input-message`)),x=this._register(new pD(e,this.styles.progressBar));x.getContainer().classList.add("quick-input-progress");const D=re(e,Ws(".quick-input-html-widget"));D.tabIndex=-1;const k=re(e,Ws(".quick-input-description")),O=this.idPrefix+"list",R=this._register(new WP(e,O,this.options,this.themeService));f.setAttribute("aria-controls",O),this._register(R.onDidChangeFocus(()=>{var M;f.setAttribute("aria-activedescendant",(M=R.getActiveDescendant())!==null&&M!==void 0?M:"")})),this._register(R.onChangedAllVisibleChecked(M=>{c.checked=M})),this._register(R.onChangedVisibleCount(M=>{p.setCount(M)})),this._register(R.onChangedCheckedCount(M=>{v.setCount(M)})),this._register(R.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof tv&&this.controller.canSelectMany&&R.clearFocus()},0)}));const P=Vd(e);return this._register(P),this._register(G(e,le.FOCUS,M=>{Cn(M.relatedTarget,e)||(this.previousFocusElement=M.relatedTarget instanceof HTMLElement?M.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(ev.Blur),this.previousFocusElement=void 0})),this._register(G(e,le.FOCUS,M=>{f.setFocus()})),this._register(Hi(e,le.KEY_DOWN,M=>{if(!Cn(M.target,D))switch(M.keyCode){case 3:ze.stop(M,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:ze.stop(M,!0),this.hide(ev.Gesture);break;case 2:if(!M.altKey&&!M.ctrlKey&&!M.metaKey){const $=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?$.push("input"):$.push("input[type=text]"),this.getUI().list.isDisplayed()&&$.push(".monaco-list"),this.getUI().message&&$.push(".quick-input-message a"),this.getUI().widget){if(Cn(M.target,this.getUI().widget))break;$.push(".quick-input-html-widget")}const Y=e.querySelectorAll($.join(", "));M.shiftKey&&M.target===Y[0]?(ze.stop(M,!0),R.clearFocus()):!M.shiftKey&&Cn(M.target,Y[Y.length-1])&&(ze.stop(M,!0),Y[0].focus())}break;case 10:M.ctrlKey&&(ze.stop(M,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:k,description2:d,widget:D,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:w,message:L,customButtonContainer:y,customButton:S,list:R,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:M=>this.show(M),hide:()=>this.hide(),setVisibilities:M=>this.setVisibilities(M),setEnabled:M=>this.setEnabled(M),setContextKey:M=>this.options.setContextKey(M),linkOpenerDelegate:M=>this.options.linkOpenerDelegate(M)},this.updateStyles(),this.ui}pick(e,t={},i=rn.None){return new Promise((s,o)=>{let r=d=>{var u;r=s,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const h=a.items.slice(),f=h.splice(u,1),g=a.activeItems.filter(_=>_!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Pt(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new tv(e)}createInputBox(){const e=this.getUI();return new Oke(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ds(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(fi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ds(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();QT.tooltip=s?m("quickInput.backWithKeybinding","Back ({0})",s):m("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,s;const o=this.controller;if(!o)return;const r=!Cn(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(s=a.parentElement)!==null&&s!==void 0?s:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,mD.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}mD.MAX_WIDTH=600;var Fke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yw=function(n,e){return function(t,i){e(t,i,n)}};let JT=class extends fve{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(KT))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(fc).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(jT,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new mD(Object.assign(Object.assign({},i),t),this.themeService));return s.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>s.layout(o,e.offset.quickPickTop))),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new me(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=rn.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:oe(w9),quickInputForeground:oe(D_e),quickInputTitleBackground:oe(k_e),widgetBorder:oe(qU),widgetShadow:oe(Hl)},inputBox:VS,toggle:WS,countBadge:Oq,button:jLe,progressBar:qLe,keybindingLabel:ULe,list:D1({listBackground:w9,listFocusBackground:$A,listFocusForeground:zA,listInactiveFocusForeground:zA,listInactiveSelectionIconForeground:XU,listInactiveFocusBackground:$A,listFocusOutline:$t,listInactiveFocusOutline:$t}),pickerGroup:{pickerGroupBorder:oe(E_e),pickerGroupForeground:oe(GU)}}}};JT=Fke([Yw(0,bt),Yw(1,Je),Yw(2,oo),Yw(3,Om)],JT);var hG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zg=function(n,e){return function(t,i){e(t,i,n)}};let eN=class extends JT{constructor(e,t,i,s,o){super(t,i,s,new hT(e.getContainerDomNode(),o)),this.host=void 0;const r=gm.get(e);if(r){const a=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};eN=hG([zg(1,bt),zg(2,Je),zg(3,oo),zg(4,zt)],eN);let tN=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(eN,e);this.mapEditorToService.set(e,t),Up(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=rn.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};tN=hG([zg(0,bt),zg(1,zt)],tN);class gm{static get(e){return e.getContribution(gm.ID)}constructor(e){this.editor=e,this.widget=new _D(this.editor)}dispose(){this.widget.dispose()}}gm.ID="editor.controller.quickInput";class _D{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return _D.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}_D.ID="editor.contrib.quickInputWidget";Cr(gm.ID,gm,4);class Bke{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function Wke(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=jke(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new zke;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new VP(t,r,a),c=new HP(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=Uke(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const $ke=/\b(comment|string|regex|regexp)\b/;function Uke(n){const e=n.match($ke);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function jke(n,e){return ne?1:0}class VP{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new VP(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class HP{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new HP(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function qke(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>Ms(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Ms(o.format)&&Ms(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:$e.parse(o.location)}))}}n.fromJSONObject=t})($8||($8={}));class Qke{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:m("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ae.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Ae.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Ae.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!Ae.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const Wf=new Qke;mn.add(Xke.IconContribution,Wf);function Yi(n,e,t,i){return Wf.registerIcon(n,e,t,i)}function gG(){return Wf}function Jke(){const n=k$();for(const e in n){const t="\\"+n[e].toString(16);Wf.registerIcon(e,{fontCharacter:t})}}Jke();const pG="vscode://schemas/icons",mG=mn.as(FL.JSONContribution);mG.registerSchema(pG,Wf.getIconSchema());const U8=new Ci(()=>mG.notifySchemaChanged(pG),200);Wf.onDidChange(()=>{U8.isScheduled()||U8.schedule()});const e2e=Yi("widget-close",ie.close,m("widgetClose","Icon for the close action in widgets."));Yi("goto-previous-location",ie.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Yi("goto-next-location",ie.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));Ae.modify(ie.sync,"spin");Ae.modify(ie.loading,"spin");function t2e(n){const e=new fe,t=e.add(new B),i=gG();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new _G,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${DF(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=r(l);c&&a.push(c)}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Hd(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${DF(l)};${d}${u} font-display: block; }`)}return a.join(` -`)}}}class _G{getIcon(e){const t=gG();let i=e.defaults;for(;Ae.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const $c="vs",L_="vs-dark",mp="hc-black",_p="hc-light",bG=mn.as(jU.ColorContribution),i2e=mn.as(lj.ThemingContribution);class vG{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(eC(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,H.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,H.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=bG.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case $c:return Fo.LIGHT;case mp:return Fo.HIGH_CONTRAST_DARK;case _p:return Fo.HIGH_CONTRAST_LIGHT;default:return Fo.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=iN(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=fG.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=$s.getForeground(o),a=$s.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function eC(n){return n===$c||n===L_||n===mp||n===_p}function iN(n){switch(n){case $c:return Gke;case L_:return Kke;case mp:return Yke;case _p:return Zke}}function Zw(n){const e=iN(n);return new vG(n,e)}class n2e extends K{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new _G,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set($c,Zw($c)),this._knownThemes.set(L_,Zw(L_)),this._knownThemes.set(mp,Zw(mp)),this._knownThemes.set(_p,Zw(_p));const e=this._register(t2e(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme($c),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),R$("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return vA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=br(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),K.None}_registerShadowDomContainer(e){const t=br(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;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($c),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==Zl(this._theme.type)){let t;GL(this._theme.type)?t=e?mp:L_:t=e?_p:$c,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)}};i2e.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of bG.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${E4(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${s.join(` -`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(qke(o)),this._themeCSS=e.join(` -`),this._updateCSS(),vi.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const xr=at("themeService");var s2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},j2=function(n,e){return function(t,i){e(t,i,n)}};let nN=class extends K{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=U0e.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(G(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}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}};nN=s2e([j2(0,Je),j2(1,Om),j2(2,Jt)],nN);var bD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lf=function(n,e){return function(t,i){e(t,i,n)}},pg,Nc;let sN=class{constructor(e,t){this._commandService=e,this._hiddenStates=new QS(t)}createMenu(e,t,i){return new rN(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};sN=bD([lf(0,gs),lf(1,Of)],sN);let QS=pg=class{constructor(e){this._storageService=e,this._disposables=new fe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(pg._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,pg._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(pg._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,s;const o=this._isHiddenByDefault(e,t),r=(s=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&s!==void 0?s:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&nue(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(pg._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};QS._key="menu.hiddenCommands";QS=pg=bD([lf(0,Of)],QS);let oN=Nc=class{constructor(e,t,i,s,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=or.getMenuItems(this._id);let t;e.sort(Nc._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Nc._fillInKbExprKeys(e.when,this._structureContextKeys),A0(e)){if(e.command.precondition&&Nc._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Nc._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&or.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=A0(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=o2e(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new qa(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Nc(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=Rn.join(...d.map(h=>h[1]));u.length>0&&r.push(new eS(a,c,u))}}r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:Nc._compareTitles(A0(e)?e.command.title:e.title,A0(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};oN=Nc=bD([lf(3,gs),lf(4,Je)],oN);let rN=class{constructor(e,t,i,s,o){this._disposables=new fe,this._menuInfo=new oN(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new Ci(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(or.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new fe),l=d=>{let u=!1,h=!1,f=!1;for(const g of d)if(u=u||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,u&&h&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(d=>{const u=d.affectsSome(this._menuInfo.structureContextKeys),h=d.affectsSome(this._menuInfo.preconditionContextKeys),f=d.affectsSome(this._menuInfo.toggledContextKeys);(u||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new m$({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};rN=bD([lf(3,gs),lf(4,Je)],rN);function o2e(n,e,t){const i=Yfe(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=r_({id:`hide/${n.id}/${i}`,label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=r_({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}var r2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},j8=function(n,e){return function(t,i){e(t,i,n)}},Tu=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let aN=class extends K{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(oc||P$)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new fU;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Tu(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(G(this.layoutService.container,"click",e)),this._register(G(this.layoutService.container,"keydown",e)))}writeText(e,t){return Tu(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,s=document.body.appendChild(we("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(s)})}readText(e){return Tu(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return Tu(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Tu(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Tu(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Tu(this,void 0,void 0,function*(){return this.resources})}};aN=r2e([j8(0,Om),j8(1,dc)],aN);const M1=at("clipboardService");var a2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},l2e=function(n,e){return function(t,i){e(t,i,n)}};const D_="data-keybinding-context";class zP{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class pm extends zP{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}pm.INSTANCE=new pm;class iv extends zP{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=x_.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new G8(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...dt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new G8(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(iv._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(iv._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}iv._keyPrefix="config.";class c2e{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class q8{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class G8{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class d2e{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function u2e(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class wG extends K{constructor(e){super(),this._onDidChangeContext=this._register(new cb({merge:t=>new d2e(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new c2e(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new h2e(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new q8(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new q8(e))}getContext(e){return this._isDisposed?pm.INSTANCE:this.getContextValuesContainer(f2e(e))}dispose(){super.dispose(),this._isDisposed=!0}}let lN=class extends wG{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new iv(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?pm.INSTANCE:this._contexts.get(e)||pm.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new zP(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};lN=a2e([l2e(0,Jt)],lN);class h2e extends wG{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Qr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(D_)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(D_,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;u2e(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(D_),super.dispose())}getContextValuesContainer(e){return this._isDisposed?pm.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function f2e(n){for(;n;){if(n.hasAttribute(D_)){const e=n.getAttribute(D_);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function g2e(n,e,t){n.get(Je).createKey(String(e),p2e(t))}function p2e(n){return s$(n,e=>{if(typeof e=="object"&&e.$mid===1)return $e.revive(e).toString();if(e instanceof $e)return e.toString()})}qt.registerCommand("_setContext",g2e);qt.registerCommand({id:"getContextKeyInfo",handler(){return[...me.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:m("getContextKeyInfo","A command that returns information about context keys"),args:[]}});qt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of me.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let m2e=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class K8{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new m2e(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}_D.InstanceCount=0;class Vm extends ra{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ae.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const jDe=m("caseDescription","Match Case"),qDe=m("wordsDescription","Match Whole Word"),GDe=m("regexDescription","Use Regular Expression");class rG extends Vm{constructor(e){super({icon:ie.caseSensitive,title:jDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class aG extends Vm{constructor(e){super({icon:ie.wholeWord,title:qDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class lG extends Vm{constructor(e){super({icon:ie.regex,title:GDe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class KDe{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class YDe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new KDe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const p0=we;let ZDe=class extends ra{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=re(e,p0(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=re(this.element,p0(".ibwrapper"));if(this.input=re(r,p0(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=re(r,p0("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new xj(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),re(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new rt(document,"selectionchange")),l=de.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Xa(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:uh(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Co(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Th(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ws(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=re(s,p0(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?lLe(this.message.content,a):aLe(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",re(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=m("alertWarningMessage","Warning: {0}",this.message.content):i=m("alertInfoMessage","Info: {0}",this.message.content),x1(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const s=this.options.inputBoxStyles,o=(e=s.inputBackground)!==null&&e!==void 0?e:"",r=(t=s.inputForeground)!==null&&t!==void 0?t:"",a=(i=s.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${Th(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=uh(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class cG extends ZDe{constructor(e,t,i){const s=m({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${s}`,r=` (⇅ ${s})`;super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new YDe(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:r,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(d=>{d.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const d=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(r)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Ab(this.value?this.value:m("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Ab(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const XDe=m("defaultLabel","input");class dG extends ra{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Jr),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||XDe,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new cG(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new lG(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new aG(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new rG(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),Ue.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(K(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(K(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new fe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(s=this.wholeWords)===null||s===void 0?void 0:s.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var _a;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(_a||(_a={}));var mh;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(mh||(mh={}));class po extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class NP{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 MP(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function Xb(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function z2(n){return typeof n.collapsible=="boolean"}class QDe{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new o4,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new gu(EU),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element: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=dt.empty(),s={}){if(e.length===0)throw new po(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,o,r){var a;s===void 0&&(s=dt.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],d=t[t.length-1],u=new Ol({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let w=0;wb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,dt.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=dt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=dt.map(i,x=>this.createTreeNode(x,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let x=f;x>=0&&xr.getId(x.element).toString())):a.lastDiffIds=a.children.map(x=>r.getId(x.element).toString()):a.lastDiffIds=void 0;let y=0;for(const x of w)x.visible&&y++;if(y!==0)for(let x=f+_.length;xD+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-x),this.list.splice(l,x,u)}if(w.length>0&&o){const x=D=>{o(D),D.children.forEach(x)};w.forEach(x)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:w});const S=a.children.length>0;g!==S&&this.setCollapsible(e.slice(0,-1),S);let L=a;for(;L;){if(L.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}L=L.parent}}rerender(e){if(e.length===0)throw new po(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!z2(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(z2(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!z2(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||dt.empty(),d=s&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):MP(i)?(e.filterData=i.data,Xb(i.visibility)):(e.filterData=void 0,Xb(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new po(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new po(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new po(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function $2(n){return n instanceof N1?new JDe(n):n}class eke{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Y.None,this.disposables=new fe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,$2(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver($2(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=rS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const h=typeof r=="boolean"?r:r.accept,f=typeof r=="boolean"?void 0:r.effect;return{accept:h,effect:f,feedback:[i]}}return r}if(r.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),_=g&&h.getListIndex(g);return this.onDragOver(e,p,_,s,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},r),{feedback:es(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop($2(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function tke(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new eke(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class RP{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)===null||s===void 0||s.call(i,e.element,t)}}var Qb;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(Qb||(Qb={}));class ike{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new fe,this.onDidChange=de.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class Jb{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Jb.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Y.None,this.disposables=new fe,this.templateId=e.templateId,this.updateOptions(r),de.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=co(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Qb.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=re(e,we(".monaco-tl-row")),i=re(t,we(".monaco-tl-indent")),s=re(t,we(".monaco-tl-twistie")),o=re(t,we(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:Y.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Jb.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ae.asClassNameArray(ie.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...Ae.asClassNameArray(ie.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Lo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new fe,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=we(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Ze(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Pt(this.disposables)}}Jb.DefaultIndent=8;class nke{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new fe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:MP(r)?i=Xb(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Fh.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:Fh.Default,visibility:i};let l;if(this.tree.findMatchType===rf.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=zq(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Fa.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Fh.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Pt(this.disposables)}}var Fa;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Fa||(Fa={}));var rf;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(rf||(rf={}));let ske=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new fe,this.disposables=new fe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Fa.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:rf.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,s;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:m("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(s=this.widget)===null||s===void 0||s.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Fa.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Fh.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function O8(n){let e=mh.Unknown;return jk(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=mh.Twistie:jk(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=mh.Element:jk(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=mh.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function nC(n,e){e(n),n.children.forEach(t=>nC(t,e))}class U2{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Ki(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>nC(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>nC(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>nC(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=o.get(c);u&&u.visible&&a.push(u)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class oke extends Zq{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(qq(e.browserEvent.target)||wd(e.browserEvent.target)||Wg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([r]),this.tree.toggleCollapsed(r,a),o&&s){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class rke extends aa{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new oke(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(Qh([...super.getFocus(),...s])),o.length>0&&super.setSelection(Qh([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class uG{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return de.filter(de.map(this.view.onMouseDblClick,O8),e=>e.target!==mh.Filter)}get onPointer(){return de.map(this.view.onPointer,O8)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return de.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Fa.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:rf.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new o4,this.onDidChangeFindOpenState=de.None,this.disposables=new fe,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B;const a=new RP(i),l=new dF,c=new dF,d=this.disposables.add(new ike(c.event)),u=new KU;this.renderers=s.map(_=>new Jb(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new nke(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new U2(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new U2(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new U2(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new rke(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},tke(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=de.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new B),p=this.disposables.add(new gu(0));if(this.disposables.add(de.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const _=new Set;for(const v of this.focus.getNodes())_.add(v);for(const v of this.selection.getNodes())_.add(v);g.fire([..._.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const _=de.chain(this.view.onKeyDown,v=>v.filter(b=>!wd(b.target)).map(b=>new Wt(b)));de.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),de.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),de.chain(_,v=>v.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new ske(this,this.model,this.view,h,o.contextViewProvider,_),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=de.None,this.onDidChangeFindMatchType=de.None;this.styleElement=vr(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Qb.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Qb.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),zd(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` +`),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){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);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],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!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],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Pt(this.disposables),this.view.dispose()}}class PP{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new QDe(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=dt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=dt.empty(),i){const s=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=dt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),dt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===_a.Collapsed||t.collapsed===_a.PreserveOrCollapsed?r=!0:t.collapsed===_a.Expanded||t.collapsed===_a.PreserveOrExpanded?r=!1:r=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:r})}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===_a.PreserveOrCollapsed||t.collapsed===_a.PreserveOrExpanded?o=i.collapsed:t.collapsed===_a.Collapsed?o=!0:t.collapsed===_a.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new po(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function sC(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:dt.map(dt.from(n.children),sC),collapsible:n.collapsible,collapsed:n.collapsed}}function oC(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=dt.consume(dt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:dt.map(dt.concat(s,i),oC),collapsible:n.collapsible,collapsed:n.collapsed}}function QT(n,e=0){let t;return eQT(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function F8(n){return QT(n,0)}function hG(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:dt.map(dt.from(n.children),i=>hG(i,e,t))})}const ake=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class lke{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new PP(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=dt.empty(),i){const s=i.diffIdentityProvider&&ake(i.diffIdentityProvider);if(e===null){const g=dt.map(t,this.enabled?oC:sC);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new po(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=F8(r),d=hG(c,e,t),u=(this.enabled?oC:sC)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Ki(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||dt.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?u:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=dt.map(i,F8),o=dt.map(s,e?oC:sC);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new po(this.user,`Tree element not found: ${e}`);return t}}const cke=n=>n[n.length-1];class OP{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new OP(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function dke(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function uke(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class hke{get onDidSplice(){return de.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return de.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return de.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||cke;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new NP(o=>new OP(s,o)),this.model=new lke(e,dke(this.nodeMapper,t),uke(s,i))}setChildren(e,t=dt.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var fke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class FP extends uG{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=dt.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new PP(e,t,i)}}class fG{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}fke([Li],fG.prototype,"compressedTreeNodeProvider",null);function gke(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class gG extends FP{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new fG(r,l));super(e,t,i,a,gke(r,o))}setChildren(e,t=dt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new hke(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var kc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function j2(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function JT(n,e){return e.parent?e.parent===n?!0:JT(n,e.parent):!1}function pke(n,e){return n===e||JT(n,e)||JT(e,n)}class BP{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new BP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class mke{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ae.asClassNameArray(ie.treeItemLoading)),!0):(t.classList.remove(...Ae.asClassNameArray(ie.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function B8(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function W8(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class _ke extends N1{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function q2(n){return n instanceof N1?new _ke(n):n}class bke{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,q2(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(q2(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(q2(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function pG(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new bke(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function eN(n,e){e(n),n.children.forEach(t=>eN(t,e))}class mG{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return de.map(this.tree.onDidChangeFocus,B8)}get onDidChangeSelection(){return de.map(this.tree.onDidChangeSelection,B8)}get onMouseDblClick(){return de.map(this.tree.onMouseDblClick,W8)}get onPointer(){return de.map(this.tree.onPointer,W8)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new NP(a=>new BP(a)),this.disposables=new fe,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=j2({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new RP(i),a=s.map(c=>new mke(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=pG(o)||{};return new FP(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return kc(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,o){return kc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new po(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return kc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new po(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield de.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new po(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return kc(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return kc(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&pke(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return kc(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield NA.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return kc(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(dt.empty());else{const o=this.doGetChildren(e);if(sF(o))s=Promise.resolve(o);else{const r=wb(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=yield s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Cf(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return sF(i)?this.processChildren(i):(t=gc(()=>kc(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(pt))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)if(r.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=o.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=j2({element:d,parent:e,hasChildren:u});return u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(d).toString(),f=a.get(h);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,i?f.collapsed?(p.children.forEach(_=>eN(_,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=j2({element:d,parent:e,id:h,hasChildren:u});return s&&s.viewState.focus&&s.viewState.focus.indexOf(h)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(h)>-1&&s.selection.push(g),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(h)>-1?l.push(g):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const d of r.values())eN(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?dt.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class WP{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new WP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class vke{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ae.asClassNameArray(ie.treeItemLoading)),!0):(t.classList.remove(...Ae.asClassNameArray(ie.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Pt(this.disposables)}}function wke(n){const e=n&&pG(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class yke extends mG{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new NP(l=>new WP(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new RP(i),a=s.map(c=>new vke(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=wke(o)||{};return new gG(e,t,r,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=h=>this.identityProvider.getId(h).toString(),s=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(p.element)for(const _ of p.element.elements)f.add(i(_.element))}return f},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let d=!1;const u=h=>{const f=h.element;if(f)for(let g=0;g{const i=this.filter.filter(t,1),s=Cke(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function Cke(n){return typeof n=="boolean"?n?1:0:MP(n)?Xb(n.visibility):Xb(n)}class Ske extends uG{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new PP(e,t,i)}}new _e("isMac",gt,m("isMac","Whether the operating system is macOS"));new _e("isLinux",Zn,m("isLinux","Whether the operating system is Linux"));new _e("isWindows",Ms,m("isWindows","Whether the operating system is Windows"));const _G=new _e("isWeb",Am,m("isWeb","Whether the platform is a web browser"));new _e("isMacNative",gt&&!Am,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new _e("isIOS",$d,m("isIOS","Whether the operating system is iOS"));new _e("isMobile",zue,m("isMobile","Whether the platform is a mobile web browser"));new _e("isDevelopment",!1,!0);new _e("productQualityType","",m("productQualityType","Quality type of VS Code"));const bG="inputFocus";new _e(bG,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var bc=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ot=function(n,e){return function(t,i){e(t,i,n)}};const Yo=at("listService");class xke{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new fe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Xq(vr(),"").style(Ff)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),ur(e.onDidFocus(()=>this.setLastFocusedList(e)),Ze(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const ev=new _e("listScrollAtBoundary","none");xe.or(ev.isEqualTo("top"),ev.isEqualTo("both"));xe.or(ev.isEqualTo("bottom"),ev.isEqualTo("both"));const vG=new _e("listFocus",!0),bD=new _e("listSupportsMultiselect",!0),wG=xe.and(vG,xe.not(bG)),VP=new _e("listHasSelectionOrFocus",!1),HP=new _e("listDoubleSelection",!1),zP=new _e("listMultiSelection",!1),vD=new _e("listSelectionNavigation",!1),Lke=new _e("listSupportsFind",!0),$P=new _e("treeElementCanCollapse",!1),Dke=new _e("treeElementHasParent",!1),UP=new _e("treeElementCanExpand",!1),kke=new _e("treeElementHasChild",!1),Eke=new _e("treeFindOpen",!1),yG="listTypeNavigationMode",CG="listAutomaticKeyboardNavigation";function wD(n,e){const t=n.createScoped(e.getHTMLElement());return vG.bindTo(t),t}function yD(n,e){const t=ev.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const Bf="workbench.list.multiSelectModifier",rC="workbench.list.openMode",zo="workbench.list.horizontalScrolling",jP="workbench.list.defaultFindMode",qP="workbench.list.typeNavigationMode",JS="workbench.list.keyboardNavigation",na="workbench.list.scrollByPage",GP="workbench.list.defaultFindMatchType",tv="workbench.tree.indent",ex="workbench.tree.renderIndentGuides",sa="workbench.list.smoothScrolling",Qa="workbench.list.mouseWheelScrollSensitivity",Ja="workbench.list.fastScrollSensitivity",tx="workbench.tree.expandMode";function el(n){return n.getValue(Bf)==="alt"}class Ike extends Y{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=el(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Bf)&&(this.useAltAsMultipleSelectionModifier=el(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Kq(e)}isSelectionRangeChangeEvent(e){return Yq(e)}}function CD(n,e){var t;const i=n.get(ei),s=n.get(pi),o=new fe;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(sa),mouseWheelScrollSensitivity:i.getValue(Qa),fastScrollSensitivity:i.getValue(Ja),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new Ike(i)),keyboardNavigationEventFilter:Nke(s),scrollByPage:!!i.getValue(na)}),o]}let tN=class extends aa{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(zo),[u,h]=c.invokeFunction(CD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=wD(r,this),this.disposables.add(yD(this.contextKeyService,this)),this.listSupportsMultiSelect=bD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),vD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=VP.bindTo(this.contextKeyService),this.listDoubleSelection=HP.bindTo(this.contextKeyService),this.listMultiSelection=zP.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=el(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(l));let p={};if(g.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(zo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(na)){const _=!!l.getValue(na);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(sa)){const _=!!l.getValue(sa);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Qa)){const _=l.getValue(Qa);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(Ja)){const _=l.getValue(Ja);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new SG(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?M1(e):Ff)}};tN=bc([Ot(5,tt),Ot(6,Yo),Ot(7,ei),Ot(8,bt)],tN);let V8=class extends RDe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(zo),[u,h]=c.invokeFunction(CD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new fe,this.disposables.add(h),this.contextKeyService=wD(r,this),this.disposables.add(yD(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=bD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),vD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=el(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(l));let p={};if(g.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(zo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(na)){const _=!!l.getValue(na);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(sa)){const _=!!l.getValue(sa);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Qa)){const _=l.getValue(Qa);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(Ja)){const _=l.getValue(Ja);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new SG(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?M1(e):Ff)}dispose(){this.disposables.dispose(),super.dispose()}};V8=bc([Ot(5,tt),Ot(6,Yo),Ot(7,ei),Ot(8,bt)],V8);let H8=class extends _D{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(zo),[h,f]=d.invokeFunction(CD,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=wD(a,this),this.disposables.add(yD(this.contextKeyService,this)),this.listSupportsMultiSelect=bD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),vD.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=VP.bindTo(this.contextKeyService),this.listDoubleSelection=HP.bindTo(this.contextKeyService),this.listMultiSelection=zP.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=el(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(c));let _={};if(p.affectsConfiguration(zo)&&this.horizontalScrolling===void 0){const v=!!c.getValue(zo);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(na)){const v=!!c.getValue(na);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(sa)){const v=!!c.getValue(sa);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(Qa)){const v=c.getValue(Qa);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(Ja)){const v=c.getValue(Ja);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new Ake(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?M1(e):Ff)}dispose(){this.disposables.dispose(),super.dispose()}};H8=bc([Ot(6,tt),Ot(7,Yo),Ot(8,ei),Ot(9,bt)],H8);class KP extends Y{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(de.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(rC))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(rC)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(rC))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i,o=!1;this._open(this.getSelectedElement(),i,s,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class SG extends KP{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Ake extends KP{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Tke extends KP{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Nke(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let z8=class extends FP{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(O1,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new af(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};z8=bc([Ot(5,bt),Ot(6,tt),Ot(7,Yo),Ot(8,ei)],z8);let $8=class extends gG{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(O1,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new af(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};$8=bc([Ot(5,bt),Ot(6,tt),Ot(7,Yo),Ot(8,ei)],$8);let U8=class extends Ske{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(O1,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new af(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};U8=bc([Ot(6,bt),Ot(7,tt),Ot(8,Yo),Ot(9,ei)],U8);let iN=class extends mG{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(O1,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new af(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};iN=bc([Ot(6,bt),Ot(7,tt),Ot(8,Yo),Ot(9,ei)],iN);let j8=class extends yke{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(O1,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new af(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};j8=bc([Ot(7,bt),Ot(8,tt),Ot(9,Yo),Ot(10,ei)],j8);function xG(n){const e=n.getValue(jP);if(e==="highlight")return Fa.Highlight;if(e==="filter")return Fa.Filter;const t=n.getValue(JS);if(t==="simple"||t==="highlight")return Fa.Highlight;if(t==="filter")return Fa.Filter}function LG(n){const e=n.getValue(GP);if(e==="fuzzy")return rf.Fuzzy;if(e==="contiguous")return rf.Contiguous}function O1(n,e){var t;const i=n.get(ei),s=n.get(bu),o=n.get(tt),r=n.get(bt),a=()=>{const f=o.getContextKeyValue(yG);if(f==="automatic")return Ea.Automatic;if(f==="trigger"||o.getContextKeyValue(CG)===!1)return Ea.Trigger;const p=i.getValue(qP);if(p==="automatic")return Ea.Automatic;if(p==="trigger")return Ea.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(zo),[c,d]=r.invokeFunction(CD,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(ex);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(tv)=="number"?i.getValue(tv):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(sa),defaultFindMode:xG(i),defaultFindMatchType:LG(i),horizontalScrolling:l,scrollByPage:!!i.getValue(na),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(tx)==="doubleClick",contextViewProvider:s,findWidgetStyles:fDe})}}let af=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=wD(o,e),this.disposables.push(yD(this.contextKeyService,e)),this.listSupportsMultiSelect=bD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),vD.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Lke.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=VP.bindTo(this.contextKeyService),this.hasDoubleSelection=HP.bindTo(this.contextKeyService),this.hasMultiSelection=zP.bindTo(this.contextKeyService),this.treeElementCanCollapse=$P.bindTo(this.contextKeyService),this.treeElementHasParent=Dke.bindTo(this.contextKeyService),this.treeElementCanExpand=UP.bindTo(this.contextKeyService),this.treeElementHasChild=kke.bindTo(this.contextKeyService),this.treeFindOpen=Eke.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=el(a),this.updateStyleOverrides(s);const d=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(yG),u.add(CG),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(Bf)&&(this._useAltAsMultipleSelectionModifier=el(a)),h.affectsConfiguration(tv)){const g=a.getValue(tv);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(ex)&&t.renderIndentGuides===void 0){const g=a.getValue(ex);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(sa)){const g=!!a.getValue(sa);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(jP)||h.affectsConfiguration(JS)){const g=xG(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(qP)||h.affectsConfiguration(JS)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(GP)){const g=LG(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(zo)&&t.horizontalScrolling===void 0){const g=!!a.getValue(zo);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(na)){const g=!!a.getValue(na);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(tx)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(tx)==="doubleClick"})),h.affectsConfiguration(Qa)){const g=a.getValue(Qa);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(Ja)){const g=a.getValue(Ja);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new Tke(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?M1(e):Ff)}dispose(){this.disposables=Pt(this.disposables)}};af=bc([Ot(4,tt),Ot(5,Yo),Ot(6,ei)],af);const Mke=mn.as(Af.Configuration);Mke.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Bf]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[rC]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[zo]:{type:"boolean",default:!1,description:m("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[na]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[tv]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[ex]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[sa]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Qa]:{type:"number",default:1,markdownDescription:m("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Ja]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[jP]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:m("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[JS]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[GP]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),m("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:m("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[tx]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[qP]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var nN;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(nN||(nN={}));const DG={Quickaccess:"workbench.contributions.quickaccess"};class Rke{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ze(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return yL([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}mn.add(DG.Quickaccess,new Rke);const Pke={ctrlCmd:!1,alt:!1};var iv;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(iv||(iv={}));var va;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(va||(va={}));const YP=at("quickInputService");var Oke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q8=function(n,e){return function(t,i){e(t,i,n)}};let sN=class extends Y{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=mn.as(DG.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var s;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let f;if(a&&l&&l!==r){const g=a.value.substr(l.prefix.length);g&&(f=`${r.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===nN.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f=`${r.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new fe,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(s=i==null?void 0:i.itemActivation)!==null&&s!==void 0?s:va.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new AU,c.add(de.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,o,r,e,i==null?void 0:i.providerOptions));const h=c.add(new Cr);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),de.once(d.onDidHide)(()=>{d.selectedItems.length===0&&h.cancel(),c.dispose(),u==null||u.complete(d.selectedItems.slice(0))}),d.show(),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){var s;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(s=t==null?void 0:t.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,s,o){const r=new fe,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ze(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};sN=Oke([q8(0,YP),q8(1,bt)],sN);z.white.toString(),z.white.toString();class G8 extends Y{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),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,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",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")),e.appendChild(this._element),this._register(Tt.addTarget(this._element)),[le.CLICK,Mt.Tap].forEach(o=>{this._register(K(this._element,o,r=>{if(!this.enabled){Ue.stop(r);return}this._onDidClick.fire(r)}))}),this._register(K(this._element,le.KEY_DOWN,o=>{const r=new Wt(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._element.blur(),a=!0),a&&Ue.stop(r,!0)})),this._register(K(this._element,le.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(K(this._element,le.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(jd(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 Bh(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}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){var t;if(this._label===e||vd(this._label)&&vd(e)&&iLe(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(vd(e)){const s=hD(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=dU(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else cs(i)}else this.options.supportIcons?cs(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=_Le(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class oN{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=re(e,we(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=fb(this.countFormat,this.count),this.element.title=fb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const K8="done",Y8="active",G2="infinite",K2="infinite-long-running",Z8="discrete";class SD extends Y{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new xi(()=>Ah(this.element),0)),this.longRunningScheduler=this._register(new xi(()=>this.infiniteLongRunning(),SD.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Y8,G2,K2,Z8),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(K8),this.element.classList.contains(G2)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Z8,K8,K2),this.element.classList.add(Y8,G2),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(K2)}getContainer(){return this.element}}SD.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const Fke=we;class Bke extends Y{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>K(this.findInput.inputBox.inputElement,le.KEY_DOWN,r=>{o(new Wt(r))}),this.onMouseDown=o=>K(this.findInput.inputBox.inputElement,le.MOUSE_DOWN,r=>{o(new rr(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=re(this.parent,Fke(".quick-input-box")),this.findInput=this._register(new dG(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===gi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===gi.Info?1:e===gi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===gi.Info?1:e===gi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class yd{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=re(e,we("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=yd.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Co(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class Y2{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class rN extends Y{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Y2(re(e,we(".monaco-icon-label")))),this.labelContainer=re(this.domNode.element,we(".monaco-icon-label-container"));const i=re(this.labelContainer,we("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new Hke(i,!!t.supportIcons):this.nameNode=new Wke(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(r+=i.title)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof yd?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?yd.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)oLe(e,t);else{const s=Uq(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new Y2(re(this.labelContainer,we("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new yd(re(t.element,we("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new Y2(re(t.element,we("span.label-description"))))}return this.descriptionNode}}class Wke{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Co(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=re(this.container,we("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>kn.intersect(o,a)).filter(a=>!kn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class Hke{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Co(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new yd(re(this.container,we("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=Vke(e,i,t==null?void 0:t.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function $ke(n,e,t=!1){const i=n||"",s=e||"",o=X8.value.collator.compare(i,s);return X8.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var qke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class kG{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}qke([Li],kG.prototype,"toString",null);const Gke=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Kke(n){const e=[];let t=0,i;for(;i=Gke.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{spe(f)&&Ue.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new rt(a,le.CLICK)).event,d=t.disposables.add(new rt(a,le.KEY_DOWN)).event,u=de.chain(d,f=>f.filter(g=>{const p=new Wt(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Tt.addTarget(a));const h=t.disposables.add(new rt(a,Mt.Tap)).event;de.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var EG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Mr=we;class Xke{constructor(e,t,i,s,o,r,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=s,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=r,this._onChecked=a,this.onChecked=s?de.map(de.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):de.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(d=this.item.highlights)===null||d===void 0?void 0:d.detail,this.saneTooltip=this.item.tooltip),this._init=new Sf(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=q0(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>tLe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class B1{constructor(e){this.themeService=e}get templateId(){return B1.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=re(e,Mr(".quick-input-list-entry"));const i=re(t.entry,Mr("label.quick-input-list-label"));t.toDisposeTemplate.push(Hi(i,le.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=re(i,Mr("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Hi(t.checkbox,le.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=re(i,Mr(".quick-input-list-rows")),o=re(s,Mr(".quick-input-list-row")),r=re(s,Mr(".quick-input-list-row"));t.label=new rN(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=wU(t.label.element,Mr(".quick-input-list-icon"));const a=re(o,Mr(".quick-input-list-entry-keybinding"));t.keybinding=new F1(a,_o);const l=re(r,Mr(".quick-input-list-label-meta"));return t.detail=new rN(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=re(t.entry,Mr(".quick-input-list-separator")),t.actionBar=new Xa(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var s,o,r,a;i.element=e,e.element=(s=i.entry)!==null&&s!==void 0?s:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=tD(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=je.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=qd(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,p)=>{let _=g.iconClass||(g.iconPath?aN(g.iconPath):void 0);return g.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${p}`,class:_,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Pt(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Pt(e.toDisposeElement),e.toDisposeTemplate=Pt(e.toDisposeTemplate)}}B1.ID="listelement";class Qke{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return B1.ID}}var Ji;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(Ji||(Ji={}));class ZP{constructor(e,t,i,s){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._listElementChecked=new B,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=re(this.parent,Mr(".quick-input-list"));const o=new Qke,r=new t2e;if(this.list=i.createList("QuickInput",this.container,o,[new B1(s)],{identityProvider:{getId:a=>{var l,c,d,u,h,f,g,p;return(p=(f=(u=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(d=a.item)===null||d===void 0?void 0:d.label)!==null&&u!==void 0?u:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:r}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Wt(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(gt?a.metaKey:a.ctrlKey)&&this.list.setFocus(es(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(K(this.container,le.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new IU(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>Q8(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Cn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>Q8(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!Cf(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Cn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return de.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return de.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Pt(this.elementDisposables);const t=r=>this.fireButtonTriggered(r),i=r=>this.fireSeparatorButtonTriggered(r);this.inputElements=e;const s=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((r,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return r;const u=new Xke(a,d,l,o,t,i,this._listElementChecked),h=r.length;return r.push(u),s.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),r},[]),this.elementsToIndexes=s,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Ji.Second&&this.list.length<2&&(e=Ji.First),e){case Ji.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case Ji.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case Ji.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case Ji.Next:{this.list.focusNext(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ji.Previous:{this.list.focusPrevious(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ji.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case Ji.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,s;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(s=this._lastHover)===null||s===void 0||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(s=>{s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!1;const o=s.index&&this.inputElements[s.index-1];s.item&&(s.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let s;this.elements.forEach(o=>{var r,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(r=P2(e,q0(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=Jke(t,q0(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=P2(e,q0(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=P2(e,q0(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(o.labelHighlights=d,o.descriptionHighlights=u,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];s=f&&f.type==="separator"?f:s,s&&!o.hidden&&(o.separator=s,s=void 0)}})}const i=this.elements.filter(s=>!s.hidden);if(this.sortByLabel&&e){const s=e.toLowerCase();i.sort((o,r)=>e2e(o,r,s))}return this.elementsToIndexes=i.reduce((s,o,r)=>{var a;return s.set((a=o.item)!==null&&a!==void 0?a:o.separator,r),s},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Pt(this.elementDisposables),this.disposables=Pt(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new fe;i.add(this.list.onDidChangeFocus(s=>{s.indexes.length&&this.showHover(s.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}EG([Li],ZP.prototype,"onDidChangeFocus",null);EG([Li],ZP.prototype,"onDidChangeSelection",null);function Jke(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return J8(n,t);const s=DL(t," "),o=t.length-s.length,r=J8(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function J8(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function e2e(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:Uke(n.saneSortLabel,e.saneSortLabel,t)}class t2e{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var e6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const lN={iconClass:Ae.asClassName(ie.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class W1 extends Y{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=W1.noPromptMessage,this._severity=gi.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new fe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!$d;this._ignoreFocusOut=e&&!$d,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=iv.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const s=this.getDescription();if(this.ui.description1.textContent!==s&&(this.ui.description1.textContent=s),this.ui.description2.textContent!==s&&(this.ui.description2.textContent=s),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?cs(this.ui.widget,this._widget):cs(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new pc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===lN);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new So(`id-${c}`,"",l.iconClass||aN(l.iconPath),!0,()=>e6(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==lN);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new So(`id-${c}`,"",l.iconClass||aN(l.iconPath),!0,()=>e6(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof Vm))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,cs(this.ui.message),Zke(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==gi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}W1.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class nv extends W1{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=va.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?Pke:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Ji.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Ji.Next),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Ji.Previous):this.ui.list.focus(Ji.Last),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 12:this.ui.list.focus(Ji.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 11:this.ui.list.focus(Ji.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ji.First),Ue.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ji.Last),Ue.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ki(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ki(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ki(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return K(this.ui.container,le.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Wt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;if(!s&&i.inputBox&&(s=this.placeholder||nv.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case va.NONE:this._itemActivation=va.FIRST;break;case va.SECOND:this.ui.list.focus(Ji.Second),this._itemActivation=va.FIRST;break;case va.LAST:this.ui.list.focus(Ji.Last),this._itemActivation=va.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ji.First)),this.keepScrollPosition&&(this.scrollTop=e)}}nv.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class i2e extends W1{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Bs=we;class xD extends Y{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(K(window,le.KEY_DOWN,e,!0)),this._register(K(window,le.KEY_UP,e,!0)),this._register(K(window,le.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=re(this.parentElement,Bs(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=vr(e),i=re(e,Bs(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new Xa(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=re(i,Bs(".quick-input-title")),a=this._register(new Xa(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=re(e,Bs(".quick-input-header")),c=re(l,Bs("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(Hi(c,le.CHANGE,M=>{const W=c.checked;O.setAllVisibleChecked(W)})),this._register(K(c,le.CLICK,M=>{(M.x||M.y)&&f.setFocus()}));const d=re(l,Bs(".quick-input-description")),u=re(l,Bs(".quick-input-and-message")),h=re(u,Bs(".quick-input-filter")),f=this._register(new Bke(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=re(h,Bs(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new oN(g,{countFormat:m({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),_=re(h,Bs(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new oN(_,{countFormat:m({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=re(l,Bs(".quick-input-action")),w=this._register(new G8(b,this.styles.button));w.label=m("ok","OK"),this._register(w.onDidClick(M=>{this.onDidAcceptEmitter.fire()}));const y=re(l,Bs(".quick-input-action")),S=this._register(new G8(y,this.styles.button));S.label=m("custom","Custom"),this._register(S.onDidClick(M=>{this.onDidCustomEmitter.fire()}));const L=re(u,Bs(`#${this.idPrefix}message.quick-input-message`)),x=this._register(new SD(e,this.styles.progressBar));x.getContainer().classList.add("quick-input-progress");const D=re(e,Bs(".quick-input-html-widget"));D.tabIndex=-1;const k=re(e,Bs(".quick-input-description")),P=this.idPrefix+"list",O=this._register(new ZP(e,P,this.options,this.themeService));f.setAttribute("aria-controls",P),this._register(O.onDidChangeFocus(()=>{var M;f.setAttribute("aria-activedescendant",(M=O.getActiveDescendant())!==null&&M!==void 0?M:"")})),this._register(O.onChangedAllVisibleChecked(M=>{c.checked=M})),this._register(O.onChangedVisibleCount(M=>{p.setCount(M)})),this._register(O.onChangedCheckedCount(M=>{v.setCount(M)})),this._register(O.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof nv&&this.controller.canSelectMany&&O.clearFocus()},0)}));const R=jd(e);return this._register(R),this._register(K(e,le.FOCUS,M=>{Cn(M.relatedTarget,e)||(this.previousFocusElement=M.relatedTarget instanceof HTMLElement?M.relatedTarget:void 0)},!0)),this._register(R.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(iv.Blur),this.previousFocusElement=void 0})),this._register(K(e,le.FOCUS,M=>{f.setFocus()})),this._register(Hi(e,le.KEY_DOWN,M=>{if(!Cn(M.target,D))switch(M.keyCode){case 3:Ue.stop(M,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Ue.stop(M,!0),this.hide(iv.Gesture);break;case 2:if(!M.altKey&&!M.ctrlKey&&!M.metaKey){const W=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?W.push("input"):W.push("input[type=text]"),this.getUI().list.isDisplayed()&&W.push(".monaco-list"),this.getUI().message&&W.push(".quick-input-message a"),this.getUI().widget){if(Cn(M.target,this.getUI().widget))break;W.push(".quick-input-html-widget")}const G=e.querySelectorAll(W.join(", "));M.shiftKey&&M.target===G[0]?(Ue.stop(M,!0),O.clearFocus()):!M.shiftKey&&Cn(M.target,G[G.length-1])&&(Ue.stop(M,!0),G[0].focus())}break;case 10:M.ctrlKey&&(Ue.stop(M,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:k,description2:d,widget:D,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:w,message:L,customButtonContainer:y,customButton:S,list:O,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:M=>this.show(M),hide:()=>this.hide(),setVisibilities:M=>this.setVisibilities(M),setEnabled:M=>this.setEnabled(M),setContextKey:M=>this.options.setContextKey(M),linkOpenerDelegate:M=>this.options.linkOpenerDelegate(M)},this.updateStyles(),this.ui}pick(e,t={},i=rn.None){return new Promise((s,o)=>{let r=d=>{var u;r=s,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const h=a.items.slice(),f=h.splice(u,1),g=a.activeItems.filter(_=>_!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Pt(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new nv(e)}createInputBox(){const e=this.getUI();return new i2e(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",cs(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(gi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),cs(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();lN.tooltip=s?m("quickInput.backWithKeybinding","Back ({0})",s):m("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,s;const o=this.controller;if(!o)return;const r=!Cn(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(s=a.parentElement)!==null&&s!==void 0?s:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,xD.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}xD.MAX_WIDTH=600;var n2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iy=function(n,e){return function(t,i){e(t,i,n)}};let cN=class extends Mve{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(sN))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(mc).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(tN,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new xD(Object.assign(Object.assign({},i),t),this.themeService));return s.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>s.layout(o,e.offset.quickPickTop))),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new _e(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=rn.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:oe(M9),quickInputForeground:oe(q_e),quickInputTitleBackground:oe(G_e),widgetBorder:oe(cj),widgetShadow:oe($l)},inputBox:US,toggle:$S,countBadge:Jq,button:uDe,progressBar:hDe,keybindingLabel:dDe,list:M1({listBackground:M9,listFocusBackground:JA,listFocusForeground:QA,listInactiveFocusForeground:QA,listInactiveSelectionIconForeground:gj,listInactiveFocusBackground:JA,listFocusOutline:Ut,listInactiveFocusOutline:Ut}),pickerGroup:{pickerGroupBorder:oe(K_e),pickerGroupForeground:oe(dj)}}}};cN=n2e([iy(0,bt),iy(1,tt),iy(2,oo),iy(3,Bm)],cN);var IG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zg=function(n,e){return function(t,i){e(t,i,n)}};let dN=class extends cN{constructor(e,t,i,s,o){super(t,i,s,new CT(e.getContainerDomNode(),o)),this.host=void 0;const r=mm.get(e);if(r){const a=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};dN=IG([zg(1,bt),zg(2,tt),zg(3,oo),zg(4,$t)],dN);let uN=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(dN,e);this.mapEditorToService.set(e,t),qp(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=rn.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};uN=IG([zg(0,bt),zg(1,$t)],uN);class mm{static get(e){return e.getContribution(mm.ID)}constructor(e){this.editor=e,this.widget=new LD(this.editor)}dispose(){this.widget.dispose()}}mm.ID="editor.controller.quickInput";class LD{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return LD.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}LD.ID="editor.contrib.quickInputWidget";Sr(mm.ID,mm,4);class s2e{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function o2e(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=u2e(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new l2e;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new XP(t,r,a),c=new QP(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=d2e(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const c2e=/\b(comment|string|regex|regexp)\b/;function d2e(n){const e=n.match(c2e);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function u2e(n,e){return ne?1:0}class XP{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new XP(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class QP{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new QP(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function h2e(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>Ns(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Ns(o.format)&&Ns(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:je.parse(o.location)}))}}n.fromJSONObject=t})(i6||(i6={}));class b2e{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:m("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ae.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Ae.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Ae.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!Ae.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` +`)}}const Wf=new b2e;mn.add(_2e.IconContribution,Wf);function Yi(n,e,t,i){return Wf.registerIcon(n,e,t,i)}function TG(){return Wf}function v2e(){const n=U$();for(const e in n){const t="\\"+n[e].toString(16);Wf.registerIcon(e,{fontCharacter:t})}}v2e();const NG="vscode://schemas/icons",MG=mn.as(jL.JSONContribution);MG.registerSchema(NG,Wf.getIconSchema());const n6=new xi(()=>MG.notifySchemaChanged(NG),200);Wf.onDidChange(()=>{n6.isScheduled()||n6.schedule()});const w2e=Yi("widget-close",ie.close,m("widgetClose","Icon for the close action in widgets."));Yi("goto-previous-location",ie.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Yi("goto-next-location",ie.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));Ae.modify(ie.sync,"spin");Ae.modify(ie.loading,"spin");function y2e(n){const e=new fe,t=e.add(new B),i=TG();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new RG,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${WF(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=r(l);c&&a.push(c)}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${qd(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${WF(l)};${d}${u} font-display: block; }`)}return a.join(` +`)}}}class RG{getIcon(e){const t=TG();let i=e.defaults;for(;Ae.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const jc="vs",k_="vs-dark",_p="hc-black",bp="hc-light",PG=mn.as(lj.ColorContribution),C2e=mn.as(Lj.ThemingContribution);class OG{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(aC(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,z.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=hN(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,z.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=PG.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case jc:return Oo.LIGHT;case _p:return Oo.HIGH_CONTRAST_DARK;case bp:return Oo.HIGH_CONTRAST_LIGHT;default:return Oo.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=hN(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=AG.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=zs.getForeground(o),a=zs.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function aC(n){return n===jc||n===k_||n===_p||n===bp}function hN(n){switch(n){case jc:return f2e;case k_:return g2e;case _p:return p2e;case bp:return m2e}}function ny(n){const e=hN(n);return new OG(n,e)}class S2e extends Y{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new RG,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(jc,ny(jc)),this._knownThemes.set(k_,ny(k_)),this._knownThemes.set(_p,ny(_p)),this._knownThemes.set(bp,ny(bp));const e=this._register(y2e(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(jc),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),X$("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return IA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=vr(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Y.None}_registerShadowDomContainer(e){const t=vr(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;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(jc),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==Jl(this._theme.type)){let t;tD(this._theme.type)?t=e?_p:k_:t=e?bp:jc,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)}};C2e.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of PG.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${W4(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${s.join(` +`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(h2e(o)),this._themeCSS=e.join(` +`),this._updateCSS(),yi.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Lr=at("themeService");var x2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X2=function(n,e){return function(t,i){e(t,i,n)}};let fN=class extends Y{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=d_e.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(K(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}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}};fN=x2e([X2(0,tt),X2(1,Bm),X2(2,ei)],fN);var DD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lf=function(n,e){return function(t,i){e(t,i,n)}},pg,Rc;let gN=class{constructor(e,t){this._commandService=e,this._hiddenStates=new ix(t)}createMenu(e,t,i){return new mN(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};gN=DD([lf(0,fs),lf(1,Of)],gN);let ix=pg=class{constructor(e){this._storageService=e,this._disposables=new fe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(pg._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,pg._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(pg._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,s;const o=this._isHiddenByDefault(e,t),r=(s=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&s!==void 0?s:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Sue(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(pg._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};ix._key="menu.hiddenCommands";ix=pg=DD([lf(0,Of)],ix);let pN=Rc=class{constructor(e,t,i,s,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=or.getMenuItems(this._id);let t;e.sort(Rc._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Rc._fillInKbExprKeys(e.when,this._structureContextKeys),N0(e)){if(e.command.precondition&&Rc._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Rc._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&or.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=N0(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=L2e(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new qa(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Rc(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=Rn.join(...d.map(h=>h[1]));u.length>0&&r.push(new sS(a,c,u))}}r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:Rc._compareTitles(N0(e)?e.command.title:e.title,N0(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};pN=Rc=DD([lf(3,fs),lf(4,tt)],pN);let mN=class{constructor(e,t,i,s,o){this._disposables=new fe,this._menuInfo=new pN(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new xi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(or.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new fe),l=d=>{let u=!1,h=!1,f=!1;for(const g of d)if(u=u||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,u&&h&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(d=>{const u=d.affectsSome(this._menuInfo.structureContextKeys),h=d.affectsSome(this._menuInfo.preconditionContextKeys),f=d.affectsSome(this._menuInfo.toggledContextKeys);(u||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new M$({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};mN=DD([lf(3,fs),lf(4,tt)],mN);function L2e(n,e,t){const i=pge(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=l_({id:`hide/${n.id}/${i}`,label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=l_({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}var D2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},s6=function(n,e){return function(t,i){e(t,i,n)}},Ou=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let _N=class extends Y{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(lc||Q$)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new AU;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Ou(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(K(this.layoutService.container,"click",e)),this._register(K(this.layoutService.container,"keydown",e)))}writeText(e,t){return Ou(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,s=document.body.appendChild(we("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(s)})}readText(e){return Ou(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return Ou(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Ou(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Ou(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Ou(this,void 0,void 0,function*(){return this.resources})}};_N=D2e([s6(0,Bm),s6(1,fc)],_N);const V1=at("clipboardService");var k2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},E2e=function(n,e){return function(t,i){e(t,i,n)}};const E_="data-keybinding-context";class JP{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class _m extends JP{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}_m.INSTANCE=new _m;class sv extends JP{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=D_.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new r6(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...dt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new r6(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(sv._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(sv._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}sv._keyPrefix="config.";class I2e{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class o6{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class r6{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class A2e{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function T2e(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class FG extends Y{constructor(e){super(),this._onDidChangeContext=this._register(new ub({merge:t=>new A2e(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new I2e(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new N2e(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new o6(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new o6(e))}getContext(e){return this._isDisposed?_m.INSTANCE:this.getContextValuesContainer(M2e(e))}dispose(){super.dispose(),this._isDisposed=!0}}let bN=class extends FG{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new sv(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?_m.INSTANCE:this._contexts.get(e)||_m.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new JP(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};bN=k2e([E2e(0,ei)],bN);class N2e extends FG{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Jr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(E_)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(E_,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;T2e(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(E_),super.dispose())}getContextValuesContainer(e){return this._isDisposed?_m.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function M2e(n){for(;n;){if(n.hasAttribute(E_)){const e=n.getAttribute(E_);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function R2e(n,e,t){n.get(tt).createKey(String(e),P2e(t))}function P2e(n){return y$(n,e=>{if(typeof e=="object"&&e.$mid===1)return je.revive(e).toString();if(e instanceof je)return e.toString()})}Gt.registerCommand("_setContext",R2e);Gt.registerCommand({id:"getContextKeyInfo",handler(){return[..._e.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:m("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Gt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of _e.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let O2e=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class a6{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new O2e(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> 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]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const _2e=!1;class Y8 extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class JS{constructor(e=new JL,t=!1,i,s=_2e){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(bt,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new K8(r=>r):void 0}createChild(e){return new JS(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Ss.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw jR("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{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof wa?(i=Ss.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Ss.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=qr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[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(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof wa)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){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 wa?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){var s;const o=new K8(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new Y8(o);for(const c of qr.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),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof wa){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new Y8(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof wa){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof wa)return this._createServiceInstance(e,t,i,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new JS(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new ipe(()=>{const c=r._createInstance(t,i,o);for(const[d,u]of a){const h=c[d];if(typeof h=="function")for(const f of u)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,d){if(!l.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let f=a.get(d);return f||(f=new ks,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return Ke(b)}}if(d in c)return c[d];const u=l.value;let h=u[d];return typeof h!="function"||(h=h.bind(u),c[d]=h),h},set(c,d,u){return l.value[d]=u,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ss{static traceInvocation(e,t){return e?new Ss(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const F2e=!1;class l6 extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class nx{constructor(e=new aD,t=!1,i,s=F2e){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(bt,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new a6(r=>r):void 0}createChild(e){return new nx(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Cs.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw i4("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{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof wa?(i=Cs.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Cs.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Kr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[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(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof wa)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){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 wa?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){var s;const o=new a6(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new l6(o);for(const c of Kr.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),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof wa){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new l6(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof wa){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof wa)return this._createServiceInstance(e,t,i,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new nx(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new Cpe(()=>{const c=r._createInstance(t,i,o);for(const[d,u]of a){const h=c[d];if(typeof h=="function")for(const f of u)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,d){if(!l.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let f=a.get(d);return f||(f=new Ds,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return Ze(b)}}if(d in c)return c[d];const u=l.value;let h=u[d];return typeof h!="function"||(h=h.bind(u),c[d]=h),h},set(c,d,u){return l.value[d]=u,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Cs{static traceInvocation(e,t){return e?new Cs(2,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):Ss._None}static traceCreation(e,t){return e?new Ss(1,t.name):Ss._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Ss(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Ss._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` -`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ss._totals.toFixed(2)}ms)`];(e>2||t)&&Ss.all.add(s.join(` -`))}}Ss.all=new Set;Ss._None=new class extends Ss{constructor(){super(0,null)}stop(){}branch(){return this}};Ss._totals=0;const b2e=new Set([it.inMemory,it.vscodeSourceControl,it.walkThrough,it.walkThroughSnippet]);class v2e{constructor(){this._byResource=new Tn,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new Tn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i,s,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:dt.empty():$e.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:dt.empty():dt.map(dt.concat(...this._byOwner.values()),r=>r[1])}}class w2e{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Tn,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 s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(b2e.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Xt.Error?t.errors+=1:i===Xt.Warning?t.warnings+=1:i===Xt.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 Rc{constructor(){this._onMarkerChanged=new m$({delay:0,merge:Rc._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new v2e,this._stats=new w2e(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(rue(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Rc._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=dt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Gl(t)){const o=new Tn;for(const{resource:r,marker:a}of t){const l=Rc._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Rc._accept(l,s)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Rc._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Rc._accept(c,s)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Tn;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class y2e extends K{constructor(){super(...arguments),this._configurationModel=new In}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new In;const e=mn.as(Af.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}}const vD=at("audioCue");class He{static register(e){return new He(e.fileName)}constructor(e){this.fileName=e}}He.error=He.register({fileName:"error.mp3"});He.warning=He.register({fileName:"warning.mp3"});He.foldedArea=He.register({fileName:"foldedAreas.mp3"});He.break=He.register({fileName:"break.mp3"});He.quickFixes=He.register({fileName:"quickFixes.mp3"});He.taskCompleted=He.register({fileName:"taskCompleted.mp3"});He.taskFailed=He.register({fileName:"taskFailed.mp3"});He.terminalBell=He.register({fileName:"terminalBell.mp3"});He.diffLineInserted=He.register({fileName:"diffLineInserted.mp3"});He.diffLineDeleted=He.register({fileName:"diffLineDeleted.mp3"});He.diffLineModified=He.register({fileName:"diffLineModified.mp3"});He.chatRequestSent=He.register({fileName:"chatRequestSent.mp3"});He.chatResponsePending=He.register({fileName:"chatResponsePending.mp3"});He.chatResponseReceived1=He.register({fileName:"chatResponseReceived1.mp3"});He.chatResponseReceived2=He.register({fileName:"chatResponseReceived2.mp3"});He.chatResponseReceived3=He.register({fileName:"chatResponseReceived3.mp3"});He.chatResponseReceived4=He.register({fileName:"chatResponseReceived4.mp3"});class C2e{constructor(e){this.randomOneOf=e}}class ct{static register(e){const t=new C2e("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new ct(t,e.name,e.settingsKey);return ct._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}ct._audioCues=new Set;ct.error=ct.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:He.error,settingsKey:"audioCues.lineHasError"});ct.warning=ct.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:He.warning,settingsKey:"audioCues.lineHasWarning"});ct.foldedArea=ct.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:He.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});ct.break=ct.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:He.break,settingsKey:"audioCues.lineHasBreakpoint"});ct.inlineSuggestion=ct.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:He.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});ct.terminalQuickFix=ct.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:He.quickFixes,settingsKey:"audioCues.terminalQuickFix"});ct.onDebugBreak=ct.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:He.break,settingsKey:"audioCues.onDebugBreak"});ct.noInlayHints=ct.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:He.error,settingsKey:"audioCues.noInlayHints"});ct.taskCompleted=ct.register({name:m("audioCues.taskCompleted","Task Completed"),sound:He.taskCompleted,settingsKey:"audioCues.taskCompleted"});ct.taskFailed=ct.register({name:m("audioCues.taskFailed","Task Failed"),sound:He.taskFailed,settingsKey:"audioCues.taskFailed"});ct.terminalCommandFailed=ct.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:He.error,settingsKey:"audioCues.terminalCommandFailed"});ct.terminalBell=ct.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:He.terminalBell,settingsKey:"audioCues.terminalBell"});ct.notebookCellCompleted=ct.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:He.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});ct.notebookCellFailed=ct.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:He.taskFailed,settingsKey:"audioCues.notebookCellFailed"});ct.diffLineInserted=ct.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:He.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});ct.diffLineDeleted=ct.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:He.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});ct.diffLineModified=ct.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:He.diffLineModified,settingsKey:"audioCues.diffLineModified"});ct.chatRequestSent=ct.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:He.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});ct.chatResponseReceived=ct.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[He.chatResponseReceived1,He.chatResponseReceived2,He.chatResponseReceived3,He.chatResponseReceived4]}});ct.chatResponsePending=ct.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:He.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class S2e extends K{constructor(e,t=[]){super(),this.logger=new Xfe([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const x2e=[];function L2e(){return x2e.slice(0)}var pu=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gn=function(n,e){return function(t,i){e(t,i,n)}},bp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class D2e{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let cN=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Che(new D2e(t))):Promise.reject(new Error("Model not found"))}};cN=pu([gn(0,fs)],cN);class wD{show(){return wD.NULL_PROGRESS_RUNNER}showWhile(e,t){return bp(this,void 0,void 0,function*(){yield e})}}wD.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class k2e{withProgress(e,t,i){return t({report:()=>{}})}}class E2e{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class I2e{confirm(e){return bp(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+` +`)):Cs._None}static traceCreation(e,t){return e?new Cs(1,t.name):Cs._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Cs(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Cs._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Cs._totals.toFixed(2)}ms)`];(e>2||t)&&Cs.all.add(s.join(` +`))}}Cs.all=new Set;Cs._None=new class extends Cs{constructor(){super(0,null)}stop(){}branch(){return this}};Cs._totals=0;const B2e=new Set([it.inMemory,it.vscodeSourceControl,it.walkThrough,it.walkThroughSnippet]);class W2e{constructor(){this._byResource=new Tn,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new Tn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i,s,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:dt.empty():je.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:dt.empty():dt.map(dt.concat(...this._byOwner.values()),r=>r[1])}}class V2e{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Tn,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 s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(B2e.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Qt.Error?t.errors+=1:i===Qt.Warning?t.warnings+=1:i===Qt.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 Oc{constructor(){this._onMarkerChanged=new M$({delay:0,merge:Oc._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new W2e,this._stats=new V2e(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(Due(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Oc._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=dt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Zl(t)){const o=new Tn;for(const{resource:r,marker:a}of t){const l=Oc._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Oc._accept(l,s)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Oc._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Oc._accept(c,s)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Tn;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class H2e extends Y{constructor(){super(...arguments),this._configurationModel=new In}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new In;const e=mn.as(Af.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}}const kD=at("audioCue");class $e{static register(e){return new $e(e.fileName)}constructor(e){this.fileName=e}}$e.error=$e.register({fileName:"error.mp3"});$e.warning=$e.register({fileName:"warning.mp3"});$e.foldedArea=$e.register({fileName:"foldedAreas.mp3"});$e.break=$e.register({fileName:"break.mp3"});$e.quickFixes=$e.register({fileName:"quickFixes.mp3"});$e.taskCompleted=$e.register({fileName:"taskCompleted.mp3"});$e.taskFailed=$e.register({fileName:"taskFailed.mp3"});$e.terminalBell=$e.register({fileName:"terminalBell.mp3"});$e.diffLineInserted=$e.register({fileName:"diffLineInserted.mp3"});$e.diffLineDeleted=$e.register({fileName:"diffLineDeleted.mp3"});$e.diffLineModified=$e.register({fileName:"diffLineModified.mp3"});$e.chatRequestSent=$e.register({fileName:"chatRequestSent.mp3"});$e.chatResponsePending=$e.register({fileName:"chatResponsePending.mp3"});$e.chatResponseReceived1=$e.register({fileName:"chatResponseReceived1.mp3"});$e.chatResponseReceived2=$e.register({fileName:"chatResponseReceived2.mp3"});$e.chatResponseReceived3=$e.register({fileName:"chatResponseReceived3.mp3"});$e.chatResponseReceived4=$e.register({fileName:"chatResponseReceived4.mp3"});class z2e{constructor(e){this.randomOneOf=e}}class ct{static register(e){const t=new z2e("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new ct(t,e.name,e.settingsKey);return ct._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}ct._audioCues=new Set;ct.error=ct.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:$e.error,settingsKey:"audioCues.lineHasError"});ct.warning=ct.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:$e.warning,settingsKey:"audioCues.lineHasWarning"});ct.foldedArea=ct.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:$e.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});ct.break=ct.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:$e.break,settingsKey:"audioCues.lineHasBreakpoint"});ct.inlineSuggestion=ct.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:$e.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});ct.terminalQuickFix=ct.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:$e.quickFixes,settingsKey:"audioCues.terminalQuickFix"});ct.onDebugBreak=ct.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:$e.break,settingsKey:"audioCues.onDebugBreak"});ct.noInlayHints=ct.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:$e.error,settingsKey:"audioCues.noInlayHints"});ct.taskCompleted=ct.register({name:m("audioCues.taskCompleted","Task Completed"),sound:$e.taskCompleted,settingsKey:"audioCues.taskCompleted"});ct.taskFailed=ct.register({name:m("audioCues.taskFailed","Task Failed"),sound:$e.taskFailed,settingsKey:"audioCues.taskFailed"});ct.terminalCommandFailed=ct.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:$e.error,settingsKey:"audioCues.terminalCommandFailed"});ct.terminalBell=ct.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:$e.terminalBell,settingsKey:"audioCues.terminalBell"});ct.notebookCellCompleted=ct.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:$e.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});ct.notebookCellFailed=ct.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:$e.taskFailed,settingsKey:"audioCues.notebookCellFailed"});ct.diffLineInserted=ct.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:$e.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});ct.diffLineDeleted=ct.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:$e.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});ct.diffLineModified=ct.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:$e.diffLineModified,settingsKey:"audioCues.diffLineModified"});ct.chatRequestSent=ct.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:$e.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});ct.chatResponseReceived=ct.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[$e.chatResponseReceived1,$e.chatResponseReceived2,$e.chatResponseReceived3,$e.chatResponseReceived4]}});ct.chatResponsePending=ct.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:$e.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class $2e extends Y{constructor(e,t=[]){super(),this.logger=new _ge([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const U2e=[];function j2e(){return U2e.slice(0)}var wu=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gn=function(n,e){return function(t,i){e(t,i,n)}},vp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class q2e{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let vN=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new zhe(new q2e(t))):Promise.reject(new Error("Model not found"))}};vN=wu([gn(0,hs)],vN);class ED{show(){return ED.NULL_PROGRESS_RUNNER}showWhile(e,t){return vp(this,void 0,void 0,function*(){yield e})}}ED.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class G2e{withProgress(e,t,i){return t({report:()=>{}})}}class K2e{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Y2e{confirm(e){return vp(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),window.confirm(i)}prompt(e){var t,i;return bp(this,void 0,void 0,function*(){let s;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),s=yield(i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:s}})}error(e,t){return bp(this,void 0,void 0,function*(){yield this.prompt({type:fi.Error,message:e,detail:t})})}}class nv{info(e){return this.notify({severity:fi.Info,message:e})}warn(e){return this.notify({severity:fi.Warning,message:e})}error(e){return this.notify({severity:fi.Error,message:e})}notify(e){switch(e.severity){case fi.Error:console.error(e.message);break;case fi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return nv.NO_OP}prompt(e,t,i,s){return nv.NO_OP}status(e,t){return K.None}}nv.NO_OP=new TCe;let dN=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=qt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};dN=pu([gn(0,bt)],dN);let mm=class extends zSe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new fe;g.add(G(f,le.KEY_DOWN,p=>{const _=new Wt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(G(f,le.KEY_UP,p=>{const _=new Wt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new A2e(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,s){return ur(qt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:mA(i.keybinding,bo),command:(s=i.command)!==null&&s!==void 0?s:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ke(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new Q7(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=jb.resolveKeybinding(a,bo);for(const c of l)i[s++]=new Q7(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new ef(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new jb([t],bo)}};mm=pu([gn(0,Je),gn(1,gs),gn(2,cc),gn(3,Ln),gn(4,dc),gn(5,zt)],mm);class A2e extends K{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Z8(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof $e)}class yG{constructor(){this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new y2e;this._configuration=new eD(e.reload(),new In,new In,new In),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=Z8(e)?e:Z8(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new BSe({keys:i,overrides:[]},t,this._configuration);s.source=8,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let uN=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=V.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};uN=pu([gn(0,Jt),gn(1,fs),gn(2,ki)],uN);let hN=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Zn||gt?` +`+t),window.confirm(i)}prompt(e){var t,i;return vp(this,void 0,void 0,function*(){let s;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),s=yield(i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:s}})}error(e,t){return vp(this,void 0,void 0,function*(){yield this.prompt({type:gi.Error,message:e,detail:t})})}}class ov{info(e){return this.notify({severity:gi.Info,message:e})}warn(e){return this.notify({severity:gi.Warning,message:e})}error(e){return this.notify({severity:gi.Error,message:e})}notify(e){switch(e.severity){case gi.Error:console.error(e.message);break;case gi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return ov.NO_OP}prompt(e,t,i,s){return ov.NO_OP}status(e,t){return Y.None}}ov.NO_OP=new XCe;let wN=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Gt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};wN=wu([gn(0,bt)],wN);let bm=class extends lxe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new fe;g.add(K(f,le.KEY_DOWN,p=>{const _=new Wt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(K(f,le.KEY_UP,p=>{const _=new Wt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new Z2e(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,s){return ur(Gt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:DA(i.keybinding,_o),command:(s=i.command)!==null&&s!==void 0?s:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ze(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new u8(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=Gb.resolveKeybinding(a,_o);for(const c of l)i[s++]=new u8(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new ef(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Gb([t],_o)}};bm=wu([gn(0,tt),gn(1,fs),gn(2,hc),gn(3,Ln),gn(4,fc),gn(5,$t)],bm);class Z2e extends Y{constructor(e,t){super(),this.domNode=e,this._register(t)}}function c6(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof je)}class BG{constructor(){this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new H2e;this._configuration=new lD(e.reload(),new In,new In,new In),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=c6(e)?e:c6(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new sxe({keys:i,overrides:[]},t,this._configuration);s.source=8,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let yN=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=H.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};yN=wu([gn(0,ei),gn(1,hs),gn(2,Ii)],yN);let CN=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Zn||gt?` `:`\r -`}};hN=pu([gn(0,Jt)],hN);class T2e{publicLog2(){}}class sv{constructor(){const e=$e.from({scheme:sv.SCHEME,authority:"model",path:"/"});this.workspace={id:ixe,folders:[new exe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===sv.SCHEME?this.workspace.folders[0]:null}}sv.SCHEME="inmemory";function ex(n,e,t){if(!e||!(n instanceof yG))return;const i=[];Object.keys(e).forEach(s=>{NSe(s)&&i.push([`editor.${s}`,e[s]]),t&&MSe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let fN=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return bp(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:aP.convert(e),s=new Map;for(const a of i){if(!(a instanceof Ph))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=s.get(l);c||(c=[],s.set(l,c)),c.push(PSe.replaceMove(N.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:ub(bT.bulkEditServiceSummary,o,r),isApplied:o>0}})}};fN=pu([gn(0,fs)],fN);class N2e{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ea(e)}}let gN=class extends vT{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};gN=pu([gn(0,Om),gn(1,zt)],gN);class M2e{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class R2e extends Gb{constructor(){super()}}class P2e extends S2e{constructor(){super(new Zfe)}}let pN=class extends OT{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};pN=pu([gn(0,cc),gn(1,Ln),gn(2,fu),gn(3,gi),gn(4,lu),gn(5,Je)],pN);class O2e{playAudioCue(e,t){return bp(this,void 0,void 0,function*(){})}}ht(Jt,yG,0);ht(RU,uN,0);ht(PU,hN,0);ht(JSe,sv,0);ht(iD,N2e,0);ht(cc,T2e,0);ht(eq,I2e,0);ht(oq,E2e,0);ht(Ln,nv,0);ht(ol,Rc,0);ht(ki,R2e,0);ht(xr,n2e,0);ht(dc,P2e,0);ht(fs,jS,0);ht(k4,HT,0);ht(Je,lN,0);ht(KSe,k2e,0);ht(x1,wD,0);ht(Of,zLe,0);ht(k1,MA,0);ht(hq,fN,0);ht(nxe,M2e,0);ht(au,cN,0);ht(uu,nN,0);ht(Yo,ske,0);ht(gs,dN,0);ht(gi,mm,0);ht(BP,tN,0);ht(fu,gN,0);ht(fc,VT,0);ht(M1,aN,0);ht(gu,pN,0);ht(lu,sN,0);ht(vD,O2e,0);var Ee;(function(n){const e=new JL;for(const[l,c]of PF())e.set(l,c);const t=new JS(e,!0);e.set(bt,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof wa?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new B;function r(l){if(s)return t;s=!0;for(const[d,u]of PF())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=at(d);e.get(u)instanceof wa&&e.set(u,l[d])}const c=L2e();for(const d of c)try{t.createInstance(d)}catch(u){pt(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new fe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(Ee||(Ee={}));let F2e;function Xl(){return F2e}let CG;function B2e(n){CG=n}class SG{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return CG({owner:i,debugName:()=>{const o=Vf(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>s(this.read(o),o))}}class R1 extends SG{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Pn(n,e){const t=new xG(n,e);try{n(t)}finally{t.finish()}}function W2e(n,e,t){n?e(n):Pn(e,t)}class xG{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=Xl())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Vf(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:s}of t)i.endUpdate(s);(e=Xl())===null||e===void 0||e.handleEndTransaction()}}function $P(n,e,t,i){let s;if(n!==void 0)if(typeof n=="function"){if(s=n(),s!==void 0)return s}else return n;if(e!==void 0&&(s=Vf(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function Vf(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),s=i?i[1]:void 0;return s==null?void 0:s.trim()}function si(n,e){return typeof n=="string"?new mN(void 0,n,e):new mN(n,void 0,e)}class mN extends R1{get debugName(){var e;return(e=$P(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var s;if(this._value===e)return;let o;t||(t=o=new xG(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(s=Xl())===null||s===void 0||s.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function V2e(n,e){return typeof n=="string"?new X8(void 0,n,e):new X8(n,void 0,e)}class X8 extends mN{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const _N=(n,e)=>n===e;function mt(n,e){return e!==void 0?new bN(n,void 0,e,void 0,void 0,void 0,_N):new bN(void 0,void 0,n,void 0,void 0,void 0,_N)}function ov(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new fe;return new bN(i,()=>{var o;return(o=Vf(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),_N)}B2e(mt);class bN extends R1{get debugName(){var e;return(e=$P(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,s,o,r=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=s,this._handleChange=o,this._handleLastObserverRemoved=r,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=Xl())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const s=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=s&&!this._equalityComparator(o,this.value);if((t=Xl())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:s}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new $i}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===3;if(i&&(this.state===1||s)&&(this.state=2,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function LG(n,e){return new CD(n.debugName,e,void 0,void 0)}function ri(n){return new CD(void 0,n,void 0,void 0)}function yD(n,e){return new CD(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function zs(n){const e=new fe,t=LG({debugName:()=>Vf(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return Ke(()=>{t.dispose(),e.dispose()})}class CD{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=Vf(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,s){var o,r;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=Xl())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const s=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=s,this.state=3;try{if(!this.disposed){(e=Xl())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=Xl())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,pb(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=CD})(ri||(ri={}));function Q8(n){return new H2e(n)}class H2e extends SG{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function z2e(n,e){return new Promise(t=>{let i=!1,s=!1;const o=ri(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function As(n,e){return new DG(n,e)}class DG extends R1{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var s;const o=this._getValue(i),r=!this.hasValue||this.value!==o;(s=Xl())===null||s===void 0||s.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:r,hadValue:this.hasValue}),r&&(this.value=o,this.hasValue&&Pn(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Vf(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=DG})(As||(As={}));function Po(n,e){return new $2e(n,e)}class $2e extends R1{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Pn(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function U2e(n){return typeof n=="string"?new J8(n):new J8(void 0,n)}class J8 extends R1{get debugName(){var e;return(e=$P(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Pn(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function tx(n){const e=new j2e(!0);return n.addObserver(e),n.reportChanges(),Ke(()=>{n.removeObserver(e)})}class j2e{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function kG(){return!!v$.VSCODE_DEV}function q2e(n){if(kG()){const e=G2e();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function G2e(){Xw||(Xw=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of Xw){const i=t(e);if(i)return i}}),Xw}let Xw;function K2e(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function Qw(n,e){return n.appendChild(e),Ke(()=>{n.removeChild(e)})}class Y2e extends K{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new UU(e,t)),this._width=si(this,this.elementSizeObserver.getWidth()),this._height=si(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Pn(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function e6(n,e){let t=n.get(),i=t,s=t;const o=si("animatedValue",t);let r=-1;const a=300;let l;e.add(yD({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(n)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=s,t=n.read(d),r=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-r;s=Math.floor(Z2e(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class SD{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${SD._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}SD._counter=0;function vd(n,e){return ri(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Pc(n,e){return X2e([n],e),n}function X2e(n,e){kG()&&Po("reload",i=>q2e(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function sx(n,e,t){const i=new fe,s=[];return i.add(ri(o=>{const r=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const d of s)c.removeZone(d);s.length=0;for(const d of r){const u=c.addZone(d);s.push(u),a.set(d,u)}}),t&&t(!1),i.add(yD({createEmptyChangeSummary(){return[]},handleChange(c,d){const u=l.get(c.changedObservable);return u!==void 0&&d.push(u),!0}},(c,d)=>{for(const u of r)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),n.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const r of s)o.removeZone(r)}),t&&t(!1)}}),i}class Q2e extends yr{dispose(){super.dispose(!0)}}var UP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jP=function(n,e){return function(t,i){e(t,i,n)}},J2e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const eEe=Yi("diff-review-insert",ie.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),tEe=Yi("diff-review-remove",ie.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),iEe=Yi("diff-review-close",ie.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let sd=class extends K{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=ov(this,(d,u)=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=u.add(this._instantiationService.createInstance(vN,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(wN,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(tx(this.model))}next(){Pn(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Pn(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Pn(e=>{this._setVisible(!1,e)})}};sd._ttPolicy=If("diffReview",{createHTML:n=>n});sd=UP([jP(8,bt)],sd);let vN=class extends K{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=si(this,[]),this._currentGroupIdx=si(this,0),this._currentElementIdx=si(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(ri(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=nEe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Pn(c=>{const d=this._editors.modified.getPosition();if(d){const u=l.findIndex(h=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===os.Deleted?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===os.Added&&this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ri(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==os.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(N.fromPositions(new V(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||W2e(t,s=>{this._currentGroupIdx.set(Ge.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Pn(i=>{this._currentElementIdx.set(Ge.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Pn(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===os.Deleted?(this._editors.original.setSelection(N.fromPositions(new V(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==os.Header&&(this._editors.modified.setSelection(N.fromPositions(new V(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};vN=UP([jP(4,vD)],vN);const g0=3;function nEe(n,e,t){const i=[];for(const s of Zz(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*g0)){const o=[];o.push(new oEe);const r=new Ze(Math.max(1,s[0].original.startLineNumber-g0),Math.min(s[s.length-1].original.endLineNumberExclusive+g0,e+1)),a=new Ze(Math.max(1,s[0].modified.startLineNumber-g0),Math.min(s[s.length-1].modified.endLineNumberExclusive+g0,t+1));Xz(s,(d,u)=>{const h=new Ze(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Ze(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new lEe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new rEe(u,g))}),u.modified.forEach(g=>{o.push(new aEe(u,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new sEe(new Ga(l,c),o))}return i}var os;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(os||(os={}));class sEe{constructor(e,t){this.range=e,this.lines=t}}class oEe{constructor(){this.type=os.Header}}class rEe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=os.Deleted,this.modifiedLineNumber=void 0}}class aEe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=os.Added,this.originalLineNumber=void 0}}class lEe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=os.Unchanged}}let wN=class extends K{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._editors=o,this._languageService=r,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Xa(a)),this._register(ri(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new xo("diffreview.close",m("label.close","Close"),"close-diff-review "+Ae.asClassName(iEe),!0,()=>J2e(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new B4(this._content,{})),ds(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ke(()=>{ds(this.domNode)})),this._register(vd(this.domNode,{width:this._width,height:this._height})),this._register(vd(this._content,{width:this._width,height:this._height})),this._register(zs((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Hi(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",m("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Mn(s,i.get(50)),ds(this._content,s);const o=this._editors.original.getModel(),r=this._editors.modified.getModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(66),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let h;if(u.type===os.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=L=>L===0?m("no_lines_changed","no lines changed"):L===1?m("one_line_changed","1 line changed"):m("more_lines_changed","{0} lines changed",L),w=b(p.original.length),y=b(p.modified.length);g.setAttribute("aria-label",m({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,p.original.startLineNumber,w,p.modified.startLineNumber,y));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=mt(g=>this._model.currentElement.read(g)===u);e.add(ri(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(G(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const _="diff-review-spacer";let v=null;switch(e.type){case os.Added:g="diff-review-row line-insert",p=" char-insert",v=eEe;break;case os.Deleted:g="diff-review-row line-delete",p=" char-delete",v=tEe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,b.appendChild(w);const y=document.createElement("span");y.style.width=u+"px",y.style.minWidth=u+"px",y.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText=" ",w.appendChild(y);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const L=document.createElement("span");if(L.className=_,v){const k=document.createElement("span");k.className=Ae.asClassName(v),k.innerText="  ",L.appendChild(k)}else L.innerText="  ";w.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);sd._ttPolicy&&(k=sd._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),x=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);sd._ttPolicy&&(k=sd._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=m("blankLine","blank"));let D="";switch(e.type){case os.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",x,e.originalLineNumber):D=m("equalLine","{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case os.Added:D=m("insertLine","+ {0} modified line {1}",x,e.modifiedLineNumber);break;case os.Deleted:D=m("deleteLine","- {0} original line {1}",x,e.originalLineNumber);break}return b.setAttribute("aria-label",D),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=on.createEmpty(r,o),c=ko.isBasicASCII(r,e.mightContainNonBasicASCII()),d=ko.containsRTL(r,c,e.mightContainRTL());return HL(new Rm(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Mo.OFF,null)).html}};wN=UP([jP(5,ki)],wN);const cEe=Yi("diff-insert",ie.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),IG=Yi("diff-remove",ie.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),t6=Qe.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ae.asClassName(cEe),marginClassName:"gutter-insert"}),i6=Qe.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ae.asClassName(IG),marginClassName:"gutter-delete"}),n6=Qe.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),s6=Qe.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),o6=Qe.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),dEe=Qe.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),uEe=Qe.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),yN=Qe.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),hEe=Qe.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),fEe=Qe.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),gEe=Qe.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new hm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Ae.asClassName(ie.arrowRight),zIndex:10001});class wd extends K{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=As(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Po("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=si(this,0),this._modifiedViewZonesChangedSignal=Po("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Po("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=ov((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),_=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const v=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!v||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const w=_.map(O=>{function R(Se,Ie){const pe=Ie.getTopForLineNumber(Se.startLineNumber,!0),ee=Ie.getTopForLineNumber(Se.endLineNumberExclusive,!0);return(pe+ee)/2}const P=R(O.lineRangeMapping.original,this._editors.original),M=this._originalScrollTop.read(h),$=R(O.lineRangeMapping.modified,this._editors.modified),Y=this._modifiedScrollTop.read(h),ne=P-M,ce=$-Y,ge=Math.min(P,$),se=Math.max(P,$);return{range:new Ge(ge,se),from:ne,to:ce,fromWithoutScroll:P,toWithoutScroll:$,move:O}});w.sort(lue(cr(O=>O.fromWithoutScroll>O.toWithoutScroll,cue),cr(O=>O.fromWithoutScroll>O.toWithoutScroll?O.fromWithoutScroll:-O.toWithoutScroll,ld)));const y=qP.compute(w.map(O=>O.range)),S=10,L=v.verticalScrollbarWidth,x=(y.getTrackCount()-1)*10+S*2,D=L+x+(b.contentLeft-wd.movedCodeBlockPadding);let k=0;for(const O of w){const R=y.getTrack(k),P=L+S+R*10,M=15,$=15,Y=D,ne=b.glyphMarginWidth+b.lineNumbersWidth,ce=18,ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("arrow-rectangle"),ge.setAttribute("x",`${Y-ne}`),ge.setAttribute("y",`${O.to-ce/2}`),ge.setAttribute("width",`${ne}`),ge.setAttribute("height",`${ce}`),this._element.appendChild(ge);const se=document.createElementNS("http://www.w3.org/2000/svg","g"),Se=document.createElementNS("http://www.w3.org/2000/svg","path");Se.setAttribute("d",`M 0 ${O.from} L ${P} ${O.from} L ${P} ${O.to} L ${Y-$} ${O.to}`),Se.setAttribute("fill","none"),se.appendChild(Se);const Ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ie.classList.add("arrow"),f.add(ri(pe=>{Se.classList.toggle("currentMove",O.move===p.activeMovedText.read(pe)),Ie.classList.toggle("currentMove",O.move===p.activeMovedText.read(pe))})),Ie.setAttribute("points",`${Y-$},${O.to-M/2} ${Y},${O.to} ${Y-$},${O.to+M/2}`),se.appendChild(Ie),this._element.appendChild(se),k++}this.width.set(x,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ke(()=>this._element.remove())),this._register(ri(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-wd.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(tx(this._state));const r=mt(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new nx(Q8(p.lineRangeMapping.original.startLineNumber-1),18),modified:new nx(Q8(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(sx(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(sx(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register(zs((h,f)=>{const g=r.read(h);for(const p of g)f.add(new r6(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new r6(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=As(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=As(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Po("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Po("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(yD({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(u="original"),h.didChange(d)&&(u="modified"),!0)},h=>{c.read(h),d.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&u==="original"){const _=a.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.original.contains(_.lineNumber)))}if(g&&u==="modified"){const _=l.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.modified.contains(_.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}wd.movedCodeBlockPadding=4;class qP{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=Ime(t,cr(a=>a.intersectWithRangeLength(s),ld)):(o=t.length,t.push(new v4))),t[o].addRange(s),i.push(o)}return new qP(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class r6 extends EG{constructor(e,t,i,s,o){const r=dn("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=dn("div.diff-moved-code-block",{style:{marginRight:"4px"}},[dn("div.text-content@textContent"),dn("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=As(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(vd(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Xa(this._nodes.actionBar,{highlightToggledItems:!0})),d=new xo("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new xo("","Compare",Ae.asClassName(ie.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ri(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class pEe extends K{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=mt(this,s=>{var o;const r=(o=this._diffModel.read(s))===null||o===void 0?void 0:o.diff.read(s);if(!r)return null;const a=this._diffModel.read(s).movedTextToCompare.read(s),l=this._options.renderIndicators.read(s),c=this._options.showEmptyDecorations.read(s),d=[],u=[];if(!a)for(const f of r.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?i6:s6}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?t6:n6}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:hEe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:dEe});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&d.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?fEe:yN}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?uEe:o6});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:N.fromPositions(new V(f.lineRangeMapping.modified.startLineNumber,1)),options:gEe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?i6:s6});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?t6:n6});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:yN}),u.push({range:_.modifiedRange,options:o6})}const h=this._diffModel.read(s).activeMovedText.read(s);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[wd.movedCodeBlockPadding,0,wd.movedCodeBlockPadding,wd.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:u}}),this._register(ix(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(ix(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class mEe extends K{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=si(this,void 0),this.sashLeft=mt(this,s=>{var o;const r=(o=this._sashRatio.read(s))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(r,s)}),this._sash=this._register(new En(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{const o=this._dimensions.width.get(),r=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/o,void 0);this._sashRatio.set(r/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(ri(s=>{const o=this._options.enableSplitViewResizing.read(s);this._sash.state=o?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class $g{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class a6 extends $g{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class _Ee extends $g{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class Oc extends $g{static create(e,t,i){const s=new yr(i),o=new Oc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=$g.findId(`provider_${d}`,o),f=new _Ee(h,o,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(g=>{for(const p of g||[])Oc._makeOutlineElement(p,f);return f},g=>(lc(g),f)).then(g=>{$g.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Ki(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?Oc.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=$g.findId(e,t),s=new a6(i,t,e);if(e.children)for(const o of e.children)Oc._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=dt.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof a6?e.push(t.symbol):e.push(...dt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>N.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Oc._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>V.compare(N.getStartPosition(i.range),N.getStartPosition(s.range))||V.compare(N.getEndPosition(s.range),N.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&Oc._flattenDocumentSymbols(e,s.children,s.name)}}var AG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},TG=function(n,e){return function(t,i){e(t,i,n)}},bEe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let CN=class extends K{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=s,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=ov(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new SN(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Pn(u=>{for(const h of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Pn(u=>{for(const h of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,u)})}}));const o=this._diffModel.map((c,d)=>{var u,h;return((u=c==null?void 0:c.diff.read(d))===null||u===void 0?void 0:u.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(d))!==null&&h!==void 0?h:[]}),r=ov(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=o.read(c);for(const _ of p)if(!_.shouldHideControls(c)){{const v=mt(w=>_.getHiddenOriginalRange(w).startLineNumber-1),b=new nx(v,24);h.push(b),d.add(new l6(this._editors.original,b,_,_.originalUnchangedRange,!g,u,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}{const v=mt(w=>_.getHiddenModifiedRange(w).startLineNumber-1),b=new nx(v,24);f.push(b),d.add(new l6(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new hm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ae.asClassName(ie.fold),zIndex:10001};this._register(ix(this._editors.original,mt(c=>{const d=o.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:N.fromPositions(new V(h.originalLineNumber,1)),options:l});return u}))),this._register(ix(this._editors.modified,mt(c=>{const d=o.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:Ze.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(sx(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(sx(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(ri(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(VC)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(VC))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};CN=AG([TG(3,nt)],CN);let SN=class extends K{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=si(this,void 0);const i=Po("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Po("_textModel.onDidChangeContent",de.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(zs((o,r)=>bEe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new Q2e),l=yield Oc.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);r.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(t$(cr(o=>o.range.endLineNumber-o.range.startLineNumber,ld))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};SN=AG([TG(0,nt)],SN);class l6 extends EG{constructor(e,t,i,s,o,r,a,l){const c=dn("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this.hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=dn("div.diff-hidden-lines",[dn("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),dn("div.center@content",{style:{display:"flex"}},[dn("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[we("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Fh("$(unfold)"))]),dn("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),dn("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=As(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?ds(this._nodes.first):this._register(vd(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(G(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=G(window,"mousemove",b=>{const y=b.clientY-f;g=g||Math.abs(y)>2;const S=Math.round(y/u.getOption(66)),L=Math.max(0,Math.min(p+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=G(window,"mouseup",b=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),v.dispose()})})),this._register(G(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=G(window,"mousemove",b=>{const y=b.clientY-f;g=g||Math.abs(y)>2;const S=Math.round(y/u.getOption(66)),L=Math.max(0,Math.min(p-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const D=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(D-x))}),v=G(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(y-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(ri(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=we("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){f.push(we("span",void 0,"  |  "));for(let w=0;w{this._revealModifiedHiddenLine(y.startLineNumber)}}}}ds(this._nodes.others,...f)}))}}class rv{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new rv(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new rv(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var vEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},c6=function(n,e){return function(t,i){e(t,i,n)}},wEe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Wu;let ox=Wu=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,s){var o,r;return wEe(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new jo(new Ze(1,2),new Ze(1,t.getLineCount()+1),[new $d(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=Wu.diffCache.get(a);if(c&&c.context===l)return c.result;const d=ou.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return Wu.diffCache.size>10&&Wu.diffCache.delete(Wu.diffCache.keys().next().value),Wu.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};ox.diffCache=new Map;ox=Wu=vEe([c6(1,k1),c6(2,cc)],ox);var yEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},CEe=function(n,e){return function(t,i){e(t,i,n)}};const NG=at("diffProviderFactoryService");let xN=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(ox,t)}};xN=yEe([CEe(0,bt)],xN);ht(NG,xN,1);var SEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xEe=function(n,e){return function(t,i){e(t,i,n)}},d6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let LN=class extends K{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,s){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=s,this._isDiffUpToDate=si(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=si(this,void 0),this.diff=this._diff,this._unchangedRegions=si(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=mt(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Pn(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=si(this,void 0),this._activeMovedText=si(this,void 0),this._hoveredMovedText=si(this,void 0),this.activeMovedText=mt(this,l=>{var c,d;return(d=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&d!==void 0?d:this._activeMovedText.read(l)}),this._cancellationTokenSource=new yr,this._diffProvider=mt(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Po("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(Ke(()=>this._cancellationTokenSource.cancel()));const o=U2e("contentChangedSignal"),r=this._register(new Ci(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=rx.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).filter(v=>!!v).map(v=>Ze.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Ze.fromRange(v)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const v of u)for(let b=0;b{if(this._diff.get()){const d=jl.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=jl.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(zs((l,c)=>d6(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),r.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),Pc(NU,l),Pc(NA,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=jl.fromModelContentChanges(_.changes);f=SS(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=jl.fromModelContentChanges(_.changes);g=SS(g,v)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=LEe(p,e.original,e.modified),p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,Pn(_=>{a(p,_),this._lastDiff=p;const v=GP.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(w=>w.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return d6(this,void 0,void 0,function*(){yield z2e(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(s=>Ze.deserialize(s.range)),i=this._unchangedRegions.get();Pn(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};LN=SEe([xEe(3,NG)],LN);function LEe(n,e,t){return{changes:n.changes.map(i=>new jo(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>DEe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function DEe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew MG(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class MG{constructor(e){this.lineRangeMapping=e}}class rx{static fromDiffs(e,t,i,s,o){const r=jo.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const h=c===1&&d===1,f=c+u===t+1&&d+u===i+1;(h||f)&&u>=o+s?(h&&!f&&(u-=o),f&&!h&&(c+=o,d+=o,u-=o),a.push(new rx(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new rx(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Ze.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ze.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=si(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=si(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=mt(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=si(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ze.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ze.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],b=s.modified.isEmpty;return v.push(new xo("diff.clipboard.copyDeletedContent",b?s.original.length>1?m("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):m("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?m("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):m("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>q2(this,void 0,void 0,function*(){const y=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(y)}))),s.original.length>1&&v.push(new xo("diff.clipboard.copyDeletedLineContent",b?m("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+u):m("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,()=>q2(this,void 0,void 0,function*(){let y=this._originalTextModel.getLineContent(s.original.startLineNumber+u);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===0?` +`}};CN=wu([gn(0,ei)],CN);class X2e{publicLog2(){}}class rv{constructor(){const e=je.from({scheme:rv.SCHEME,authority:"model",path:"/"});this.workspace={id:Cxe,folders:[new wxe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===rv.SCHEME?this.workspace.folders[0]:null}}rv.SCHEME="inmemory";function sx(n,e,t){if(!e||!(n instanceof BG))return;const i=[];Object.keys(e).forEach(s=>{QSe(s)&&i.push([`editor.${s}`,e[s]]),t&&JSe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let SN=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return vp(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:bP.convert(e),s=new Map;for(const a of i){if(!(a instanceof Oh))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=s.get(l);c||(c=[],s.set(l,c)),c.push(txe.replaceMove(N.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:fb(ET.bulkEditServiceSummary,o,r),isApplied:o>0}})}};SN=wu([gn(0,hs)],SN);class Q2e{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ta(e)}}let xN=class extends IT{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};xN=wu([gn(0,Bm),gn(1,$t)],xN);class J2e{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class eEe extends Yb{constructor(){super()}}class tEe extends $2e{constructor(){super(new mge)}}let LN=class extends qT{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};LN=wu([gn(0,hc),gn(1,Ln),gn(2,bu),gn(3,pi),gn(4,fu),gn(5,tt)],LN);class iEe{playAudioCue(e,t){return vp(this,void 0,void 0,function*(){})}}ht(ei,BG,0);ht(XU,yN,0);ht(QU,CN,0);ht(vxe,rv,0);ht(dD,Q2e,0);ht(hc,X2e,0);ht(_q,Y2e,0);ht(Cq,K2e,0);ht(Ln,ov,0);ht(ol,Oc,0);ht(Ii,eEe,0);ht(Lr,S2e,0);ht(fc,tEe,0);ht(hs,YS,0);ht(B4,XT,0);ht(tt,bN,0);ht(gxe,G2e,0);ht(T1,ED,0);ht(Of,lDe,0);ht(R1,$A,0);ht(Iq,SN,0);ht(Sxe,J2e,0);ht(hu,vN,0);ht(mu,fN,0);ht(Yo,xke,0);ht(fs,wN,0);ht(pi,bm,0);ht(YP,uN,0);ht(bu,xN,0);ht(mc,ZT,0);ht(V1,_N,0);ht(vu,LN,0);ht(fu,gN,0);ht(kD,iEe,0);var Ee;(function(n){const e=new aD;for(const[l,c]of KF())e.set(l,c);const t=new nx(e,!0);e.set(bt,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof wa?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new B;function r(l){if(s)return t;s=!0;for(const[d,u]of KF())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=at(d);e.get(u)instanceof wa&&e.set(u,l[d])}const c=j2e();for(const d of c)try{t.createInstance(d)}catch(u){pt(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new fe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(Ee||(Ee={}));let nEe;function ec(){return nEe}let WG;function sEe(n){WG=n}class VG{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return WG({owner:i,debugName:()=>{const o=Vf(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>s(this.read(o),o))}}class H1 extends VG{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Pn(n,e){const t=new HG(n,e);try{n(t)}finally{t.finish()}}function oEe(n,e,t){n?e(n):Pn(e,t)}class HG{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=ec())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Vf(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:s}of t)i.endUpdate(s);(e=ec())===null||e===void 0||e.handleEndTransaction()}}function e3(n,e,t,i){let s;if(n!==void 0)if(typeof n=="function"){if(s=n(),s!==void 0)return s}else return n;if(e!==void 0&&(s=Vf(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function Vf(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),s=i?i[1]:void 0;return s==null?void 0:s.trim()}function oi(n,e){return typeof n=="string"?new DN(void 0,n,e):new DN(n,void 0,e)}class DN extends H1{get debugName(){var e;return(e=e3(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var s;if(this._value===e)return;let o;t||(t=o=new HG(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(s=ec())===null||s===void 0||s.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function rEe(n,e){return typeof n=="string"?new d6(void 0,n,e):new d6(n,void 0,e)}class d6 extends DN{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const kN=(n,e)=>n===e;function mt(n,e){return e!==void 0?new EN(n,void 0,e,void 0,void 0,void 0,kN):new EN(void 0,void 0,n,void 0,void 0,void 0,kN)}function av(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new fe;return new EN(i,()=>{var o;return(o=Vf(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),kN)}sEe(mt);class EN extends H1{get debugName(){var e;return(e=e3(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,s,o,r=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=s,this._handleChange=o,this._handleLastObserverRemoved=r,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=ec())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const s=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=s&&!this._equalityComparator(o,this.value);if((t=ec())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:s}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new $i}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===3;if(i&&(this.state===1||s)&&(this.state=2,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function zG(n,e){return new AD(n.debugName,e,void 0,void 0)}function ai(n){return new AD(void 0,n,void 0,void 0)}function ID(n,e){return new AD(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function Hs(n){const e=new fe,t=zG({debugName:()=>Vf(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return Ze(()=>{t.dispose(),e.dispose()})}class AD{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=Vf(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,s){var o,r;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=ec())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const s=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=s,this.state=3;try{if(!this.disposed){(e=ec())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=ec())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,_b(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=AD})(ai||(ai={}));function u6(n){return new aEe(n)}class aEe extends VG{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function lEe(n,e){return new Promise(t=>{let i=!1,s=!1;const o=ai(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function Is(n,e){return new $G(n,e)}class $G extends H1{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var s;const o=this._getValue(i),r=!this.hasValue||this.value!==o;(s=ec())===null||s===void 0||s.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:r,hadValue:this.hasValue}),r&&(this.value=o,this.hasValue&&Pn(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Vf(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=$G})(Is||(Is={}));function Ro(n,e){return new cEe(n,e)}class cEe extends H1{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Pn(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function dEe(n){return typeof n=="string"?new h6(n):new h6(void 0,n)}class h6 extends H1{get debugName(){var e;return(e=e3(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Pn(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function ox(n){const e=new uEe(!0);return n.addObserver(e),n.reportChanges(),Ze(()=>{n.removeObserver(e)})}class uEe{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function UG(){return!!O$.VSCODE_DEV}function hEe(n){if(UG()){const e=fEe();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function fEe(){sy||(sy=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of sy){const i=t(e);if(i)return i}}),sy}let sy;function gEe(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function oy(n,e){return n.appendChild(e),Ze(()=>{n.removeChild(e)})}class pEe extends Y{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new aj(e,t)),this._width=oi(this,this.elementSizeObserver.getWidth()),this._height=oi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Pn(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function f6(n,e){let t=n.get(),i=t,s=t;const o=oi("animatedValue",t);let r=-1;const a=300;let l;e.add(ID({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(n)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=s,t=n.read(d),r=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-r;s=Math.floor(mEe(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class TD{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${TD._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}TD._counter=0;function Cd(n,e){return ai(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Fc(n,e){return _Ee([n],e),n}function _Ee(n,e){UG()&&Ro("reload",i=>hEe(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function lx(n,e,t){const i=new fe,s=[];return i.add(ai(o=>{const r=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const d of s)c.removeZone(d);s.length=0;for(const d of r){const u=c.addZone(d);s.push(u),a.set(d,u)}}),t&&t(!1),i.add(ID({createEmptyChangeSummary(){return[]},handleChange(c,d){const u=l.get(c.changedObservable);return u!==void 0&&d.push(u),!0}},(c,d)=>{for(const u of r)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),n.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const r of s)o.removeZone(r)}),t&&t(!1)}}),i}class bEe extends Cr{dispose(){super.dispose(!0)}}var t3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},i3=function(n,e){return function(t,i){e(t,i,n)}},vEe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const wEe=Yi("diff-review-insert",ie.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),yEe=Yi("diff-review-remove",ie.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),CEe=Yi("diff-review-close",ie.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let ad=class extends Y{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=av(this,(d,u)=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=u.add(this._instantiationService.createInstance(IN,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(AN,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(ox(this.model))}next(){Pn(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Pn(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Pn(e=>{this._setVisible(!1,e)})}};ad._ttPolicy=If("diffReview",{createHTML:n=>n});ad=t3([i3(8,bt)],ad);let IN=class extends Y{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=oi(this,[]),this._currentGroupIdx=oi(this,0),this._currentElementIdx=oi(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(ai(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=SEe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Pn(c=>{const d=this._editors.modified.getPosition();if(d){const u=l.findIndex(h=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===ss.Deleted?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ss.Added&&this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ai(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==ss.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(N.fromPositions(new H(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||oEe(t,s=>{this._currentGroupIdx.set(Ye.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Pn(i=>{this._currentElementIdx.set(Ye.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Pn(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ss.Deleted?(this._editors.original.setSelection(N.fromPositions(new H(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ss.Header&&(this._editors.modified.setSelection(N.fromPositions(new H(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};IN=t3([i3(4,kD)],IN);const m0=3;function SEe(n,e,t){const i=[];for(const s of f$(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*m0)){const o=[];o.push(new LEe);const r=new Qe(Math.max(1,s[0].original.startLineNumber-m0),Math.min(s[s.length-1].original.endLineNumberExclusive+m0,e+1)),a=new Qe(Math.max(1,s[0].modified.startLineNumber-m0),Math.min(s[s.length-1].modified.endLineNumberExclusive+m0,t+1));g$(s,(d,u)=>{const h=new Qe(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Qe(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new EEe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new DEe(u,g))}),u.modified.forEach(g=>{o.push(new kEe(u,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new xEe(new Ga(l,c),o))}return i}var ss;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ss||(ss={}));class xEe{constructor(e,t){this.range=e,this.lines=t}}class LEe{constructor(){this.type=ss.Header}}class DEe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ss.Deleted,this.modifiedLineNumber=void 0}}class kEe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ss.Added,this.originalLineNumber=void 0}}class EEe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ss.Unchanged}}let AN=class extends Y{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._editors=o,this._languageService=r,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Xa(a)),this._register(ai(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new So("diffreview.close",m("label.close","Close"),"close-diff-review "+Ae.asClassName(CEe),!0,()=>vEe(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new Y4(this._content,{})),cs(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ze(()=>{cs(this.domNode)})),this._register(Cd(this.domNode,{width:this._width,height:this._height})),this._register(Cd(this._content,{width:this._width,height:this._height})),this._register(Hs((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Hi(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",m("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Mn(s,i.get(50)),cs(this._content,s);const o=this._editors.original.getModel(),r=this._editors.modified.getModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(66),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let h;if(u.type===ss.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=L=>L===0?m("no_lines_changed","no lines changed"):L===1?m("one_line_changed","1 line changed"):m("more_lines_changed","{0} lines changed",L),w=b(p.original.length),y=b(p.modified.length);g.setAttribute("aria-label",m({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,p.original.startLineNumber,w,p.modified.startLineNumber,y));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=mt(g=>this._model.currentElement.read(g)===u);e.add(ai(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(K(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const _="diff-review-spacer";let v=null;switch(e.type){case ss.Added:g="diff-review-row line-insert",p=" char-insert",v=wEe;break;case ss.Deleted:g="diff-review-row line-delete",p=" char-delete",v=yEe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,b.appendChild(w);const y=document.createElement("span");y.style.width=u+"px",y.style.minWidth=u+"px",y.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText=" ",w.appendChild(y);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const L=document.createElement("span");if(L.className=_,v){const k=document.createElement("span");k.className=Ae.asClassName(v),k.innerText="  ",L.appendChild(k)}else L.innerText="  ";w.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);ad._ttPolicy&&(k=ad._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),x=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);ad._ttPolicy&&(k=ad._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=m("blankLine","blank"));let D="";switch(e.type){case ss.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",x,e.originalLineNumber):D=m("equalLine","{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case ss.Added:D=m("insertLine","+ {0} modified line {1}",x,e.modifiedLineNumber);break;case ss.Deleted:D=m("deleteLine","- {0} original line {1}",x,e.originalLineNumber);break}return b.setAttribute("aria-label",D),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=on.createEmpty(r,o),c=Do.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Do.containsRTL(r,c,e.mightContainRTL());return YL(new Om(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==No.OFF,null)).html}};AN=t3([i3(5,Ii)],AN);const IEe=Yi("diff-insert",ie.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),qG=Yi("diff-remove",ie.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),g6=et.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ae.asClassName(IEe),marginClassName:"gutter-insert"}),p6=et.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ae.asClassName(qG),marginClassName:"gutter-delete"}),m6=et.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),_6=et.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),b6=et.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),AEe=et.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),TEe=et.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),TN=et.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),NEe=et.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),MEe=et.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),REe=et.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new gm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Ae.asClassName(ie.arrowRight),zIndex:10001});class Sd extends Y{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Is(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Ro("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=oi(this,0),this._modifiedViewZonesChangedSignal=Ro("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Ro("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=av((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),_=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const v=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!v||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const w=_.map(P=>{function O(Se,Ie){const pe=Ie.getTopForLineNumber(Se.startLineNumber,!0),ee=Ie.getTopForLineNumber(Se.endLineNumberExclusive,!0);return(pe+ee)/2}const R=O(P.lineRangeMapping.original,this._editors.original),M=this._originalScrollTop.read(h),W=O(P.lineRangeMapping.modified,this._editors.modified),G=this._modifiedScrollTop.read(h),ne=R-M,ce=W-G,ge=Math.min(R,W),se=Math.max(R,W);return{range:new Ye(ge,se),from:ne,to:ce,fromWithoutScroll:R,toWithoutScroll:W,move:P}});w.sort(Eue(cr(P=>P.fromWithoutScroll>P.toWithoutScroll,Iue),cr(P=>P.fromWithoutScroll>P.toWithoutScroll?P.fromWithoutScroll:-P.toWithoutScroll,ud)));const y=n3.compute(w.map(P=>P.range)),S=10,L=v.verticalScrollbarWidth,x=(y.getTrackCount()-1)*10+S*2,D=L+x+(b.contentLeft-Sd.movedCodeBlockPadding);let k=0;for(const P of w){const O=y.getTrack(k),R=L+S+O*10,M=15,W=15,G=D,ne=b.glyphMarginWidth+b.lineNumbersWidth,ce=18,ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("arrow-rectangle"),ge.setAttribute("x",`${G-ne}`),ge.setAttribute("y",`${P.to-ce/2}`),ge.setAttribute("width",`${ne}`),ge.setAttribute("height",`${ce}`),this._element.appendChild(ge);const se=document.createElementNS("http://www.w3.org/2000/svg","g"),Se=document.createElementNS("http://www.w3.org/2000/svg","path");Se.setAttribute("d",`M 0 ${P.from} L ${R} ${P.from} L ${R} ${P.to} L ${G-W} ${P.to}`),Se.setAttribute("fill","none"),se.appendChild(Se);const Ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ie.classList.add("arrow"),f.add(ai(pe=>{Se.classList.toggle("currentMove",P.move===p.activeMovedText.read(pe)),Ie.classList.toggle("currentMove",P.move===p.activeMovedText.read(pe))})),Ie.setAttribute("points",`${G-W},${P.to-M/2} ${G},${P.to} ${G-W},${P.to+M/2}`),se.appendChild(Ie),this._element.appendChild(se),k++}this.width.set(x,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ze(()=>this._element.remove())),this._register(ai(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-Sd.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(ox(this._state));const r=mt(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new ax(u6(p.lineRangeMapping.original.startLineNumber-1),18),modified:new ax(u6(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(lx(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(lx(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register(Hs((h,f)=>{const g=r.read(h);for(const p of g)f.add(new v6(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new v6(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=Is(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=Is(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Ro("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Ro("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(ID({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(u="original"),h.didChange(d)&&(u="modified"),!0)},h=>{c.read(h),d.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&u==="original"){const _=a.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.original.contains(_.lineNumber)))}if(g&&u==="modified"){const _=l.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.modified.contains(_.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}Sd.movedCodeBlockPadding=4;class n3{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=Yme(t,cr(a=>a.intersectWithRangeLength(s),ud)):(o=t.length,t.push(new A4))),t[o].addRange(s),i.push(o)}return new n3(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class v6 extends jG{constructor(e,t,i,s,o){const r=dn("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=dn("div.diff-moved-code-block",{style:{marginRight:"4px"}},[dn("div.text-content@textContent"),dn("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Is(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Cd(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Xa(this._nodes.actionBar,{highlightToggledItems:!0})),d=new So("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new So("","Compare",Ae.asClassName(ie.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ai(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class PEe extends Y{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=mt(this,s=>{var o;const r=(o=this._diffModel.read(s))===null||o===void 0?void 0:o.diff.read(s);if(!r)return null;const a=this._diffModel.read(s).movedTextToCompare.read(s),l=this._options.renderIndicators.read(s),c=this._options.showEmptyDecorations.read(s),d=[],u=[];if(!a)for(const f of r.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?p6:_6}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?g6:m6}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:NEe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:AEe});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&d.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?MEe:TN}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?TEe:b6});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:N.fromPositions(new H(f.lineRangeMapping.modified.startLineNumber,1)),options:REe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?p6:_6});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?g6:m6});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:TN}),u.push({range:_.modifiedRange,options:b6})}const h=this._diffModel.read(s).activeMovedText.read(s);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[Sd.movedCodeBlockPadding,0,Sd.movedCodeBlockPadding,Sd.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:u}}),this._register(rx(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(rx(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class OEe extends Y{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=oi(this,void 0),this.sashLeft=mt(this,s=>{var o;const r=(o=this._sashRatio.read(s))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(r,s)}),this._sash=this._register(new En(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{const o=this._dimensions.width.get(),r=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/o,void 0);this._sashRatio.set(r/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(ai(s=>{const o=this._options.enableSplitViewResizing.read(s);this._sash.state=o?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class $g{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class w6 extends $g{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class FEe extends $g{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class Bc extends $g{static create(e,t,i){const s=new Cr(i),o=new Bc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=$g.findId(`provider_${d}`,o),f=new FEe(h,o,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(g=>{for(const p of g||[])Bc._makeOutlineElement(p,f);return f},g=>(uc(g),f)).then(g=>{$g.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Ki(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?Bc.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=$g.findId(e,t),s=new w6(i,t,e);if(e.children)for(const o of e.children)Bc._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=dt.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof w6?e.push(t.symbol):e.push(...dt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>N.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Bc._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>H.compare(N.getStartPosition(i.range),N.getStartPosition(s.range))||H.compare(N.getEndPosition(s.range),N.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&Bc._flattenDocumentSymbols(e,s.children,s.name)}}var GG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},KG=function(n,e){return function(t,i){e(t,i,n)}},BEe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let NN=class extends Y{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=s,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=av(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new MN(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Pn(u=>{for(const h of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Pn(u=>{for(const h of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,u)})}}));const o=this._diffModel.map((c,d)=>{var u,h;return((u=c==null?void 0:c.diff.read(d))===null||u===void 0?void 0:u.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(d))!==null&&h!==void 0?h:[]}),r=av(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=o.read(c);for(const _ of p)if(!_.shouldHideControls(c)){{const v=mt(w=>_.getHiddenOriginalRange(w).startLineNumber-1),b=new ax(v,24);h.push(b),d.add(new y6(this._editors.original,b,_,_.originalUnchangedRange,!g,u,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}{const v=mt(w=>_.getHiddenModifiedRange(w).startLineNumber-1),b=new ax(v,24);f.push(b),d.add(new y6(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new gm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ae.asClassName(ie.fold),zIndex:10001};this._register(rx(this._editors.original,mt(c=>{const d=o.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:N.fromPositions(new H(h.originalLineNumber,1)),options:l});return u}))),this._register(rx(this._editors.modified,mt(c=>{const d=o.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:Qe.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(lx(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(lx(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(ai(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(UC)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(UC))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};NN=GG([KG(3,nt)],NN);let MN=class extends Y{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=oi(this,void 0);const i=Ro("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Ro("_textModel.onDidChangeContent",de.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(Hs((o,r)=>BEe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new bEe),l=yield Bc.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);r.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(b$(cr(o=>o.range.endLineNumber-o.range.startLineNumber,ud))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};MN=GG([KG(0,nt)],MN);class y6 extends jG{constructor(e,t,i,s,o,r,a,l){const c=dn("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this.hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=dn("div.diff-hidden-lines",[dn("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),dn("div.center@content",{style:{display:"flex"}},[dn("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[we("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Bh("$(unfold)"))]),dn("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),dn("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=Is(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?cs(this._nodes.first):this._register(Cd(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(K(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const y=b.clientY-f;g=g||Math.abs(y)>2;const S=Math.round(y/u.getOption(66)),L=Math.max(0,Math.min(p+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=K(window,"mouseup",b=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),v.dispose()})})),this._register(K(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const y=b.clientY-f;g=g||Math.abs(y)>2;const S=Math.round(y/u.getOption(66)),L=Math.max(0,Math.min(p-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const D=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(D-x))}),v=K(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(y-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(ai(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=we("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){f.push(we("span",void 0,"  |  "));for(let w=0;w{this._revealModifiedHiddenLine(y.startLineNumber)}}}}cs(this._nodes.others,...f)}))}}class lv{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new lv(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new lv(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var WEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},C6=function(n,e){return function(t,i){e(t,i,n)}},VEe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Uu;let cx=Uu=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,s){var o,r;return VEe(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new jo(new Qe(1,2),new Qe(1,t.getLineCount()+1),[new Kd(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=Uu.diffCache.get(a);if(c&&c.context===l)return c.result;const d=du.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return Uu.diffCache.size>10&&Uu.diffCache.delete(Uu.diffCache.keys().next().value),Uu.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};cx.diffCache=new Map;cx=Uu=WEe([C6(1,R1),C6(2,hc)],cx);var HEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zEe=function(n,e){return function(t,i){e(t,i,n)}};const YG=at("diffProviderFactoryService");let RN=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(cx,t)}};RN=HEe([zEe(0,bt)],RN);ht(YG,RN,1);var $Ee=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},UEe=function(n,e){return function(t,i){e(t,i,n)}},S6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let PN=class extends Y{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,s){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=s,this._isDiffUpToDate=oi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=oi(this,void 0),this.diff=this._diff,this._unchangedRegions=oi(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=mt(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Pn(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=oi(this,void 0),this._activeMovedText=oi(this,void 0),this._hoveredMovedText=oi(this,void 0),this.activeMovedText=mt(this,l=>{var c,d;return(d=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&d!==void 0?d:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Cr,this._diffProvider=mt(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Ro("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(Ze(()=>this._cancellationTokenSource.cancel()));const o=dEe("contentChangedSignal"),r=this._register(new xi(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=dx.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).filter(v=>!!v).map(v=>Qe.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Qe.fromRange(v)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const v of u)for(let b=0;b{if(this._diff.get()){const d=Gl.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=Gl.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(Hs((l,c)=>S6(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),r.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),Fc(YU,l),Fc(zA,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=Gl.fromModelContentChanges(_.changes);f=kS(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=Gl.fromModelContentChanges(_.changes);g=kS(g,v)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=jEe(p,e.original,e.modified),p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,Pn(_=>{a(p,_),this._lastDiff=p;const v=s3.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(w=>w.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return S6(this,void 0,void 0,function*(){yield lEe(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(s=>Qe.deserialize(s.range)),i=this._unchangedRegions.get();Pn(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};PN=$Ee([UEe(3,YG)],PN);function jEe(n,e,t){return{changes:n.changes.map(i=>new jo(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>qEe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function qEe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew ZG(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class ZG{constructor(e){this.lineRangeMapping=e}}class dx{static fromDiffs(e,t,i,s,o){const r=jo.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const h=c===1&&d===1,f=c+u===t+1&&d+u===i+1;(h||f)&&u>=o+s?(h&&!f&&(u-=o),f&&!h&&(c+=o,d+=o,u-=o),a.push(new dx(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new dx(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Qe.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Qe.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=oi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=oi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=mt(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=oi(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Qe.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Qe.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],b=s.modified.isEmpty;return v.push(new So("diff.clipboard.copyDeletedContent",b?s.original.length>1?m("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):m("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?m("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):m("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>Q2(this,void 0,void 0,function*(){const y=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(y)}))),s.original.length>1&&v.push(new So("diff.clipboard.copyDeletedLineContent",b?m("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+u):m("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,()=>Q2(this,void 0,void 0,function*(){let y=this._originalTextModel.getLineContent(s.original.startLineNumber+u);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),yield this._clipboardService.writeText(y)}))),i.getOption(90)||v.push(new xo("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>q2(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(Hi(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Nn(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,p+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=Nn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function EEe(n,e,t,i){Mn(i,e.fontInfo);const s=t.length>0,o=new RL(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=ko.isBasicASCII(l,s),d=ko.containsRTL(l,c,o),u=x4(new Rm(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!==Mo.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var AEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},f6=function(n,e){return function(t,i){e(t,i,n)}};let DN=class extends K{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=r,this._contextMenuService=a,this._originalTopPadding=si(this,0),this._originalScrollOffset=si(this,0),this._originalScrollOffsetAnimated=e6(this._originalScrollOffset,this._store),this._modifiedTopPadding=si(this,0),this._modifiedScrollOffset=si(this,0),this._modifiedScrollOffsetAnimated=e6(this._modifiedScrollOffset,this._store);let l=!1;const c=si("state",0),d=this._register(new Ci(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(y=>y?As(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),h=new Set,f=new Set,g=mt(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;c.read(y);const D=this._options.renderSideBySide.read(y);return g6(this._editors.original,this._editors.modified,L.mappings,h,f,D)}),p=mt(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;c.read(y);const x=L.changes.map(D=>new MG(D));return g6(this._editors.original,this._editors.modified,x,h,f,!0)});function _(){const y=document.createElement("div");return y.className="diagonal-fill",y}const v=this._register(new fe),b=mt(y=>{var S,L,x,D,k,O,R,P;v.clear();const M=g.read(y)||[],$=[],Y=[],ne=this._modifiedTopPadding.read(y);ne>0&&Y.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ne,showInHiddenAreas:!0,suppressMouseDown:!0});const ce=this._originalTopPadding.read(y);ce>0&&$.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0});const ge=this._options.renderSideBySide.read(y),se=ge||(S=this._editors.modified._getViewModel())===null||S===void 0?void 0:S.createLineBreaksComputer();if(se){for(const je of M)if(je.diff)for(let ei=je.originalRange.startLineNumber;eithis._editors.original.getModel().tokenization.getLineTokens(Et)),je.originalRange.mapToLineArray(Et=>Se[Ie++]),Gt,xt),he=[];for(const Et of je.diff.innerChanges||[])he.push(new c_(Et.originalRange.delta(-(je.diff.original.startLineNumber-1)),yN.className,0));const ue=EEe(Be,It,he,De),xi=document.createElement("div");if(xi.className="inline-deleted-margin-view-zone",Mn(xi,It.fontInfo),this._options.renderIndicators.read(y))for(let Et=0;EtgI(Lt),xi,this._editors.modified,je.diff,this._diffEditorWidget,ue.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Et=0;Et1&&$.push({afterLineNumber:je.originalRange.startLineNumber+Et,domNode:_(),heightInPx:(pi-1)*pe,showInHiddenAreas:!0,suppressMouseDown:!0})}Y.push({afterLineNumber:je.modifiedRange.startLineNumber-1,domNode:De,heightInPx:ue.heightInLines*pe,minWidthInPx:ue.minWidthInPx,marginDomNode:xi,setZoneId(Et){Lt=Et},showInHiddenAreas:!0,suppressMouseDown:!0})}const ei=document.createElement("div");ei.className="gutter-delete",$.push({afterLineNumber:je.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:je.modifiedHeightInPx,marginDomNode:ei,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ei=je.modifiedHeightInPx-je.originalHeightInPx;if(ei>0){if(ee!=null&&ee.lineRangeMapping.original.delta(-1).deltaLength(2).contains(je.originalRange.endLineNumberExclusive-1))continue;$.push({afterLineNumber:je.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ei,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let De=function(){const he=document.createElement("div");return he.className="arrow-revert-change "+Ae.asClassName(ie.arrowRight),we("div",{},he)};if(ee!=null&&ee.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(je.modifiedRange.endLineNumberExclusive-1))continue;let Be;je.diff&&je.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(Be=De()),Y.push({afterLineNumber:je.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ei,marginDomNode:Be,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const je of(P=p.read(y))!==null&&P!==void 0?P:[]){if(!(ee!=null&&ee.lineRangeMapping.original.intersect(je.originalRange))||!(ee!=null&&ee.lineRangeMapping.modified.intersect(je.modifiedRange)))continue;const ei=je.modifiedHeightInPx-je.originalHeightInPx;ei>0?$.push({afterLineNumber:je.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ei,showInHiddenAreas:!0,suppressMouseDown:!0}):Y.push({afterLineNumber:je.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ei,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:$,mod:Y}});this._register(zs(y=>{const S=rv.capture(this._editors.modified),L=b.read(y);l=!0,this._editors.original.changeViewZones(x=>{for(const D of h)x.removeZone(D);h.clear();for(const D of L.orig){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(x=>{for(const D of f)x.removeZone(D);f.clear();for(const D of L.mod){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),f.add(k)}}),l=!1,S.restore(this._editors.modified)})),this._register(Ke(()=>{this._editors.original.changeViewZones(y=>{for(const S of h)y.removeZone(S);h.clear()}),this._editors.modified.changeViewZones(y=>{for(const S of f)y.removeZone(S);f.clear()})}));let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=As(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ri(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(ri(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(ri(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let x=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();x=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}x>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(x,void 0)):x<0?(this._modifiedTopPadding.set(-x,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-x,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+x,void 0,!0)}))}};DN=AEe([f6(5,M1),f6(6,gu)],DN);function g6(n,e,t,i,s,o){const r=new sc(p6(n,i)),a=new sc(p6(e,s)),l=n.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=p&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,w=v?v.lineNumber-h:Number.MAX_VALUE;bw?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ze.ofLength(_.lineNumber,1),modifiedRange:Ze.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let w=function(y,S){var L,x,D,k;if(y$.lineNumber$+Y.heightInPx,0))!==null&&x!==void 0?x:0,M=(k=(D=a.takeWhile($=>$.lineNumber$+Y.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:O,modifiedRange:R,originalHeightInPx:O.length*l+P,modifiedHeightInPx:R.length*c+M,diff:g.lineRangeMapping}),b=y,v=S};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,v=p.modified.startLineNumber,b=p.original.startLineNumber;if(o)for(const y of p.innerChanges||[])y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&w(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber),y.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new V(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return K2e(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var TEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},NEe=function(n,e){return function(t,i){e(t,i,n)}},Mr;let Ql=Mr=class extends K{constructor(e,t,i,s,o,r,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._options=a,this._themeService=l;const c=As(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=mt(f=>{const g=c.read(f),p=g.getColor(H_e)||(g.getColor(W_e)||VA).transparent(2),_=g.getColor(z_e)||(g.getColor(V_e)||HA).transparent(2);return{insertColor:p,removeColor:_}}),u=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(zs((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=_t(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=dn("div.diffOverview",{style:{position:"absolute",top:"0px",width:Mr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(Qw(_,p.domNode)),g.add(Hi(_,le.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(G(_,le.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(Qw(this._rootElement,_)),g.add(zs((v,b)=>{const w=this._diffModel.read(v),y=this._editors.original.createOverviewRuler("original diffOverviewRuler");y&&(b.add(y),b.add(Qw(_,y.getDomNode())));const S=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(S&&(b.add(S),b.add(Qw(_,S.getDomNode()))),!y||!S)return;const L=Po("viewZoneChanged",this._editors.original.onDidChangeViewZones),x=Po("viewZoneChanged",this._editors.modified.onDidChangeViewZones),D=Po("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Po("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(ri(O=>{var R;L.read(O),x.read(O),D.read(O),k.read(O);const P=d.read(O),M=(R=w==null?void 0:w.diff.read(O))===null||R===void 0?void 0:R.mappings;function $(ce,ge,se){const Se=se._getViewModel();return Se?ce.filter(Ie=>Ie.length>0).map(Ie=>{const pe=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.startLineNumber,1)),ee=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.endLineNumberExclusive,1)),Gt=ee.lineNumber-pe.lineNumber;return new Ej(pe.lineNumber,ee.lineNumber,Gt,ge.toString())}):[]}const Y=$((M||[]).map(ce=>ce.lineRangeMapping.original),P.removeColor,this._editors.original),ne=$((M||[]).map(ce=>ce.lineRangeMapping.modified),P.insertColor,this._editors.modified);y==null||y.setZones(Y),S==null||S.setZones(ne)})),b.add(ri(O=>{const R=this._rootHeight.read(O),P=this._rootWidth.read(O),M=this._modifiedEditorLayoutInfo.read(O);if(M){const $=Mr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Mr.ONE_OVERVIEW_WIDTH;y.setLayout({top:0,height:R,right:$+Mr.ONE_OVERVIEW_WIDTH,width:Mr.ONE_OVERVIEW_WIDTH}),S.setLayout({top:0,height:R,right:0,width:Mr.ONE_OVERVIEW_WIDTH});const Y=u.read(O),ne=h.read(O),ce=this._editors.modified.getOption(102),ge=new rm(ce.verticalHasArrows?ce.arrowSize:0,ce.verticalScrollbarSize,0,M.height,ne,Y);p.setTop(ge.getSliderPosition()),p.setHeight(ge.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=R+"px",_.style.left=P-Mr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(Mr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Ql.ONE_OVERVIEW_WIDTH=15;Ql.ENTIRE_DIFF_OVERVIEW_WIDTH=Mr.ONE_OVERVIEW_WIDTH*2;Ql=Mr=TEe([NEe(7,oo)],Ql);E("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},m("diffEditor.move.border","The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},m("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class xD extends K{constructor(){super(...arguments),this._id=++xD.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}xD.idCounter=0;var MEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},m6=function(n,e){return function(t,i){e(t,i,n)}};let kN=class extends K{constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this._onDidContentSizeChange=this._register(new B),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=As(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(yD({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Ql.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=yf.revealHorizontalRightPadding.defaultValue+Ql.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=m("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};kN=MEe([m6(5,bt),m6(6,gi)],kN);class REe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=mt(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=mt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=mt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=mt(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=mt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=mt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=mt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=mt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=mt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=mt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=mt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=mt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=mt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=mt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=mt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=mt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=mt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=mt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=mt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=mt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),_6(e,$n));this._options=si(this,i)}updateOptions(e){const t=_6(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function _6(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:be(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Aue(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:be(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:be(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Ru(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Ru(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:be(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:be(n.renderIndicators,e.renderIndicators),originalEditable:be(n.originalEditable,e.originalEditable),diffCodeLens:be(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:be(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:wi(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:wi(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:be(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:be((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:be((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:be((o=(s=n.hideUnchangedRegions)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:(r=n.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Ru((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Ru((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Ru((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:be(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:be(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Ru(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:be(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var PEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},p0=function(n,e){return function(t,i){e(t,i,n)}};let EN=class extends xD{constructor(e,t,i,s,o,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=dn("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[dn("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[we("span",{},"No Changes")]),dn("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),dn("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),dn("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(V2e("diffModel",void 0)),this.onDidChangeModel=de.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new JL([Je,this._contextKeyService])),this._boundarySashes=si(this,void 0),this._accessibleDiffViewerShouldBeVisible=si(this,!1),this._accessibleDiffViewerVisible=mt(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=si(this,void 0),this._layoutInfo=mt(this,p=>{var _,v,b;const w=this._rootSizeObserver.width.read(p),y=this._rootSizeObserver.height.read(p),S=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=S??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),x=w-L-(this._options.renderOverviewRuler.read(p)?Ql.ENTIRE_DIFF_OVERVIEW_WIDTH:0),D=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,k=L-D;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=x+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:k,height:y}),this._editors.modified.layout({width:x,height:y}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,_)=>p==null?void 0:p.diff.read(_)),this.onDidUpdateDiff=de.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ke(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new Y2e(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new REe(t,this._rootSizeObserver.width),this._contextKeyService.createKey(z.isEmbeddedDiffEditor.key,!1);const d=z.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(ri(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=z.comparingMovedCode.bindTo(this._contextKeyService);this._register(ri(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=z.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(ri(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(kN,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=ov(this,(p,_)=>{const v=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",v),!v)return;const b=_.add(new mEe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((w,y)=>w-(this._options.renderOverviewRuler.read(y)?Ql.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(ri(w=>{const y=this._boundarySashes.read(w);y&&b.setBoundarySashes(y)})),b}),this._register(tx(this._sash)),this._register(zs((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Pc(CN,p),this._editors,this._diffModel,this._options))})),this._register(zs((p,_)=>{_.add(new(Pc(pEe,p))(this._editors,this._diffModel,this._options))})),this._register(zs((p,_)=>{_.add(this._instantiationService.createInstance(Pc(DN,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(zs((p,_)=>{_.add(this._instantiationService.createInstance(Pc(Ql,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(zs((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Pc(sd,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(v,b)=>this._accessibleDiffViewerShouldBeVisible.set(v,b),this._options.onlyShowAccessibleDiffViewer.map(v=>!v),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((v,b)=>{var w;return(w=v==null?void 0:v.diff.read(b))===null||w===void 0?void 0:w.mappings.map(y=>y.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(vd(this.elements.modified,{visibility:f})),this._register(vd(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(tx(this._layoutInfo)),this._register(zs((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Pc(wd,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(vd(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:mt(p=>{var _,v;return this._options.hideUnchangedRegions.read(p)&&((v=(_=this._diffModel.read(p))===null||_===void 0?void 0:_.diff.read(p))===null||v===void 0?void 0:v.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var _,v;if(!p.event.rightButton&&p.target.position&&(!((_=p.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const b=p.target.position.lineNumber,w=p.target,y=this._diffModel.get();if(!y)return;const S=(v=y.diff.get())===null||v===void 0?void 0:v.mappings;if(!S)return;const L=S.find(x=>(w==null?void 0:w.detail.afterLineNumber)===x.lineRangeMapping.modified.startLineNumber-1||x.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(de.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var _,v;if((p==null?void 0:p.reason)===3){const b=(v=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||v===void 0?void 0:v.mappings.find(w=>w.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(ct.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register(zs((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(Ke(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(cm,t,i,s)}_createDiffEditorContributions(){const e=Jg.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){pt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return VL.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(LN,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Pn(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?BEe(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const s=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",s)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),s=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=s.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=b6(a.getStartPosition(),l),d=b6(a.getEndPosition(),l);r=N.plusRange(c,d)}}return{destination:o,destinationSelection:r}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pn(i=>{for(const s of t)s.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pn(i=>{for(const s of t)s.showAll(i)})}};EN=PEe([p0(3,Je),p0(4,bt),p0(5,zt),p0(6,vD),p0(7,x1)],EN);function b6(n,e){const t=EA(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return N.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return N.fromPositions(new V(s,n.column))}if(!t.innerChanges)return N.fromPositions(new V(t.modified.startLineNumber,1));const i=EA(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return N.fromPositions(new V(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=OEe(i.originalRange.getEndPosition(),n);return N.fromPositions(FEe(i.modifiedRange.getEndPosition(),s))}}function OEe(n,e){return n.lineNumber===e.lineNumber?new Wb(0,e.column-n.column):new Wb(e.lineNumber-n.lineNumber,e.column-1)}function FEe(n,e){return e.lineCount===0?new V(n.lineNumber,n.column+e.columnCount):new V(n.lineNumber+e.lineCount,e.columnCount+1)}function BEe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var YP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ht=function(n,e){return function(t,i){e(t,i,n)}};let WEe=0,v6=!1;function VEe(n){if(!n){if(v6)return;v6=!0}B0e(n||document.body)}let ax=class extends cm{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||PS.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+PS.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof mm?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,VEe(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++WEe,o=xe.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),K.None;const t=e.id,i=e.label,s=xe.and(xe.equals("editorId",this.getId()),xe.deserialize(e.precondition)),o=e.keybindings,r=xe.and(s,xe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new fe,u=this.getId()+":"+t;if(d.add(qt.registerCommand(u,c)),a){const f={command:{id:u,title:i},when:s,group:a,order:l};d.add(or.appendMenuItem(A.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new Ij(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(Ke(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof AS)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};ax=YP([Ht(2,bt),Ht(3,zt),Ht(4,gs),Ht(5,Je),Ht(6,gi),Ht(7,oo),Ht(8,Ln),Ht(9,uu),Ht(10,no),Ht(11,nt)],ax);let IN=class extends ax{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);ex(d,_,!1);const v=l.registerEditorContainer(e);typeof _.theme=="string"&&l.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const b=_.model;delete _.model,super(e,_,i,s,o,r,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(v);let w;if(typeof b>"u"){const y=f.getLanguageIdByMimeType(_.language)||_.language||Vo;w=RG(h,f,_.value||"",y,void 0),this._ownsModel=!0}else w=b,this._ownsModel=!1;if(this._attachModel(w),w){const y={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(y)}}dispose(){super.dispose()}updateOptions(e){ex(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};IN=YP([Ht(2,bt),Ht(3,zt),Ht(4,gs),Ht(5,Je),Ht(6,gi),Ht(7,xr),Ht(8,Ln),Ht(9,Jt),Ht(10,uu),Ht(11,fs),Ht(12,ki),Ht(13,no),Ht(14,nt)],IN);let AN=class extends EN{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);ex(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){ex(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(ax,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};AN=YP([Ht(2,bt),Ht(3,Je),Ht(4,zt),Ht(5,xr),Ht(6,Ln),Ht(7,Jt),Ht(8,gu),Ht(9,x1),Ht(10,M1),Ht(11,vD)],AN);function RG(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),w6(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return w6(n,t,e.createById(i),s)}function w6(n,e,t,i){return n.createModel(e,t,i)}var PG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function HEe(n,e,t){return Ee.initialize(t||{}).createInstance(IN,n,e)}function zEe(n){return Ee.get(zt).onCodeEditorAdd(t=>{n(t)})}function $Ee(n){return Ee.get(zt).onDiffEditorAdd(t=>{n(t)})}function UEe(){return Ee.get(zt).listCodeEditors()}function jEe(){return Ee.get(zt).listDiffEditors()}function qEe(n,e,t){return Ee.initialize(t||{}).createInstance(AN,n,e)}function GEe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return qt.registerCommand(n.id,n.run)}function KEe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=xe.deserialize(n.precondition),t=(s,...o)=>vr.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new fe;if(i.add(qt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(or.appendMenuItem(A.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Ee.get(gi);if(!(s instanceof mm))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=xe.and(e,xe.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function YEe(n){return OG([n])}function OG(n){const e=Ee.get(gi);return e instanceof mm?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:xe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),K.None)}function ZEe(n,e,t){const i=Ee.get(ki),s=i.getLanguageIdByMimeType(e)||e;return RG(Ee.get(fs),i,n,s,t)}function XEe(n,e){const t=Ee.get(ki),i=t.getLanguageIdByMimeType(e)||e||Vo;n.setLanguage(t.createById(i))}function QEe(n,e,t){n&&Ee.get(ol).changeOne(e,n.uri,t)}function JEe(n){Ee.get(ol).changeAll(n,[])}function eIe(n){return Ee.get(ol).read(n)}function tIe(n){return Ee.get(ol).onMarkerChanged(n)}function iIe(n){return Ee.get(fs).getModel(n)}function nIe(){return Ee.get(fs).getModels()}function sIe(n){return Ee.get(fs).onModelAdded(n)}function oIe(n){return Ee.get(fs).onModelRemoved(n)}function rIe(n){return Ee.get(fs).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function aIe(n){return u0e(Ee.get(fs),Ee.get(no),n)}function lIe(n,e){const t=Ee.get(ki),i=Ee.get(xr);return D4.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function cIe(n,e,t){const i=Ee.get(ki);return Ee.get(xr).registerEditorContainer(document.body),D4.colorize(i,n,e,t)}function dIe(n,e,t=4){return Ee.get(xr).registerEditorContainer(document.body),D4.colorizeModelLine(n,e,t)}function uIe(n){const e=vi.get(n);return e||{getInitialState:()=>xb,tokenize:(t,i,s)=>FU(n,s)}}function hIe(n,e){vi.getOrCreate(e);const t=uIe(e),i=xf(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rPG(this,void 0,void 0,function*(){var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function vIe(){return{create:HEe,getEditors:UEe,getDiffEditors:jEe,onDidCreateEditor:zEe,onDidCreateDiffEditor:$Ee,createDiffEditor:qEe,addCommand:GEe,addEditorAction:KEe,addKeybindingRule:YEe,addKeybindingRules:OG,createModel:ZEe,setModelLanguage:XEe,setModelMarkers:QEe,getModelMarkers:eIe,removeAllMarkers:JEe,onDidChangeMarkers:tIe,getModels:nIe,getModel:iIe,onDidCreateModel:sIe,onWillDisposeModel:oIe,onDidChangeModelLanguage:rIe,createWebWorker:aIe,colorizeElement:lIe,colorize:cIe,colorizeModelLine:dIe,tokenize:hIe,defineTheme:fIe,setTheme:gIe,remeasureFonts:pIe,registerCommand:mIe,registerLinkOpener:_Ie,registerEditorOpener:bIe,AccessibilitySupport:LI,ContentWidgetPositionPreference:TI,CursorChangeReason:NI,DefaultEndOfLine:MI,EditorAutoIndentStrategy:PI,EditorOption:OI,EndOfLinePreference:FI,EndOfLineSequence:BI,MinimapPosition:GI,MouseTargetType:KI,OverlayWidgetPositionPreference:YI,OverviewRulerLane:ZI,GlyphMarginLane:WI,RenderLineNumbersType:QI,RenderMinimap:JI,ScrollbarVisibility:tA,ScrollType:eA,TextEditorCursorBlinkingStyle:rA,TextEditorCursorStyle:aA,TrackedRangeStickiness:lA,WrappingIndent:cA,InjectedTextCursorStops:HI,PositionAffinity:XI,ConfigurationChangedEvent:h$,BareFontInfo:Eh,FontInfo:hA,TextModelResolvedOptions:Oy,FindMatch:vb,ApplyUpdateResult:o_,EditorZoom:Bc,EditorType:VL,EditorOptions:yf}}function wIe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function Jw(n,e){return typeof n=="boolean"?n:e}function y6(n,e){return typeof n=="string"?n:e}function yIe(n){const e={};for(const t of n)e[t]=!0;return e}function C6(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=yIe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function TN(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof n[r]=="string")a=n[r];else if(n[r]&&n[r]instanceof RegExp)a=n[r].source;else throw n[r]===void 0?Bt(n,"language definition does not contain attribute '"+r+"', used at: "+e):Bt(n,"attribute reference '"+r+"' must be a string, used at: "+e);return fg(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,s)}function CIe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Bt(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bt(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!A0e(n,Wc(n,s,"",[],""))))throw Bt(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=TN(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=NN(e,this.name,t)}}function FG(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=Jw(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=Jw(e.ignoreCase,!1),t.unicode=Jw(e.unicode,!1),t.tokenPostfix=y6(e.tokenPostfix,"."+t.languageId),t.defaultToken=y6(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Bt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Bt(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new xIe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw Bt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw Bt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=Jw(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:gd(t,a.open),close:gd(t,a.close)});else throw Bt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var LIe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function DIe(n){Qp.registerLanguage(n)}function kIe(){let n=[];return n=n.concat(Qp.getLanguages()),n}function EIe(n){return Ee.get(ki).languageIdCodec.encodeLanguageId(n)}function IIe(n,e){return Ee.withServices(()=>{const i=Ee.get(ki).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function AIe(n,e){return Ee.withServices(()=>{const i=Ee.get(ki).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function TIe(n,e){if(!Ee.get(ki).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Ee.get(no).register(n,e,100)}class NIe{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 av.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new _L(s.tokens,s.endState)}}class av{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:fLIe(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?MIe(i)?WG(n,i):new kb(Ee.get(ki),Ee.get(xr),n,FG(n,i),Ee.get(Jt)):null}));return vi.registerFactory(n,t)}function OIe(n,e){if(!Ee.get(ki).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return BG(e)?ZP(n,{create:()=>e}):vi.register(n,WG(n,e))}function FIe(n,e){const t=i=>new kb(Ee.get(ki),Ee.get(xr),n,FG(n,i),Ee.get(Jt));return BG(e)?ZP(n,{create:()=>e}):vi.register(n,t(e))}function BIe(n,e){return Ee.get(nt).referenceProvider.register(n,e)}function WIe(n,e){return Ee.get(nt).renameProvider.register(n,e)}function VIe(n,e){return Ee.get(nt).signatureHelpProvider.register(n,e)}function HIe(n,e){return Ee.get(nt).hoverProvider.register(n,{provideHover:(i,s,o)=>{const r=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o)).then(a=>{if(a)return!a.range&&r&&(a.range=new N(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new N(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function zIe(n,e){return Ee.get(nt).documentSymbolProvider.register(n,e)}function $Ie(n,e){return Ee.get(nt).documentHighlightProvider.register(n,e)}function UIe(n,e){return Ee.get(nt).linkedEditingRangeProvider.register(n,e)}function jIe(n,e){return Ee.get(nt).definitionProvider.register(n,e)}function qIe(n,e){return Ee.get(nt).implementationProvider.register(n,e)}function GIe(n,e){return Ee.get(nt).typeDefinitionProvider.register(n,e)}function KIe(n,e){return Ee.get(nt).codeLensProvider.register(n,e)}function YIe(n,e,t){return Ee.get(nt).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=Ee.get(ol).read({resource:s.uri}).filter(d=>N.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function ZIe(n,e){return Ee.get(nt).documentFormattingEditProvider.register(n,e)}function XIe(n,e){return Ee.get(nt).documentRangeFormattingEditProvider.register(n,e)}function QIe(n,e){return Ee.get(nt).onTypeFormattingEditProvider.register(n,e)}function JIe(n,e){return Ee.get(nt).linkProvider.register(n,e)}function eAe(n,e){return Ee.get(nt).completionProvider.register(n,e)}function tAe(n,e){return Ee.get(nt).colorProvider.register(n,e)}function iAe(n,e){return Ee.get(nt).foldingRangeProvider.register(n,e)}function nAe(n,e){return Ee.get(nt).declarationProvider.register(n,e)}function sAe(n,e){return Ee.get(nt).selectionRangeProvider.register(n,e)}function oAe(n,e){return Ee.get(nt).documentSemanticTokensProvider.register(n,e)}function rAe(n,e){return Ee.get(nt).documentRangeSemanticTokensProvider.register(n,e)}function aAe(n,e){return Ee.get(nt).inlineCompletionsProvider.register(n,e)}function lAe(n,e){return Ee.get(nt).inlayHintsProvider.register(n,e)}function cAe(){return{register:DIe,getLanguages:kIe,onLanguage:IIe,onLanguageEncountered:AIe,getEncodedLanguageId:EIe,setLanguageConfiguration:TIe,setColorMap:PIe,registerTokensProviderFactory:ZP,setTokensProvider:OIe,setMonarchTokensProvider:FIe,registerReferenceProvider:BIe,registerRenameProvider:WIe,registerCompletionItemProvider:eAe,registerSignatureHelpProvider:VIe,registerHoverProvider:HIe,registerDocumentSymbolProvider:zIe,registerDocumentHighlightProvider:$Ie,registerLinkedEditingRangeProvider:UIe,registerDefinitionProvider:jIe,registerImplementationProvider:qIe,registerTypeDefinitionProvider:GIe,registerCodeLensProvider:KIe,registerCodeActionProvider:YIe,registerDocumentFormattingEditProvider:ZIe,registerDocumentRangeFormattingEditProvider:XIe,registerOnTypeFormattingEditProvider:QIe,registerLinkProvider:JIe,registerColorProvider:tAe,registerFoldingRangeProvider:iAe,registerDeclarationProvider:nAe,registerSelectionRangeProvider:sAe,registerDocumentSemanticTokensProvider:oAe,registerDocumentRangeSemanticTokensProvider:rAe,registerInlineCompletionsProvider:aAe,registerInlayHintsProvider:lAe,DocumentHighlightKind:RI,CompletionItemKind:EI,CompletionItemTag:II,CompletionItemInsertTextRule:kI,SymbolKind:sA,SymbolTag:oA,IndentAction:VI,CompletionTriggerKind:AI,SignatureHelpTriggerKind:nA,InlayHintKind:zI,InlineCompletionTriggerKind:$I,CodeActionTriggerType:DI,FoldingRangeKind:ls,SelectedSuggestionInfo:efe}}const XP=at("IEditorCancelService"),VG=new me("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ht(XP,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=VG.bindTo(s.get(Je)),r=new ks;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class dAe extends yr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(XP).add(e,this))}dispose(){this._unregister(),super.dispose()}}ke(new class extends vr{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:VG})}runEditorCommand(n,e){n.get(XP).cancel(e)}});let uAe=class MN{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?ub("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof MN))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new MN(e,this.flags))}};class hAe extends dAe{constructor(e,t,i,s){super(e,s),this._listener=new fe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!N.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!N.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class fAe extends yr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function HG(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===VL.ICodeEditor:!1}class S6{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class gAe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(S6.toKey(e))}has(e){return this._set.has(S6.toKey(e))}}var Wm=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function pAe(n,e,t){const i=[],s=new gAe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class lv{static setFormatterSelector(e){return{dispose:lv._selectors.unshift(e)}}static select(e,t,i){return Wm(this,void 0,void 0,function*(){if(e.length===0)return;const s=dt.first(lv._selectors);if(s)return yield s(e,t,i)})}}lv._selectors=new ks;function mAe(n,e,t,i,s,o){return Wm(this,void 0,void 0,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(lc);if(Gl(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function _Ae(n,e,t,i,s){return Wm(this,void 0,void 0,function*(){const o=pAe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(lc);if(Gl(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function bAe(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(lc).then(l=>n.computeMoreMinimalEdits(t.uri,l))}qt.registerCommand("_executeFormatRangeProvider",function(n,...e){return Wm(this,void 0,void 0,function*(){const[t,i,s]=e;Ls($e.isUri(t)),Ls(N.isIRange(i));const o=n.get(au),r=n.get(k1),a=n.get(nt),l=yield o.createModelReference(t);try{return mAe(r,a,l.object.textEditorModel,N.lift(i),s,rn.None)}finally{l.dispose()}})});qt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return Wm(this,void 0,void 0,function*(){const[t,i]=e;Ls($e.isUri(t));const s=n.get(au),o=n.get(k1),r=n.get(nt),a=yield s.createModelReference(t);try{return _Ae(o,r,a.object.textEditorModel,i,rn.None)}finally{a.dispose()}})});qt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return Wm(this,void 0,void 0,function*(){const[t,i,s,o]=e;Ls($e.isUri(t)),Ls(V.isIPosition(i)),Ls(typeof s=="string");const r=n.get(au),a=n.get(k1),l=n.get(nt),c=yield r.createModelReference(t);try{return bAe(a,l,c.object.textEditorModel,V.lift(i),s,o,rn.None)}finally{c.dispose()}})});yf.wrappingIndent.defaultValue=0;yf.glyphMargin.defaultValue=!1;yf.autoIndent.defaultValue=3;yf.overviewRulerLanes.defaultValue=2;lv.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const ms=E$();ms.editor=vIe();ms.languages=cAe();const vAe=ms.CancellationTokenSource,wAe=ms.Emitter,yAe=ms.KeyCode,CAe=ms.KeyMod,SAe=ms.Position,xAe=ms.Range,LAe=ms.Selection,DAe=ms.SelectionDirection,kAe=ms.MarkerSeverity,EAe=ms.MarkerTag,IAe=ms.Uri,AAe=ms.Token,zG=ms.editor,$G=ms.languages,G2=globalThis.MonacoEnvironment;(G2!=null&&G2.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ms);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const TAe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:vAe,Emitter:wAe,KeyCode:yAe,KeyMod:CAe,MarkerSeverity:kAe,MarkerTag:EAe,Position:SAe,Range:xAe,Selection:LAe,SelectionDirection:DAe,Token:AAe,Uri:IAe,editor:zG,languages:$G},Symbol.toStringTag,{value:"Module"})),NAe="#/definitions/RootSpec",MAe="http://json-schema.org/draft-07/schema#",RAe={AggregateParams:{additionalProperties:!1,properties:{groupby:{description:"Which fields to use for grouping. Missing `groupby` results in a single group that includes all the data items.",items:{$ref:"#/definitions/Field"},type:"array"},type:{const:"aggregate",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},Align:{enum:["left","center","right"],type:"string"},Axis:{additionalProperties:!1,properties:{domain:{description:"A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",type:"boolean"},domainCap:{description:'The stroke cap for the domain line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},domainColor:{description:'Color of axis domain line.\n\n__Default value:__ `"gray"`.',type:"string"},domainDash:{description:"An array of alternating [stroke, space] lengths for dashed domain lines.",items:{type:"number"},type:"array"},domainDashOffset:{description:"The pixel offset at which to start drawing with the domain dash array.",type:"number"},domainWidth:{description:"Stroke width of axis domain line\n\n__Default value:__ `1`",type:"number"},format:{description:"The format specifier pattern for axis labels. Must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier.",type:"string"},grid:{description:"A boolean flag indicating if grid lines should be included as part of the axis.\n\n__Default value:__ `false`",type:"boolean"},gridCap:{description:'The stroke cap for the grid line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},gridColor:{description:"Color of grid lines.\n\n__Default value:__ `lightgray`",type:"string"},gridDash:{description:"An array of alternating [stroke, space] lengths for dashed grid mark lines.",items:{type:"number"},type:"array"},gridDashOffset:{description:"The pixel offset at which to start drawing with the grid mark dash array.",type:"number"},gridOpacity:{description:"The opacity of the grid lines.\n\n__Default value:__ `1`",type:"number"},gridWidth:{description:"Width of the grid lines.\n\n__Default value:__ `1`",type:"number"},labelAlign:{$ref:"#/definitions/Align",description:"Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation."},labelAngle:{description:"The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.",maximum:360,minimum:-360,type:"number"},labelBaseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`.'},labelColor:{description:"The color of the tick label, can be in hex color code or regular color name.",type:"string"},labelFont:{description:"The font of the tick label.",type:"string"},labelFontSize:{description:"The font size of the label, in pixels.",minimum:0,type:"number"},labelFontStyle:{description:"Font style of the title.",type:"string"},labelFontWeight:{description:"Font weight of axis tick labels.",type:"string"},labelLimit:{description:"Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`",type:"number"},labelPadding:{description:"The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`",type:"number"},labels:{description:"A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",type:"boolean"},maxExtent:{description:"The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.",type:"number"},minExtent:{description:"The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.",type:"number"},offset:{description:"The orthogonal offset in pixels by which to displace the axis from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/AxisOrient",description:'The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).\n\n__Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.'},tickCap:{description:'The stroke cap for the tick lines\' ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},tickColor:{description:`The color of the axis's tick. +`),yield this._clipboardService.writeText(y)}))),i.getOption(90)||v.push(new So("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>Q2(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(Hi(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Nn(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,p+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=Nn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function KEe(n,e,t,i){Mn(i,e.fontInfo);const s=t.length>0,o=new zL(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Do.isBasicASCII(l,s),d=Do.containsRTL(l,c,o),u=P4(new Om(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!==No.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var ZEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},D6=function(n,e){return function(t,i){e(t,i,n)}};let ON=class extends Y{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=r,this._contextMenuService=a,this._originalTopPadding=oi(this,0),this._originalScrollOffset=oi(this,0),this._originalScrollOffsetAnimated=f6(this._originalScrollOffset,this._store),this._modifiedTopPadding=oi(this,0),this._modifiedScrollOffset=oi(this,0),this._modifiedScrollOffsetAnimated=f6(this._modifiedScrollOffset,this._store);let l=!1;const c=oi("state",0),d=this._register(new xi(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(y=>y?Is(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),h=new Set,f=new Set,g=mt(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;c.read(y);const D=this._options.renderSideBySide.read(y);return k6(this._editors.original,this._editors.modified,L.mappings,h,f,D)}),p=mt(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;c.read(y);const x=L.changes.map(D=>new ZG(D));return k6(this._editors.original,this._editors.modified,x,h,f,!0)});function _(){const y=document.createElement("div");return y.className="diagonal-fill",y}const v=this._register(new fe),b=mt(y=>{var S,L,x,D,k,P,O,R;v.clear();const M=g.read(y)||[],W=[],G=[],ne=this._modifiedTopPadding.read(y);ne>0&&G.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ne,showInHiddenAreas:!0,suppressMouseDown:!0});const ce=this._originalTopPadding.read(y);ce>0&&W.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0});const ge=this._options.renderSideBySide.read(y),se=ge||(S=this._editors.modified._getViewModel())===null||S===void 0?void 0:S.createLineBreaksComputer();if(se){for(const Ge of M)if(Ge.diff)for(let ti=Ge.originalRange.startLineNumber;tithis._editors.original.getModel().tokenization.getLineTokens(Et)),Ge.originalRange.mapToLineArray(Et=>Se[Ie++]),Kt,xt),he=[];for(const Et of Ge.diff.innerChanges||[])he.push(new u_(Et.originalRange.delta(-(Ge.diff.original.startLineNumber-1)),TN.className,0));const ue=KEe(Ve,It,he,De),Di=document.createElement("div");if(Di.className="inline-deleted-margin-view-zone",Mn(Di,It.fontInfo),this._options.renderIndicators.read(y))for(let Et=0;EtxI(Lt),Di,this._editors.modified,Ge.diff,this._diffEditorWidget,ue.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Et=0;Et1&&W.push({afterLineNumber:Ge.originalRange.startLineNumber+Et,domNode:_(),heightInPx:(mi-1)*pe,showInHiddenAreas:!0,suppressMouseDown:!0})}G.push({afterLineNumber:Ge.modifiedRange.startLineNumber-1,domNode:De,heightInPx:ue.heightInLines*pe,minWidthInPx:ue.minWidthInPx,marginDomNode:Di,setZoneId(Et){Lt=Et},showInHiddenAreas:!0,suppressMouseDown:!0})}const ti=document.createElement("div");ti.className="gutter-delete",W.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ge.modifiedHeightInPx,marginDomNode:ti,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ti=Ge.modifiedHeightInPx-Ge.originalHeightInPx;if(ti>0){if(ee!=null&&ee.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ge.originalRange.endLineNumberExclusive-1))continue;W.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ti,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let De=function(){const he=document.createElement("div");return he.className="arrow-revert-change "+Ae.asClassName(ie.arrowRight),we("div",{},he)};if(ee!=null&&ee.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ge.modifiedRange.endLineNumberExclusive-1))continue;let Ve;Ge.diff&&Ge.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(Ve=De()),G.push({afterLineNumber:Ge.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ti,marginDomNode:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ge of(R=p.read(y))!==null&&R!==void 0?R:[]){if(!(ee!=null&&ee.lineRangeMapping.original.intersect(Ge.originalRange))||!(ee!=null&&ee.lineRangeMapping.modified.intersect(Ge.modifiedRange)))continue;const ti=Ge.modifiedHeightInPx-Ge.originalHeightInPx;ti>0?W.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ti,showInHiddenAreas:!0,suppressMouseDown:!0}):G.push({afterLineNumber:Ge.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ti,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:W,mod:G}});this._register(Hs(y=>{const S=lv.capture(this._editors.modified),L=b.read(y);l=!0,this._editors.original.changeViewZones(x=>{for(const D of h)x.removeZone(D);h.clear();for(const D of L.orig){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(x=>{for(const D of f)x.removeZone(D);f.clear();for(const D of L.mod){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),f.add(k)}}),l=!1,S.restore(this._editors.modified)})),this._register(Ze(()=>{this._editors.original.changeViewZones(y=>{for(const S of h)y.removeZone(S);h.clear()}),this._editors.modified.changeViewZones(y=>{for(const S of f)y.removeZone(S);f.clear()})}));let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=Is(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ai(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(ai(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(ai(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let x=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();x=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}x>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(x,void 0)):x<0?(this._modifiedTopPadding.set(-x,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-x,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+x,void 0,!0)}))}};ON=ZEe([D6(5,V1),D6(6,vu)],ON);function k6(n,e,t,i,s,o){const r=new ac(E6(n,i)),a=new ac(E6(e,s)),l=n.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=p&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,w=v?v.lineNumber-h:Number.MAX_VALUE;bw?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Qe.ofLength(_.lineNumber,1),modifiedRange:Qe.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let w=function(y,S){var L,x,D,k;if(yW.lineNumberW+G.heightInPx,0))!==null&&x!==void 0?x:0,M=(k=(D=a.takeWhile(W=>W.lineNumberW+G.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:P,modifiedRange:O,originalHeightInPx:P.length*l+R,modifiedHeightInPx:O.length*c+M,diff:g.lineRangeMapping}),b=y,v=S};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,v=p.modified.startLineNumber,b=p.original.startLineNumber;if(o)for(const y of p.innerChanges||[])y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&w(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber),y.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new H(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return gEe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var XEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},QEe=function(n,e){return function(t,i){e(t,i,n)}},Rr;let tc=Rr=class extends Y{constructor(e,t,i,s,o,r,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._options=a,this._themeService=l;const c=Is(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=mt(f=>{const g=c.read(f),p=g.getColor(abe)||(g.getColor(obe)||ZA).transparent(2),_=g.getColor(lbe)||(g.getColor(rbe)||XA).transparent(2);return{insertColor:p,removeColor:_}}),u=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Hs((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=_t(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=dn("div.diffOverview",{style:{position:"absolute",top:"0px",width:Rr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(oy(_,p.domNode)),g.add(Hi(_,le.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(K(_,le.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(oy(this._rootElement,_)),g.add(Hs((v,b)=>{const w=this._diffModel.read(v),y=this._editors.original.createOverviewRuler("original diffOverviewRuler");y&&(b.add(y),b.add(oy(_,y.getDomNode())));const S=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(S&&(b.add(S),b.add(oy(_,S.getDomNode()))),!y||!S)return;const L=Ro("viewZoneChanged",this._editors.original.onDidChangeViewZones),x=Ro("viewZoneChanged",this._editors.modified.onDidChangeViewZones),D=Ro("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Ro("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(ai(P=>{var O;L.read(P),x.read(P),D.read(P),k.read(P);const R=d.read(P),M=(O=w==null?void 0:w.diff.read(P))===null||O===void 0?void 0:O.mappings;function W(ce,ge,se){const Se=se._getViewModel();return Se?ce.filter(Ie=>Ie.length>0).map(Ie=>{const pe=Se.coordinatesConverter.convertModelPositionToViewPosition(new H(Ie.startLineNumber,1)),ee=Se.coordinatesConverter.convertModelPositionToViewPosition(new H(Ie.endLineNumberExclusive,1)),Kt=ee.lineNumber-pe.lineNumber;return new jj(pe.lineNumber,ee.lineNumber,Kt,ge.toString())}):[]}const G=W((M||[]).map(ce=>ce.lineRangeMapping.original),R.removeColor,this._editors.original),ne=W((M||[]).map(ce=>ce.lineRangeMapping.modified),R.insertColor,this._editors.modified);y==null||y.setZones(G),S==null||S.setZones(ne)})),b.add(ai(P=>{const O=this._rootHeight.read(P),R=this._rootWidth.read(P),M=this._modifiedEditorLayoutInfo.read(P);if(M){const W=Rr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Rr.ONE_OVERVIEW_WIDTH;y.setLayout({top:0,height:O,right:W+Rr.ONE_OVERVIEW_WIDTH,width:Rr.ONE_OVERVIEW_WIDTH}),S.setLayout({top:0,height:O,right:0,width:Rr.ONE_OVERVIEW_WIDTH});const G=u.read(P),ne=h.read(P),ce=this._editors.modified.getOption(102),ge=new lm(ce.verticalHasArrows?ce.arrowSize:0,ce.verticalScrollbarSize,0,M.height,ne,G);p.setTop(ge.getSliderPosition()),p.setHeight(ge.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=O+"px",_.style.left=R-Rr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(Rr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};tc.ONE_OVERVIEW_WIDTH=15;tc.ENTIRE_DIFF_OVERVIEW_WIDTH=Rr.ONE_OVERVIEW_WIDTH*2;tc=Rr=XEe([QEe(7,oo)],tc);E("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},m("diffEditor.move.border","The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},m("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class ND extends Y{constructor(){super(...arguments),this._id=++ND.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}ND.idCounter=0;var JEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I6=function(n,e){return function(t,i){e(t,i,n)}};let FN=class extends Y{constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this._onDidContentSizeChange=this._register(new B),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=Is(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(ID({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+tc.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=yf.revealHorizontalRightPadding.defaultValue+tc.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=m("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};FN=JEe([I6(5,bt),I6(6,pi)],FN);class eIe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=mt(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=mt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=mt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=mt(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=mt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=mt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=mt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=mt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=mt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=mt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=mt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=mt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=mt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=mt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=mt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=mt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=mt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=mt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=mt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=mt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=mt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),A6(e,$n));this._options=oi(this,i)}updateOptions(e){const t=A6(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function A6(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:ve(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Zue(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:ve(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:ve(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Wu(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Wu(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:ve(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:ve(n.renderIndicators,e.renderIndicators),originalEditable:ve(n.originalEditable,e.originalEditable),diffCodeLens:ve(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:ve(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ci(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ci(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:ve(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:ve((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:ve((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:ve((o=(s=n.hideUnchangedRegions)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:(r=n.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Wu((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Wu((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Wu((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:ve(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:ve(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Wu(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:ve(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var tIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_0=function(n,e){return function(t,i){e(t,i,n)}};let BN=class extends ND{constructor(e,t,i,s,o,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=dn("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[dn("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[we("span",{},"No Changes")]),dn("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),dn("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),dn("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(rEe("diffModel",void 0)),this.onDidChangeModel=de.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new aD([tt,this._contextKeyService])),this._boundarySashes=oi(this,void 0),this._accessibleDiffViewerShouldBeVisible=oi(this,!1),this._accessibleDiffViewerVisible=mt(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=oi(this,void 0),this._layoutInfo=mt(this,p=>{var _,v,b;const w=this._rootSizeObserver.width.read(p),y=this._rootSizeObserver.height.read(p),S=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=S??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),x=w-L-(this._options.renderOverviewRuler.read(p)?tc.ENTIRE_DIFF_OVERVIEW_WIDTH:0),D=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,k=L-D;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=x+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:k,height:y}),this._editors.modified.layout({width:x,height:y}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,_)=>p==null?void 0:p.diff.read(_)),this.onDidUpdateDiff=de.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ze(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new pEe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new eIe(t,this._rootSizeObserver.width),this._contextKeyService.createKey($.isEmbeddedDiffEditor.key,!1);const d=$.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(ai(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=$.comparingMovedCode.bindTo(this._contextKeyService);this._register(ai(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=$.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(ai(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(FN,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=av(this,(p,_)=>{const v=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",v),!v)return;const b=_.add(new OEe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((w,y)=>w-(this._options.renderOverviewRuler.read(y)?tc.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(ai(w=>{const y=this._boundarySashes.read(w);y&&b.setBoundarySashes(y)})),b}),this._register(ox(this._sash)),this._register(Hs((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Fc(NN,p),this._editors,this._diffModel,this._options))})),this._register(Hs((p,_)=>{_.add(new(Fc(PEe,p))(this._editors,this._diffModel,this._options))})),this._register(Hs((p,_)=>{_.add(this._instantiationService.createInstance(Fc(ON,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Hs((p,_)=>{_.add(this._instantiationService.createInstance(Fc(tc,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(Hs((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Fc(ad,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(v,b)=>this._accessibleDiffViewerShouldBeVisible.set(v,b),this._options.onlyShowAccessibleDiffViewer.map(v=>!v),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((v,b)=>{var w;return(w=v==null?void 0:v.diff.read(b))===null||w===void 0?void 0:w.mappings.map(y=>y.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(Cd(this.elements.modified,{visibility:f})),this._register(Cd(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(ox(this._layoutInfo)),this._register(Hs((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Fc(Sd,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(Cd(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:mt(p=>{var _,v;return this._options.hideUnchangedRegions.read(p)&&((v=(_=this._diffModel.read(p))===null||_===void 0?void 0:_.diff.read(p))===null||v===void 0?void 0:v.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var _,v;if(!p.event.rightButton&&p.target.position&&(!((_=p.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const b=p.target.position.lineNumber,w=p.target,y=this._diffModel.get();if(!y)return;const S=(v=y.diff.get())===null||v===void 0?void 0:v.mappings;if(!S)return;const L=S.find(x=>(w==null?void 0:w.detail.afterLineNumber)===x.lineRangeMapping.modified.startLineNumber-1||x.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(de.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var _,v;if((p==null?void 0:p.reason)===3){const b=(v=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||v===void 0?void 0:v.mappings.find(w=>w.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(ct.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register(Hs((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(Ze(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(um,t,i,s)}_createDiffEditorContributions(){const e=ep.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){pt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return KL.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(PN,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Pn(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?sIe(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const s=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",s)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),s=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=s.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=T6(a.getStartPosition(),l),d=T6(a.getEndPosition(),l);r=N.plusRange(c,d)}}return{destination:o,destinationSelection:r}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pn(i=>{for(const s of t)s.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Pn(i=>{for(const s of t)s.showAll(i)})}};BN=tIe([_0(3,tt),_0(4,bt),_0(5,$t),_0(6,kD),_0(7,T1)],BN);function T6(n,e){const t=BA(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return N.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return N.fromPositions(new H(s,n.column))}if(!t.innerChanges)return N.fromPositions(new H(t.modified.startLineNumber,1));const i=BA(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return N.fromPositions(new H(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=iIe(i.originalRange.getEndPosition(),n);return N.fromPositions(nIe(i.modifiedRange.getEndPosition(),s))}}function iIe(n,e){return n.lineNumber===e.lineNumber?new Hb(0,e.column-n.column):new Hb(e.lineNumber-n.lineNumber,e.column-1)}function nIe(n,e){return e.lineCount===0?new H(n.lineNumber,n.column+e.columnCount):new H(n.lineNumber+e.lineCount,e.columnCount+1)}function sIe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var r3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ht=function(n,e){return function(t,i){e(t,i,n)}};let oIe=0,N6=!1;function rIe(n){if(!n){if(N6)return;N6=!0}s_e(n||document.body)}let ux=class extends um{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||WS.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+WS.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof bm?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,rIe(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++oIe,o=xe.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None;const t=e.id,i=e.label,s=xe.and(xe.equals("editorId",this.getId()),xe.deserialize(e.precondition)),o=e.keybindings,r=xe.and(s,xe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new fe,u=this.getId()+":"+t;if(d.add(Gt.registerCommand(u,c)),a){const f={command:{id:u,title:i},when:s,group:a,order:l};d.add(or.appendMenuItem(A.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new qj(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(Ze(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof RS)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};ux=r3([Ht(2,bt),Ht(3,$t),Ht(4,fs),Ht(5,tt),Ht(6,pi),Ht(7,oo),Ht(8,Ln),Ht(9,mu),Ht(10,no),Ht(11,nt)],ux);let WN=class extends ux{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);sx(d,_,!1);const v=l.registerEditorContainer(e);typeof _.theme=="string"&&l.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const b=_.model;delete _.model,super(e,_,i,s,o,r,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(v);let w;if(typeof b>"u"){const y=f.getLanguageIdByMimeType(_.language)||_.language||Vo;w=XG(h,f,_.value||"",y,void 0),this._ownsModel=!0}else w=b,this._ownsModel=!1;if(this._attachModel(w),w){const y={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(y)}}dispose(){super.dispose()}updateOptions(e){sx(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};WN=r3([Ht(2,bt),Ht(3,$t),Ht(4,fs),Ht(5,tt),Ht(6,pi),Ht(7,Lr),Ht(8,Ln),Ht(9,ei),Ht(10,mu),Ht(11,hs),Ht(12,Ii),Ht(13,no),Ht(14,nt)],WN);let VN=class extends BN{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);sx(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){sx(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(ux,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};VN=r3([Ht(2,bt),Ht(3,tt),Ht(4,$t),Ht(5,Lr),Ht(6,Ln),Ht(7,ei),Ht(8,vu),Ht(9,T1),Ht(10,V1),Ht(11,kD)],VN);function XG(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),M6(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return M6(n,t,e.createById(i),s)}function M6(n,e,t,i){return n.createModel(e,t,i)}var QG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function aIe(n,e,t){return Ee.initialize(t||{}).createInstance(WN,n,e)}function lIe(n){return Ee.get($t).onCodeEditorAdd(t=>{n(t)})}function cIe(n){return Ee.get($t).onDiffEditorAdd(t=>{n(t)})}function dIe(){return Ee.get($t).listCodeEditors()}function uIe(){return Ee.get($t).listDiffEditors()}function hIe(n,e,t){return Ee.initialize(t||{}).createInstance(VN,n,e)}function fIe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Gt.registerCommand(n.id,n.run)}function gIe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=xe.deserialize(n.precondition),t=(s,...o)=>wr.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new fe;if(i.add(Gt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(or.appendMenuItem(A.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Ee.get(pi);if(!(s instanceof bm))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=xe.and(e,xe.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function pIe(n){return JG([n])}function JG(n){const e=Ee.get(pi);return e instanceof bm?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:xe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None)}function mIe(n,e,t){const i=Ee.get(Ii),s=i.getLanguageIdByMimeType(e)||e;return XG(Ee.get(hs),i,n,s,t)}function _Ie(n,e){const t=Ee.get(Ii),i=t.getLanguageIdByMimeType(e)||e||Vo;n.setLanguage(t.createById(i))}function bIe(n,e,t){n&&Ee.get(ol).changeOne(e,n.uri,t)}function vIe(n){Ee.get(ol).changeAll(n,[])}function wIe(n){return Ee.get(ol).read(n)}function yIe(n){return Ee.get(ol).onMarkerChanged(n)}function CIe(n){return Ee.get(hs).getModel(n)}function SIe(){return Ee.get(hs).getModels()}function xIe(n){return Ee.get(hs).onModelAdded(n)}function LIe(n){return Ee.get(hs).onModelRemoved(n)}function DIe(n){return Ee.get(hs).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function kIe(n){return T0e(Ee.get(hs),Ee.get(no),n)}function EIe(n,e){const t=Ee.get(Ii),i=Ee.get(Lr);return F4.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function IIe(n,e,t){const i=Ee.get(Ii);return Ee.get(Lr).registerEditorContainer(document.body),F4.colorize(i,n,e,t)}function AIe(n,e,t=4){return Ee.get(Lr).registerEditorContainer(document.body),F4.colorizeModelLine(n,e,t)}function TIe(n){const e=yi.get(n);return e||{getInitialState:()=>Db,tokenize:(t,i,s)=>ej(n,s)}}function NIe(n,e){yi.getOrCreate(e);const t=TIe(e),i=xf(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rQG(this,void 0,void 0,function*(){var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function WIe(){return{create:aIe,getEditors:dIe,getDiffEditors:uIe,onDidCreateEditor:lIe,onDidCreateDiffEditor:cIe,createDiffEditor:hIe,addCommand:fIe,addEditorAction:gIe,addKeybindingRule:pIe,addKeybindingRules:JG,createModel:mIe,setModelLanguage:_Ie,setModelMarkers:bIe,getModelMarkers:wIe,removeAllMarkers:vIe,onDidChangeMarkers:yIe,getModels:SIe,getModel:CIe,onDidCreateModel:xIe,onWillDisposeModel:LIe,onDidChangeModelLanguage:DIe,createWebWorker:kIe,colorizeElement:EIe,colorize:IIe,colorizeModelLine:AIe,tokenize:NIe,defineTheme:MIe,setTheme:RIe,remeasureFonts:PIe,registerCommand:OIe,registerLinkOpener:FIe,registerEditorOpener:BIe,AccessibilitySupport:PI,ContentWidgetPositionPreference:HI,CursorChangeReason:zI,DefaultEndOfLine:$I,EditorAutoIndentStrategy:jI,EditorOption:qI,EndOfLinePreference:GI,EndOfLineSequence:KI,MinimapPosition:nA,MouseTargetType:sA,OverlayWidgetPositionPreference:oA,OverviewRulerLane:rA,GlyphMarginLane:YI,RenderLineNumbersType:lA,RenderMinimap:cA,ScrollbarVisibility:uA,ScrollType:dA,TextEditorCursorBlinkingStyle:mA,TextEditorCursorStyle:_A,TrackedRangeStickiness:bA,WrappingIndent:vA,InjectedTextCursorStops:XI,PositionAffinity:aA,ConfigurationChangedEvent:I$,BareFontInfo:Ih,FontInfo:CA,TextModelResolvedOptions:$y,FindMatch:yb,ApplyUpdateResult:a_,EditorZoom:Vc,EditorType:KL,EditorOptions:yf}}function VIe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function ry(n,e){return typeof n=="boolean"?n:e}function R6(n,e){return typeof n=="string"?n:e}function HIe(n){const e={};for(const t of n)e[t]=!0;return e}function P6(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=HIe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function HN(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof n[r]=="string")a=n[r];else if(n[r]&&n[r]instanceof RegExp)a=n[r].source;else throw n[r]===void 0?Bt(n,"language definition does not contain attribute '"+r+"', used at: "+e):Bt(n,"attribute reference '"+r+"' must be a string, used at: "+e);return fg(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,s)}function zIe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Bt(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bt(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!Z0e(n,Hc(n,s,"",[],""))))throw Bt(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=HN(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=zN(e,this.name,t)}}function eK(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=ry(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=ry(e.ignoreCase,!1),t.unicode=ry(e.unicode,!1),t.tokenPostfix=R6(e.tokenPostfix,"."+t.languageId),t.defaultToken=R6(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Bt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Bt(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new UIe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw Bt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw Bt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=ry(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:_d(t,a.open),close:_d(t,a.close)});else throw Bt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var jIe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function qIe(n){em.registerLanguage(n)}function GIe(){let n=[];return n=n.concat(em.getLanguages()),n}function KIe(n){return Ee.get(Ii).languageIdCodec.encodeLanguageId(n)}function YIe(n,e){return Ee.withServices(()=>{const i=Ee.get(Ii).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function ZIe(n,e){return Ee.withServices(()=>{const i=Ee.get(Ii).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function XIe(n,e){if(!Ee.get(Ii).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Ee.get(no).register(n,e,100)}class QIe{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 cv.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new LL(s.tokens,s.endState)}}class cv{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:fjIe(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?JIe(i)?iK(n,i):new Ib(Ee.get(Ii),Ee.get(Lr),n,eK(n,i),Ee.get(ei)):null}));return yi.registerFactory(n,t)}function iAe(n,e){if(!Ee.get(Ii).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return tK(e)?a3(n,{create:()=>e}):yi.register(n,iK(n,e))}function nAe(n,e){const t=i=>new Ib(Ee.get(Ii),Ee.get(Lr),n,eK(n,i),Ee.get(ei));return tK(e)?a3(n,{create:()=>e}):yi.register(n,t(e))}function sAe(n,e){return Ee.get(nt).referenceProvider.register(n,e)}function oAe(n,e){return Ee.get(nt).renameProvider.register(n,e)}function rAe(n,e){return Ee.get(nt).signatureHelpProvider.register(n,e)}function aAe(n,e){return Ee.get(nt).hoverProvider.register(n,{provideHover:(i,s,o)=>{const r=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o)).then(a=>{if(a)return!a.range&&r&&(a.range=new N(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new N(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function lAe(n,e){return Ee.get(nt).documentSymbolProvider.register(n,e)}function cAe(n,e){return Ee.get(nt).documentHighlightProvider.register(n,e)}function dAe(n,e){return Ee.get(nt).linkedEditingRangeProvider.register(n,e)}function uAe(n,e){return Ee.get(nt).definitionProvider.register(n,e)}function hAe(n,e){return Ee.get(nt).implementationProvider.register(n,e)}function fAe(n,e){return Ee.get(nt).typeDefinitionProvider.register(n,e)}function gAe(n,e){return Ee.get(nt).codeLensProvider.register(n,e)}function pAe(n,e,t){return Ee.get(nt).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=Ee.get(ol).read({resource:s.uri}).filter(d=>N.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function mAe(n,e){return Ee.get(nt).documentFormattingEditProvider.register(n,e)}function _Ae(n,e){return Ee.get(nt).documentRangeFormattingEditProvider.register(n,e)}function bAe(n,e){return Ee.get(nt).onTypeFormattingEditProvider.register(n,e)}function vAe(n,e){return Ee.get(nt).linkProvider.register(n,e)}function wAe(n,e){return Ee.get(nt).completionProvider.register(n,e)}function yAe(n,e){return Ee.get(nt).colorProvider.register(n,e)}function CAe(n,e){return Ee.get(nt).foldingRangeProvider.register(n,e)}function SAe(n,e){return Ee.get(nt).declarationProvider.register(n,e)}function xAe(n,e){return Ee.get(nt).selectionRangeProvider.register(n,e)}function LAe(n,e){return Ee.get(nt).documentSemanticTokensProvider.register(n,e)}function DAe(n,e){return Ee.get(nt).documentRangeSemanticTokensProvider.register(n,e)}function kAe(n,e){return Ee.get(nt).inlineCompletionsProvider.register(n,e)}function EAe(n,e){return Ee.get(nt).inlayHintsProvider.register(n,e)}function IAe(){return{register:qIe,getLanguages:GIe,onLanguage:YIe,onLanguageEncountered:ZIe,getEncodedLanguageId:KIe,setLanguageConfiguration:XIe,setColorMap:tAe,registerTokensProviderFactory:a3,setTokensProvider:iAe,setMonarchTokensProvider:nAe,registerReferenceProvider:sAe,registerRenameProvider:oAe,registerCompletionItemProvider:wAe,registerSignatureHelpProvider:rAe,registerHoverProvider:aAe,registerDocumentSymbolProvider:lAe,registerDocumentHighlightProvider:cAe,registerLinkedEditingRangeProvider:dAe,registerDefinitionProvider:uAe,registerImplementationProvider:hAe,registerTypeDefinitionProvider:fAe,registerCodeLensProvider:gAe,registerCodeActionProvider:pAe,registerDocumentFormattingEditProvider:mAe,registerDocumentRangeFormattingEditProvider:_Ae,registerOnTypeFormattingEditProvider:bAe,registerLinkProvider:vAe,registerColorProvider:yAe,registerFoldingRangeProvider:CAe,registerDeclarationProvider:SAe,registerSelectionRangeProvider:xAe,registerDocumentSemanticTokensProvider:LAe,registerDocumentRangeSemanticTokensProvider:DAe,registerInlineCompletionsProvider:kAe,registerInlayHintsProvider:EAe,DocumentHighlightKind:UI,CompletionItemKind:BI,CompletionItemTag:WI,CompletionItemInsertTextRule:FI,SymbolKind:gA,SymbolTag:pA,IndentAction:ZI,CompletionTriggerKind:VI,SignatureHelpTriggerKind:fA,InlayHintKind:QI,InlineCompletionTriggerKind:JI,CodeActionTriggerType:OI,FoldingRangeKind:as,SelectedSuggestionInfo:wfe}}const l3=at("IEditorCancelService"),nK=new _e("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ht(l3,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=nK.bindTo(s.get(tt)),r=new Ds;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class AAe extends Cr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(l3).add(e,this))}dispose(){this._unregister(),super.dispose()}}ke(new class extends wr{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:nK})}runEditorCommand(n,e){n.get(l3).cancel(e)}});let TAe=class $N{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?fb("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof $N))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new $N(e,this.flags))}};class NAe extends AAe{constructor(e,t,i,s){super(e,s),this._listener=new fe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!N.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!N.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class MAe extends Cr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function sK(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===KL.ICodeEditor:!1}class O6{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class RAe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(O6.toKey(e))}has(e){return this._set.has(O6.toKey(e))}}var Hm=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function PAe(n,e,t){const i=[],s=new RAe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class dv{static setFormatterSelector(e){return{dispose:dv._selectors.unshift(e)}}static select(e,t,i){return Hm(this,void 0,void 0,function*(){if(e.length===0)return;const s=dt.first(dv._selectors);if(s)return yield s(e,t,i)})}}dv._selectors=new Ds;function OAe(n,e,t,i,s,o){return Hm(this,void 0,void 0,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(uc);if(Zl(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function FAe(n,e,t,i,s){return Hm(this,void 0,void 0,function*(){const o=PAe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(uc);if(Zl(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function BAe(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(uc).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Gt.registerCommand("_executeFormatRangeProvider",function(n,...e){return Hm(this,void 0,void 0,function*(){const[t,i,s]=e;xs(je.isUri(t)),xs(N.isIRange(i));const o=n.get(hu),r=n.get(R1),a=n.get(nt),l=yield o.createModelReference(t);try{return OAe(r,a,l.object.textEditorModel,N.lift(i),s,rn.None)}finally{l.dispose()}})});Gt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return Hm(this,void 0,void 0,function*(){const[t,i]=e;xs(je.isUri(t));const s=n.get(hu),o=n.get(R1),r=n.get(nt),a=yield s.createModelReference(t);try{return FAe(o,r,a.object.textEditorModel,i,rn.None)}finally{a.dispose()}})});Gt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return Hm(this,void 0,void 0,function*(){const[t,i,s,o]=e;xs(je.isUri(t)),xs(H.isIPosition(i)),xs(typeof s=="string");const r=n.get(hu),a=n.get(R1),l=n.get(nt),c=yield r.createModelReference(t);try{return BAe(a,l,c.object.textEditorModel,H.lift(i),s,o,rn.None)}finally{c.dispose()}})});yf.wrappingIndent.defaultValue=0;yf.glyphMargin.defaultValue=!1;yf.autoIndent.defaultValue=3;yf.overviewRulerLanes.defaultValue=2;dv.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const ps=j$();ps.editor=WIe();ps.languages=IAe();const WAe=ps.CancellationTokenSource,VAe=ps.Emitter,HAe=ps.KeyCode,zAe=ps.KeyMod,$Ae=ps.Position,UAe=ps.Range,jAe=ps.Selection,qAe=ps.SelectionDirection,GAe=ps.MarkerSeverity,KAe=ps.MarkerTag,YAe=ps.Uri,ZAe=ps.Token,oK=ps.editor,rK=ps.languages,J2=globalThis.MonacoEnvironment;(J2!=null&&J2.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ps);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const XAe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:WAe,Emitter:VAe,KeyCode:HAe,KeyMod:zAe,MarkerSeverity:GAe,MarkerTag:KAe,Position:$Ae,Range:UAe,Selection:jAe,SelectionDirection:qAe,Token:ZAe,Uri:YAe,editor:oK,languages:rK},Symbol.toStringTag,{value:"Module"})),QAe="#/definitions/RootSpec",JAe="http://json-schema.org/draft-07/schema#",eTe={AggregateParams:{additionalProperties:!1,properties:{groupby:{description:"Which fields to use for grouping. Missing `groupby` results in a single group that includes all the data items.",items:{$ref:"#/definitions/Field"},type:"array"},type:{const:"aggregate",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},Align:{enum:["left","center","right"],type:"string"},Axis:{additionalProperties:!1,properties:{domain:{description:"A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",type:"boolean"},domainCap:{description:'The stroke cap for the domain line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},domainColor:{description:'Color of axis domain line.\n\n__Default value:__ `"gray"`.',type:"string"},domainDash:{description:"An array of alternating [stroke, space] lengths for dashed domain lines.",items:{type:"number"},type:"array"},domainDashOffset:{description:"The pixel offset at which to start drawing with the domain dash array.",type:"number"},domainWidth:{description:"Stroke width of axis domain line\n\n__Default value:__ `1`",type:"number"},format:{description:"The format specifier pattern for axis labels. Must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier.",type:"string"},grid:{description:"A boolean flag indicating if grid lines should be included as part of the axis.\n\n__Default value:__ `false`",type:"boolean"},gridCap:{description:'The stroke cap for the grid line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},gridColor:{description:"Color of grid lines.\n\n__Default value:__ `lightgray`",type:"string"},gridDash:{description:"An array of alternating [stroke, space] lengths for dashed grid mark lines.",items:{type:"number"},type:"array"},gridDashOffset:{description:"The pixel offset at which to start drawing with the grid mark dash array.",type:"number"},gridOpacity:{description:"The opacity of the grid lines.\n\n__Default value:__ `1`",type:"number"},gridWidth:{description:"Width of the grid lines.\n\n__Default value:__ `1`",type:"number"},labelAlign:{$ref:"#/definitions/Align",description:"Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation."},labelAngle:{description:"The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.",maximum:360,minimum:-360,type:"number"},labelBaseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`.'},labelColor:{description:"The color of the tick label, can be in hex color code or regular color name.",type:"string"},labelFont:{description:"The font of the tick label.",type:"string"},labelFontSize:{description:"The font size of the label, in pixels.",minimum:0,type:"number"},labelFontStyle:{description:"Font style of the title.",type:"string"},labelFontWeight:{description:"Font weight of axis tick labels.",type:"string"},labelLimit:{description:"Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`",type:"number"},labelPadding:{description:"The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`",type:"number"},labels:{description:"A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",type:"boolean"},maxExtent:{description:"The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.",type:"number"},minExtent:{description:"The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.",type:"number"},offset:{description:"The orthogonal offset in pixels by which to displace the axis from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/AxisOrient",description:'The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).\n\n__Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.'},tickCap:{description:'The stroke cap for the tick lines\' ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},tickColor:{description:`The color of the axis's tick. __Default value:__ \`"gray"\``,type:"string"},tickCount:{description:'A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of `2`, `5`, `10`) and lie within the underlying scale\'s range.',minimum:0,type:"number"},tickDash:{description:"An array of alternating [stroke, space] lengths for dashed tick mark lines.",items:{type:"number"},type:"array"},tickDashOffset:{description:"The pixel offset at which to start drawing with the tick mark dash array.",type:"number"},tickMinStep:{description:"The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.",type:"number"},tickSize:{description:"The size in pixels of axis ticks.\n\n__Default value:__ `5`",minimum:0,type:"number"},tickWidth:{description:"The width, in pixels, of ticks.\n\n__Default value:__ `1`",minimum:0,type:"number"},ticks:{description:"Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",type:"boolean"},title:{description:"A title for the axis (none by default).",type:"string"},titleColor:{description:"Color of the title, can be in hex color code or regular color name.",type:"string"},titleFont:{description:'Font of the title. (e.g., `"Helvetica Neue"`).',type:"string"},titleFontSize:{description:"Font size of the title.",minimum:0,type:"number"},titleFontStyle:{description:"Font style of the title.",type:"string"},titleFontWeight:{description:'Font weight of the title. This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).',type:"string"},titleOpacity:{description:"Opacity of the axis title.",type:"number"},titlePadding:{description:"The padding, in pixels, between title and axis.",type:"number"},values:{description:"Explicitly set the visible axis tick and label values.",items:{},type:"array"}},type:"object"},AxisGenomeData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:"Which channel's scale domain to use"},type:{const:"axisGenome",type:"string"}},required:["type","channel"],type:"object"},AxisOrient:{enum:["top","bottom","left","right"],type:"string"},AxisTicksData:{additionalProperties:!1,properties:{axis:{$ref:"#/definitions/Axis",description:"Optional axis properties"},channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:"Which channel's scale domain to listen to"},type:{const:"axisTicks",type:"string"}},required:["type","channel"],type:"object"},BamData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:`Which channel's scale domain to monitor. @@ -3196,13 +3243,13 @@ __Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updat __Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},type:{const:"bigbed",type:"string"},url:{description:"URL of the BigBed file.",type:"string"},windowSize:{description:"Size of each chunk when fetching the BigBed file. Data is only fetched when the length of the visible domain smaller than the window size.\n\n__Default value:__ `1000000`",type:"number"}},required:["type","url"],type:"object"},BigWigData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:`Which channel's scale domain to monitor. -__Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},pixelsPerBin:{description:"The approximate minimum width of each data bin, in pixels.\n\n__Default value:__ `2`",type:"number"},type:{const:"bigwig",type:"string"},url:{description:"URL of the BigWig file.",type:"string"}},required:["type","url"],type:"object"},ChannelWithScale:{anyOf:[{$ref:"#/definitions/PositionalChannel"},{const:"color",type:"string"},{const:"fill",type:"string"},{const:"stroke",type:"string"},{const:"opacity",type:"string"},{const:"fillOpacity",type:"string"},{const:"strokeOpacity",type:"string"},{const:"strokeWidth",type:"string"},{const:"size",type:"string"},{const:"shape",type:"string"},{const:"angle",type:"string"},{const:"dx",type:"string"},{const:"dy",type:"string"},{const:"sample",type:"string"}]},ChromPosDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},chrom:{$ref:"#/definitions/FieldName",description:"The field having the chromosome or contig."},offset:{description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/FieldName",description:"The field having an intra-chromosomal position."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +__Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},pixelsPerBin:{description:"The approximate minimum width of each data bin, in pixels.\n\n__Default value:__ `2`",type:"number"},type:{const:"bigwig",type:"string"},url:{description:"URL of the BigWig file.",type:"string"}},required:["type","url"],type:"object"},BindCheckbox:{additionalProperties:!1,properties:{debounce:{description:"If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.",type:"number"},element:{$ref:"#/definitions/Element",description:"An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view."},input:{const:"checkbox",type:"string"},name:{description:"By default, the parameter name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound parameter.",type:"string"}},required:["input"],type:"object"},BindRadioSelect:{additionalProperties:!1,properties:{debounce:{description:"If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.",type:"number"},element:{$ref:"#/definitions/Element",description:"An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view."},input:{enum:["radio","select"],type:"string"},labels:{description:"An array of label strings to represent the `options` values. If unspecified, the `options` value will be coerced to a string and used as the label.",items:{type:"string"},type:"array"},name:{description:"By default, the parameter name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound parameter.",type:"string"},options:{description:"An array of options to select from.",items:{},type:"array"}},required:["input","options"],type:"object"},BindRange:{additionalProperties:!1,properties:{debounce:{description:"If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.",type:"number"},element:{$ref:"#/definitions/Element",description:"An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view."},input:{const:"range",type:"string"},max:{description:"Sets the maximum slider value. Defaults to the larger of the signal value and `100`.",type:"number"},min:{description:"Sets the minimum slider value. Defaults to the smaller of the signal value and `0`.",type:"number"},name:{description:"By default, the parameter name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound parameter.",type:"string"},step:{description:"Sets the minimum slider increment. If undefined, the step size will be automatically determined based on the `min` and `max` values.",type:"number"}},required:["input"],type:"object"},Binding:{anyOf:[{$ref:"#/definitions/BindCheckbox"},{$ref:"#/definitions/BindRadioSelect"},{$ref:"#/definitions/BindRange"}]},ChannelWithScale:{anyOf:[{$ref:"#/definitions/PositionalChannel"},{const:"color",type:"string"},{const:"fill",type:"string"},{const:"stroke",type:"string"},{const:"opacity",type:"string"},{const:"fillOpacity",type:"string"},{const:"strokeOpacity",type:"string"},{const:"strokeWidth",type:"string"},{const:"size",type:"string"},{const:"shape",type:"string"},{const:"angle",type:"string"},{const:"dx",type:"string"},{const:"dy",type:"string"},{const:"sample",type:"string"}]},ChromPosDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},chrom:{$ref:"#/definitions/FieldName",description:"The field having the chromosome or contig."},offset:{description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/FieldName",description:"The field having an intra-chromosomal position."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{const:"locus",type:"string"}},required:["chrom","type"],type:"object"},ChromosomalLocus:{additionalProperties:!1,properties:{chrom:{description:'The name of the chromosome. For example: `"chr1"`, `"CHR1"`, or `"1"`.',type:"string"},pos:{description:"The zero-based position inside the chromosome or contig.",type:"number"}},required:["chrom"],type:"object"},CollectParams:{additionalProperties:!1,properties:{groupby:{description:"Arranges the data into consecutive batches based on the groups. This is mainly intended for internal use so that faceted data can be handled as batches.",items:{$ref:"#/definitions/Field"},type:"array"},sort:{$ref:"#/definitions/CompareParams",description:"The sort order."},type:{const:"collect",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},"ColorDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2C(string%7Cnull)%3E"},CompareParams:{additionalProperties:!1,properties:{field:{anyOf:[{items:{$ref:"#/definitions/Field"},type:"array"},{$ref:"#/definitions/Field"}],description:"The field(s) to sort by"},order:{anyOf:[{items:{$ref:"#/definitions/SortOrder"},type:"array"},{$ref:"#/definitions/SortOrder"}],description:'The order(s) to use: `"ascending"` (default), `"descending"`.'}},required:["field"],type:"object"},ComplexDomain:{description:"A complex domain that needs to be converted into a scalar domain before it is assigned to a scale.",items:{$ref:"#/definitions/ChromosomalLocus"},type:"array"},ConcatSpec:{additionalProperties:!1,properties:{baseUrl:{type:"string"},columns:{type:"number"},concat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["concat","columns"],type:"object"},Contig:{additionalProperties:!1,properties:{name:{type:"string"},size:{type:"number"}},required:["name","size"],type:"object"},CoverageParams:{additionalProperties:!1,properties:{as:{description:"The output field for the computed coverage.",type:"string"},asChrom:{description:"The output field for the chromosome.\n\n**Default:** Same as `chrom`",type:"string"},asEnd:{description:"The output field for the end coordinate.\n\n**Default:** Same as `end`",type:"string"},asStart:{description:"The output field for the start coordinate.\n\n**Default:** Same as `start`",type:"string"},chrom:{$ref:"#/definitions/Field",description:"An optional chromosome field that is passed through. TODO: groupby"},end:{$ref:"#/definitions/Field",description:"The field representing the end coordinate of the segment (exclusive)."},start:{$ref:"#/definitions/Field",description:"The field representing the start coordinate of the segment (inclusive)."},type:{const:"coverage",description:"The type of the transform to be applied",type:"string"},weight:{$ref:"#/definitions/Field",description:"A field representing an optional weight for the segment. Can be used with copy ratios, for example."}},required:["end","start","type"],type:"object"},CsvDataFormat:{additionalProperties:!1,properties:{parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},type:{description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',enum:["csv","tsv"],type:"string"}},type:"object"},Data:{anyOf:[{$ref:"#/definitions/DataSource"},{$ref:"#/definitions/Generator"}]},DataFormat:{anyOf:[{$ref:"#/definitions/CsvDataFormat"},{$ref:"#/definitions/DsvDataFormat"},{$ref:"#/definitions/JsonDataFormat"},{$ref:"#/definitions/OtherDataFormat"}]},DataSource:{anyOf:[{$ref:"#/definitions/UrlData"},{$ref:"#/definitions/InlineData"},{$ref:"#/definitions/NamedData"},{$ref:"#/definitions/DynamicCallbackData"},{$ref:"#/definitions/LazyData"}]},DsvDataFormat:{additionalProperties:!1,properties:{delimiter:{description:"The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.",maxLength:1,minLength:1,type:"string"},parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},type:{const:"dsv",description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',type:"string"}},required:["delimiter"],type:"object"},DynamicCallbackData:{additionalProperties:!1,properties:{dynamicCallbackSource:{description:"The View class has `getDynamicData()` methods that provides the data. This is intended for internal use.",type:"boolean"},format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"}},required:["dynamicCallbackSource"],type:"object"},DynamicOpacity:{additionalProperties:!1,description:"DynamicOpacity specifies a zoom-dependent behavior for view opacity. The opacity is interpolated between the specified stops.",properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel"},unitsPerPixel:{description:"Stops expressed as units (base pairs, for example) per pixel.",items:{type:"number"},type:"array"},values:{description:"Opacity values that match the given stops.",items:{type:"number"},type:"array"}},required:["unitsPerPixel","values"],type:"object"},Encoding:{additionalProperties:!1,properties:{angle:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Rotation angle of point and text marks."},color:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)."},dx:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E"},dy:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E"},facetIndex:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"For internal use"},fill:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Fill color of the marks.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified."},fillOpacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Fill opacity of the marks."},opacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Opacity of the marks."},sample:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"Facet identifier for interactive filtering, sorting, and grouping in the App."},search:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E"},semanticScore:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E"},shape:{$ref:"#/definitions/ShapeDef%3Cstring%3E",description:'Shape of the mark.\n\nFor `point` marks the supported values include:\n- plotting shapes: `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.\n- centered directional shape `"triangle"`'},size:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:'Size of the mark.\n- For `"point"` – the symbol size, or pixel area of the mark.\n- For `"text"` – the text\'s font size.'},stroke:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Stroke color of the marks.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified."},strokeOpacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Stroke opacity of the marks."},strokeWidth:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Stroke width of the marks."},text:{$ref:"#/definitions/TextDef%3Cstring%3E",description:"Text of the `text` mark."},uniqueId:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"For internal use"},x:{anyOf:[{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{const:"locus",type:"string"}},required:["chrom","type"],type:"object"},ChromosomalLocus:{additionalProperties:!1,properties:{chrom:{description:'The name of the chromosome. For example: `"chr1"`, `"CHR1"`, or `"1"`.',type:"string"},pos:{description:"The zero-based position inside the chromosome or contig.",type:"number"}},required:["chrom"],type:"object"},CollectParams:{additionalProperties:!1,properties:{groupby:{description:"Arranges the data into consecutive batches based on the groups. This is mainly intended for internal use so that faceted data can be handled as batches.",items:{$ref:"#/definitions/Field"},type:"array"},sort:{$ref:"#/definitions/CompareParams",description:"The sort order."},type:{const:"collect",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},"ColorDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2C(string%7Cnull)%3E"},CompareParams:{additionalProperties:!1,properties:{field:{anyOf:[{items:{$ref:"#/definitions/Field"},type:"array"},{$ref:"#/definitions/Field"}],description:"The field(s) to sort by"},order:{anyOf:[{items:{$ref:"#/definitions/SortOrder"},type:"array"},{$ref:"#/definitions/SortOrder"}],description:'The order(s) to use: `"ascending"` (default), `"descending"`.'}},required:["field"],type:"object"},ComplexDomain:{description:"A complex domain that needs to be converted into a scalar domain before it is assigned to a scale.",items:{$ref:"#/definitions/ChromosomalLocus"},type:"array"},ConcatSpec:{additionalProperties:!1,properties:{baseUrl:{type:"string"},columns:{type:"number"},concat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["concat","columns"],type:"object"},Contig:{additionalProperties:!1,properties:{name:{type:"string"},size:{type:"number"}},required:["name","size"],type:"object"},CoverageParams:{additionalProperties:!1,properties:{as:{description:"The output field for the computed coverage.",type:"string"},asChrom:{description:"The output field for the chromosome.\n\n**Default:** Same as `chrom`",type:"string"},asEnd:{description:"The output field for the end coordinate.\n\n**Default:** Same as `end`",type:"string"},asStart:{description:"The output field for the start coordinate.\n\n**Default:** Same as `start`",type:"string"},chrom:{$ref:"#/definitions/Field",description:"An optional chromosome field that is passed through. TODO: groupby"},end:{$ref:"#/definitions/Field",description:"The field representing the end coordinate of the segment (exclusive)."},start:{$ref:"#/definitions/Field",description:"The field representing the start coordinate of the segment (inclusive)."},type:{const:"coverage",description:"The type of the transform to be applied",type:"string"},weight:{$ref:"#/definitions/Field",description:"A field representing an optional weight for the segment. Can be used with copy ratios, for example."}},required:["end","start","type"],type:"object"},CsvDataFormat:{additionalProperties:!1,properties:{parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},type:{description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',enum:["csv","tsv"],type:"string"}},type:"object"},Data:{anyOf:[{$ref:"#/definitions/DataSource"},{$ref:"#/definitions/Generator"}]},DataFormat:{anyOf:[{$ref:"#/definitions/CsvDataFormat"},{$ref:"#/definitions/DsvDataFormat"},{$ref:"#/definitions/JsonDataFormat"},{$ref:"#/definitions/OtherDataFormat"}]},DataSource:{anyOf:[{$ref:"#/definitions/UrlData"},{$ref:"#/definitions/InlineData"},{$ref:"#/definitions/NamedData"},{$ref:"#/definitions/DynamicCallbackData"},{$ref:"#/definitions/LazyData"}]},DsvDataFormat:{additionalProperties:!1,properties:{delimiter:{description:"The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.",maxLength:1,minLength:1,type:"string"},parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},type:{const:"dsv",description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',type:"string"}},required:["delimiter"],type:"object"},DynamicCallbackData:{additionalProperties:!1,properties:{dynamicCallbackSource:{description:"The View class has `getDynamicData()` methods that provides the data. This is intended for internal use.",type:"boolean"},format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"}},required:["dynamicCallbackSource"],type:"object"},DynamicOpacity:{additionalProperties:!1,description:"DynamicOpacity specifies a zoom-dependent behavior for view opacity. The opacity is interpolated between the specified stops.",properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel"},unitsPerPixel:{description:"Stops expressed as units (base pairs, for example) per pixel.",items:{type:"number"},type:"array"},values:{description:"Opacity values that match the given stops.",items:{type:"number"},type:"array"}},required:["unitsPerPixel","values"],type:"object"},Element:{type:"string"},Encoding:{additionalProperties:!1,properties:{angle:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Rotation angle of point and text marks."},color:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)."},dx:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E"},dy:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E"},facetIndex:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"For internal use"},fill:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Fill color of the marks.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified."},fillOpacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Fill opacity of the marks."},opacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Opacity of the marks."},sample:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"Facet identifier for interactive filtering, sorting, and grouping in the App."},search:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E"},semanticScore:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E"},shape:{$ref:"#/definitions/ShapeDef%3Cstring%3E",description:'Shape of the mark.\n\nFor `point` marks the supported values include:\n- plotting shapes: `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.\n- centered directional shape `"triangle"`'},size:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:'Size of the mark.\n- For `"point"` – the symbol size, or pixel area of the mark.\n- For `"text"` – the text\'s font size.'},stroke:{$ref:"#/definitions/ColorDef%3Cstring%3E",description:"Stroke color of the marks.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified."},strokeOpacity:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Stroke opacity of the marks."},strokeWidth:{$ref:"#/definitions/NumericMarkPropDef%3Cstring%3E",description:"Stroke width of the marks."},text:{$ref:"#/definitions/TextDef%3Cstring%3E",description:"Text of the `text` mark."},uniqueId:{$ref:"#/definitions/FieldDefWithoutScale%3Cstring%3E",description:"For internal use"},x:{anyOf:[{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). @@ -3214,13 +3261,13 @@ If \`null\`, the scale will be [disabled and the data value will be directly enc __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{const:"locus",type:"string"}},required:["chrom","type"],type:"object"},{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{const:"locus",type:"string"}},required:["chrom","type"],type:"object"},{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"},type:{$ref:"#/definitions/Type"}},required:["expr","type"],type:"object"},{additionalProperties:!1,properties:{buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).',type:"number"}},required:["value"],type:"object"}],description:"X coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},x2:{$ref:"#/definitions/Position2Def%3Cstring%3E",description:"X2 coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},y:{$ref:"#/definitions/PositionDef%3Cstring%3E",description:"Y coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},y2:{$ref:"#/definitions/Position2Def%3Cstring%3E",description:"Y2 coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."}},type:"object"},ExprDef:{additionalProperties:!1,properties:{expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"}},required:["expr"],type:"object"},ExprRef:{additionalProperties:!1,properties:{expr:{description:"The expression string.",type:"string"}},required:["expr"],type:"object"},Field:{description:"The name of the field or a JavaScript expression for accessing nested properties. Dots and brackets in the field name must be escaped.",type:"string"},"FieldDefWithoutScale":{additionalProperties:!1,properties:{field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},FieldName:{type:"string"},FilterParams:{additionalProperties:!1,properties:{expr:{description:"An expression string. The data object is removed if the expression evaluates to false.",type:"string"},type:{const:"filter",description:"The type of the transform to be applied",type:"string"}},required:["expr","type"],type:"object"},FilterScoredLabelsParams:{additionalProperties:!1,properties:{channel:{description:'**Default:** `"x"`',enum:["x","y"],type:"string"},lane:{$ref:"#/definitions/Field",description:"An optional field representing element's lane, e.g., if transcripts are shown using a piled up layout."},padding:{description:"Padding (in pixels) around the element.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/Field",description:"The field representing element's position on the domain."},score:{$ref:"#/definitions/Field",description:"The field representing the score used for prioritization."},type:{const:"filterScoredLabels",description:"The type of the transform to be applied",type:"string"},width:{$ref:"#/definitions/Field",description:"The field representing element's width in pixels"}},required:["pos","score","type","width"],type:"object"},FlattenCompressedExonsParams:{additionalProperties:!1,properties:{as:{description:'Field names for the flattened exons.\n\n**Default:** `["exonStart", "exonEnd"]`',items:{type:"string"},maxItems:2,minItems:2,type:"array"},exons:{$ref:"#/definitions/Field",description:'The field containing the exons.\n\n**Default:** `"exons"`'},start:{$ref:"#/definitions/Field",description:'Start coordinate of the gene body.\n\n**Default:** `"start"`'},type:{const:"flattenCompressedExons",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},FlattenDelimitedParams:{additionalProperties:!1,properties:{as:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:`The output field name(s) for the flattened field. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"},type:{$ref:"#/definitions/Type"}},required:["expr","type"],type:"object"},{additionalProperties:!1,properties:{buildIndex:{description:"Builds and index for efficient rendering of subsets of the data. This setting is useful when rendering large amounts of data and often only a small subset of the data is visible. An example of such a situation is a scatter plot spanning the whole genome.\n\nThis setting implicitly sorts the data by the field assigned on the `x` channel.",type:"boolean"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"}],description:"X coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},x2:{$ref:"#/definitions/Position2Def%3Cstring%3E",description:"X2 coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},y:{$ref:"#/definitions/PositionDef%3Cstring%3E",description:"Y coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."},y2:{$ref:"#/definitions/Position2Def%3Cstring%3E",description:"Y2 coordinates of the marks.\n\nThe `value` of this channel can be a number between zero and one."}},type:"object"},ExprDef:{additionalProperties:!1,properties:{expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"}},required:["expr"],type:"object"},ExprRef:{additionalProperties:!1,properties:{expr:{description:"The expression string.",type:"string"}},required:["expr"],type:"object"},Field:{description:"The name of the field or a JavaScript expression for accessing nested properties. Dots and brackets in the field name must be escaped.",type:"string"},"FieldDefWithoutScale":{additionalProperties:!1,properties:{field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},FieldName:{type:"string"},FilterParams:{additionalProperties:!1,properties:{expr:{description:"An expression string. The data object is removed if the expression evaluates to false.",type:"string"},type:{const:"filter",description:"The type of the transform to be applied",type:"string"}},required:["expr","type"],type:"object"},FilterScoredLabelsParams:{additionalProperties:!1,properties:{channel:{description:'**Default:** `"x"`',enum:["x","y"],type:"string"},lane:{$ref:"#/definitions/Field",description:"An optional field representing element's lane, e.g., if transcripts are shown using a piled up layout."},padding:{description:"Padding (in pixels) around the element.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/Field",description:"The field representing element's position on the domain."},score:{$ref:"#/definitions/Field",description:"The field representing the score used for prioritization."},type:{const:"filterScoredLabels",description:"The type of the transform to be applied",type:"string"},width:{$ref:"#/definitions/Field",description:"The field representing element's width in pixels"}},required:["pos","score","type","width"],type:"object"},FlattenCompressedExonsParams:{additionalProperties:!1,properties:{as:{description:'Field names for the flattened exons.\n\n**Default:** `["exonStart", "exonEnd"]`',items:{type:"string"},maxItems:2,minItems:2,type:"array"},exons:{$ref:"#/definitions/Field",description:'The field containing the exons.\n\n**Default:** `"exons"`'},start:{$ref:"#/definitions/Field",description:'Start coordinate of the gene body.\n\n**Default:** `"start"`'},type:{const:"flattenCompressedExons",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},FlattenDelimitedParams:{additionalProperties:!1,properties:{as:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:`The output field name(s) for the flattened field. **Default:** the input fields.`},field:{anyOf:[{items:{$ref:"#/definitions/Field"},type:"array"},{$ref:"#/definitions/Field"}],description:"The field(s) to split and flatten"},separator:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:"Separator(s) used on the field(s) TODO: Rename to delimiter"},type:{const:"flattenDelimited",description:"The type of the transform to be applied",type:"string"}},required:["field","separator","type"],type:"object"},FlattenParams:{additionalProperties:!1,properties:{as:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:`The output field name(s) for the flattened field. @@ -3234,17 +3281,17 @@ __Default value:__ \`"gray"\``,type:"string"},tickCount:{description:'A desired __Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},indexUrl:{description:'Url of the tabix index file.\n\n__Default value:__ `url` + `".tbi"`.',type:"string"},type:{const:"gff3",type:"string"},url:{description:"Url of the bgzip compressed file.",type:"string"},windowSize:{description:"Size of each chunk when fetching the Tabix file. Data is only fetched when the length of the visible domain smaller than the window size.\n\n__Default value:__ `30000000`",type:"number"}},required:["type","url"],type:"object"},HConcatSpec:{additionalProperties:!1,properties:{baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},hconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["hconcat"],type:"object"},HandledTooltip:{additionalProperties:!1,properties:{handler:{type:"string"},params:{type:"object"}},required:["handler"],type:"object"},IdentifierParams:{additionalProperties:!1,properties:{as:{description:'**Default:** `"_uniqueId"`',type:"string"},type:{const:"identifier",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},ImportConfig:{additionalProperties:!1,properties:{name:{type:"string"},params:{type:"object"},url:{type:"string"}},type:"object"},ImportSpec:{additionalProperties:!1,properties:{import:{$ref:"#/definitions/ImportConfig"}},required:["import"],type:"object"},IndexedFastaData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:`Which channel's scale domain to monitor. -__Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},indexUrl:{description:'URL of the index file.\n\n__Default value:__ `url` + `".fai"`.',type:"string"},type:{const:"indexedFasta",type:"string"},url:{description:"URL of the fasta file.",type:"string"},windowSize:{description:"Size of each chunk when fetching the fasta file. Data is only fetched when the length of the visible domain smaller than the window size.\n\n__Default value:__ `7000`",type:"number"}},required:["type","url"],type:"object"},InlineData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},values:{$ref:"#/definitions/InlineDataset",description:"The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type."}},required:["values"],type:"object"},InlineDataset:{anyOf:[{items:{type:"number"},type:"array"},{items:{type:"string"},type:"array"},{items:{type:"boolean"},type:"array"},{items:{type:"object"},type:"array"},{type:"string"},{type:"object"}]},JsonDataFormat:{additionalProperties:!1,properties:{parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},property:{description:'The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example `"property": "values.features"` is equivalent to retrieving `json.values.features` from the loaded JSON object.',type:"string"},type:{const:"json",description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',type:"string"}},type:"object"},LayerSpec:{additionalProperties:!1,properties:{aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},layer:{items:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}]},type:"array"},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["layer"],type:"object"},LazyData:{additionalProperties:!1,properties:{lazy:{$ref:"#/definitions/LazyDataParams"}},required:["lazy"],type:"object"},LazyDataParams:{anyOf:[{$ref:"#/definitions/AxisTicksData"},{$ref:"#/definitions/AxisGenomeData"},{$ref:"#/definitions/IndexedFastaData"},{$ref:"#/definitions/BigWigData"},{$ref:"#/definitions/BigBedData"},{$ref:"#/definitions/BamData"},{$ref:"#/definitions/Gff3Data"}]},LinearizeGenomicCoordinateParams:{additionalProperties:!1,properties:{as:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"The output field or fields for linearized coordinates."},channel:{description:'Get the genome assembly from the scale of the channel.\n\n**Default:** `"x"`',enum:["x","y"],type:"string"},chrom:{$ref:"#/definitions/Field",description:"The chromosome/contig field"},offset:{anyOf:[{type:"number"},{items:{type:"number"},type:"array"}],description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`"},pos:{anyOf:[{$ref:"#/definitions/Field"},{items:{$ref:"#/definitions/Field"},type:"array"}],description:"The field or fields that contain intra-chromosomal positions"},type:{const:"linearizeGenomicCoordinate",description:"The type of the transform to be applied",type:"string"}},required:["as","chrom","pos","type"],type:"object"},MarkConfigAndType:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/Align",description:'The horizontal alignment of the text. One of `"left"`, `"center"`, or `"right"`.\n\n**Default value:** `"left"`'},angle:{description:"The rotation angle in degrees.\n\n**Default value:** `0`",type:"number"},arcFadingDistance:{anyOf:[{items:{type:"number"},maxItems:2,minItems:2,type:"array"},{const:!1,type:"boolean"},{$ref:"#/definitions/ExprRef"}],description:"The range of the `\"arc\"` shape's fading distance in pixels. This property allows for making the arc's opacity fade out as it extends away from the chord. The fading distance is interpolated from one to zero between the interval defined by this property. Both `false` and `[0, 0]` disable fading.\n\n**Default value:** `false`"},arcHeightFactor:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'Scaling factor for the `"arc`" shape\'s height. The default value `1.0` produces roughly circular arcs.\n\n**Default value:** `1.0`'},baseline:{$ref:"#/definitions/Baseline",description:'The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.\n\n**Default value:** `"bottom"`'},clampApex:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ExprRef"}],description:'Whether the apex of the `"dome"` shape is clamped to the viewport edge. When over a half of the dome is located outside the viewport, clamping allows for more accurate reading of the value encoded by the apex\' position.\n\n**Default value:** `false`'},clip:{anyOf:[{type:"boolean"},{const:"never",type:"string"}],description:"If true, the mark is clipped to the UnitView's rectangle. By default, clipping is enabled for marks that have zoomable positional scales."},color:{type:"string"},cornerRadius:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the rounded corners.\n\n**Default value:** `0`"},cornerRadiusBottomLeft:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the bottom left rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusBottomRight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the bottom right rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusTopLeft:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the top left rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusTopRight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the top right rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},dx:{description:"The horizontal offset between the text and its anchor point, in pixels. Applied after the rotation by `angle`.",type:"number"},dy:{description:"The vertical offset between the text and its anchor point, in pixels. Applied after the rotation by `angle`.",type:"number"},fill:{description:"The fill color",type:"string"},fillGradientStrength:{description:"Gradient strength controls the amount of the gradient eye-candy effect in the fill color. Valid values are between 0 and 1.\n\n**Default value:** `0`",type:"number"},fillOpacity:{description:"The fill opacity. Value between [0, 1].",type:"number"},filled:{description:"Whether the `color` represents the `fill` color (`true`) or the `stroke` color (`false`).",type:"boolean"},fitToBand:{description:'If true, sets the secondary positional channel that allows the text to be squeezed (see the `squeeze` property). Can be used when: 1) `"band"`, `"index"`, or `"locus"` scale is being used and 2) only the primary positional channel is specified.\n\n**Default value:** `false`',type:"boolean"},flushX:{description:"If true, the text is kept inside the viewport when the range of `x` and `x2` intersect the viewport.",type:"boolean"},flushY:{description:"If true, the text is kept inside the viewport when the range of `y` and `y2` intersect the viewport.",type:"boolean"},font:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},fontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},fontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},geometricZoomBound:{description:"Enables geometric zooming. The value is the base two logarithmic zoom level where the maximum point size is reached.\n\n**Default value:** `0`",type:"number"},inwardStroke:{description:"Should the stroke only grow inwards, e.g, the diameter/outline is not affected by the stroke width. Thus, a point that has a zero size has no visible stroke. This allows strokes to be used with geometric zoom, etc.\n\n**Default value:** `false`",type:"boolean"},linkShape:{anyOf:[{const:"arc",type:"string"},{const:"diagonal",type:"string"},{const:"line",type:"string"},{const:"dome",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The shape of the link path. Either `"arc"`, `"diagonal"`, `"line"`, or `"dome"`.\n\n**Default value:** `"arc"`'},logoLetters:{description:"Stretch letters so that they can be used with [sequence logos](https://en.wikipedia.org/wiki/Sequence_logo), etc...",type:"boolean"},maxChordLength:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'The maximum length of `"arc"` shape\'s chord in pixels. The chord is the line segment between the two points that define the arc. Limiting the chord length serves two purposes when zooming in close enough: 1) it prevents the arc from becoming a straight line and 2) it mitigates the limited precision of floating point numbers in arc rendering.\n\n**Default value:** `50000`'},minArcHeight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'The minimum height of an `"arc"` shape. Makes very short links more clearly visible.\n\n**Default value:** `1.5`'},minBufferSize:{description:"Minimum size for WebGL buffers (number of data items). Allows for using `bufferSubData()` to update graphics.\n\nThis property is intended for internal use.",type:"number"},minHeight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum height of a rectangle in pixels. The property clamps rectangles' heights.\n\n**Default value:** `0`"},minLength:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum length of the rule in pixels. Use this property to ensure that very short ranged rules remain visible even when the user zooms out.\n\n**Default value:** `0`"},minOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Clamps the minimum size-dependent opacity. The property does not affect the `opacity` channel. Valid values are between `0` and `1`.\n\nWhen a rectangle would be smaller than what is specified in `minHeight` and `minWidth`, it is faded out proportionally. Example: a rectangle would be rendered as one pixel wide, but `minWidth` clamps it to five pixels. The rectangle is actually rendered as five pixels wide, but its opacity is multiplied by 0.2. With this setting, you can limit the factor to, for example, 0.5 to keep the rectangles more clearly visible.\n\n**Default value:** `0`"},minPickingSize:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum stroke width of the links when pointing with the mouse cursor. Allows making very thin links easier to point at.\n\n**Default value:** `3.0`"},minWidth:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:`The minimum width of a rectangle in pixels. The property clamps rectangles' widths when the viewport is zoomed out. +__Default value:__ \`"x"\``},debounce:{description:"Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around.\n\n__Default value:__ `200`",type:"number"},debounceMode:{description:'The debounce mode for data updates. If set to `"domain"`, domain change events (panning and zooming) will be debounced. If set to `"window"`, the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the `"window"` is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency.\n\n__Default value:__ `"window"`',enum:["domain","window"],type:"string"},indexUrl:{description:'URL of the index file.\n\n__Default value:__ `url` + `".fai"`.',type:"string"},type:{const:"indexedFasta",type:"string"},url:{description:"URL of the fasta file.",type:"string"},windowSize:{description:"Size of each chunk when fetching the fasta file. Data is only fetched when the length of the visible domain smaller than the window size.\n\n__Default value:__ `7000`",type:"number"}},required:["type","url"],type:"object"},InlineData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},values:{$ref:"#/definitions/InlineDataset",description:"The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type."}},required:["values"],type:"object"},InlineDataset:{anyOf:[{items:{type:"number"},type:"array"},{items:{type:"string"},type:"array"},{items:{type:"boolean"},type:"array"},{items:{type:"object"},type:"array"},{type:"string"},{type:"object"}]},JsonDataFormat:{additionalProperties:!1,properties:{parse:{anyOf:[{$ref:"#/definitions/Parse"},{type:"null"}],description:'If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)). For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.\n\nFor `"date"`, we parse data based using Javascript\'s [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: "date:\'%m%d%Y\'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:\'%m%d%Y\'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)'},property:{description:'The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example `"property": "values.features"` is equivalent to retrieving `json.values.features` from the loaded JSON object.',type:"string"},type:{const:"json",description:'Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `"json"` will be used by default.',type:"string"}},type:"object"},LayerSpec:{additionalProperties:!1,properties:{aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},layer:{items:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}]},type:"array"},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["layer"],type:"object"},LazyData:{additionalProperties:!1,properties:{lazy:{$ref:"#/definitions/LazyDataParams"}},required:["lazy"],type:"object"},LazyDataParams:{anyOf:[{$ref:"#/definitions/AxisTicksData"},{$ref:"#/definitions/AxisGenomeData"},{$ref:"#/definitions/IndexedFastaData"},{$ref:"#/definitions/BigWigData"},{$ref:"#/definitions/BigBedData"},{$ref:"#/definitions/BamData"},{$ref:"#/definitions/Gff3Data"}]},LinearizeGenomicCoordinateParams:{additionalProperties:!1,properties:{as:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"The output field or fields for linearized coordinates."},channel:{description:'Get the genome assembly from the scale of the channel.\n\n**Default:** `"x"`',enum:["x","y"],type:"string"},chrom:{$ref:"#/definitions/Field",description:"The chromosome/contig field"},offset:{anyOf:[{type:"number"},{items:{type:"number"},type:"array"}],description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`"},pos:{anyOf:[{$ref:"#/definitions/Field"},{items:{$ref:"#/definitions/Field"},type:"array"}],description:"The field or fields that contain intra-chromosomal positions"},type:{const:"linearizeGenomicCoordinate",description:"The type of the transform to be applied",type:"string"}},required:["as","chrom","pos","type"],type:"object"},MarkConfigAndType:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/Align",description:'The horizontal alignment of the text. One of `"left"`, `"center"`, or `"right"`.\n\n**Default value:** `"left"`'},angle:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The rotation angle in degrees.\n\n**Default value:** `0`"},arcFadingDistance:{anyOf:[{items:{type:"number"},maxItems:2,minItems:2,type:"array"},{const:!1,type:"boolean"},{$ref:"#/definitions/ExprRef"}],description:"The range of the `\"arc\"` shape's fading distance in pixels. This property allows for making the arc's opacity fade out as it extends away from the chord. The fading distance is interpolated from one to zero between the interval defined by this property. Both `false` and `[0, 0]` disable fading.\n\n**Default value:** `false`"},arcHeightFactor:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'Scaling factor for the `"arc`" shape\'s height. The default value `1.0` produces roughly circular arcs.\n\n**Default value:** `1.0`'},baseline:{$ref:"#/definitions/Baseline",description:'The vertical alignment of the text. One of `"top"`, `"middle"`, `"bottom"`.\n\n**Default value:** `"bottom"`'},clampApex:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ExprRef"}],description:'Whether the apex of the `"dome"` shape is clamped to the viewport edge. When over a half of the dome is located outside the viewport, clamping allows for more accurate reading of the value encoded by the apex\' position.\n\n**Default value:** `false`'},clip:{anyOf:[{type:"boolean"},{const:"never",type:"string"}],description:"If true, the mark is clipped to the UnitView's rectangle. By default, clipping is enabled for marks that have zoomable positional scales."},color:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}]},cornerRadius:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the rounded corners.\n\n**Default value:** `0`"},cornerRadiusBottomLeft:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the bottom left rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusBottomRight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the bottom right rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusTopLeft:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the top left rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},cornerRadiusTopRight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Radius of the top right rounded corner. Has higher precedence than `cornerRadius`.\n\n**Default value:** (None)"},dx:{description:"The horizontal offset between the text and its anchor point, in pixels. Applied after the rotation by `angle`.",type:"number"},dy:{description:"The vertical offset between the text and its anchor point, in pixels. Applied after the rotation by `angle`.",type:"number"},fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color"},fillGradientStrength:{description:"Gradient strength controls the amount of the gradient eye-candy effect in the fill color. Valid values are between 0 and 1.\n\n**Default value:** `0`",type:"number"},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between [0, 1]."},filled:{description:"Whether the `color` represents the `fill` color (`true`) or the `stroke` color (`false`).",type:"boolean"},fitToBand:{description:'If true, sets the secondary positional channel that allows the text to be squeezed (see the `squeeze` property). Can be used when: 1) `"band"`, `"index"`, or `"locus"` scale is being used and 2) only the primary positional channel is specified.\n\n**Default value:** `false`',type:"boolean"},flushX:{description:"If true, the text is kept inside the viewport when the range of `x` and `x2` intersect the viewport.",type:"boolean"},flushY:{description:"If true, the text is kept inside the viewport when the range of `y` and `y2` intersect the viewport.",type:"boolean"},font:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},fontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},fontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},geometricZoomBound:{description:"Enables geometric zooming. The value is the base two logarithmic zoom level where the maximum point size is reached.\n\n**Default value:** `0`",type:"number"},inwardStroke:{description:"Should the stroke only grow inwards, e.g, the diameter/outline is not affected by the stroke width. Thus, a point that has a zero size has no visible stroke. This allows strokes to be used with geometric zoom, etc.\n\n**Default value:** `false`",type:"boolean"},linkShape:{anyOf:[{const:"arc",type:"string"},{const:"diagonal",type:"string"},{const:"line",type:"string"},{const:"dome",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The shape of the link path. Either `"arc"`, `"diagonal"`, `"line"`, or `"dome"`.\n\n**Default value:** `"arc"`'},logoLetters:{description:"Stretch letters so that they can be used with [sequence logos](https://en.wikipedia.org/wiki/Sequence_logo), etc...",type:"boolean"},maxChordLength:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'The maximum length of `"arc"` shape\'s chord in pixels. The chord is the line segment between the two points that define the arc. Limiting the chord length serves two purposes when zooming in close enough: 1) it prevents the arc from becoming a straight line and 2) it mitigates the limited precision of floating point numbers in arc rendering.\n\n**Default value:** `50000`'},minArcHeight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'The minimum height of an `"arc"` shape. Makes very short links more clearly visible.\n\n**Default value:** `1.5`'},minBufferSize:{description:"Minimum size for WebGL buffers (number of data items). Allows for using `bufferSubData()` to update graphics.\n\nThis property is intended for internal use.",type:"number"},minHeight:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum height of a rectangle in pixels. The property clamps rectangles' heights.\n\n**Default value:** `0`"},minLength:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum length of the rule in pixels. Use this property to ensure that very short ranged rules remain visible even when the user zooms out.\n\n**Default value:** `0`"},minOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"Clamps the minimum size-dependent opacity. The property does not affect the `opacity` channel. Valid values are between `0` and `1`.\n\nWhen a rectangle would be smaller than what is specified in `minHeight` and `minWidth`, it is faded out proportionally. Example: a rectangle would be rendered as one pixel wide, but `minWidth` clamps it to five pixels. The rectangle is actually rendered as five pixels wide, but its opacity is multiplied by 0.2. With this setting, you can limit the factor to, for example, 0.5 to keep the rectangles more clearly visible.\n\n**Default value:** `0`"},minPickingSize:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The minimum stroke width of the links when pointing with the mouse cursor. Allows making very thin links easier to point at.\n\n**Default value:** `3.0`"},minWidth:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:`The minimum width of a rectangle in pixels. The property clamps rectangles' widths when the viewport is zoomed out. This property also reduces flickering of very narrow rectangles when zooming. The value should generally be at least one. -**Default value:** \`1\``},opacity:{type:"number"},orient:{anyOf:[{const:"vertical",type:"string"},{const:"horizontal",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The orientation of the link path. Either `"vertical"` or `"horizontal"`. Only applies to diagonal links.\n\n**Default value:** `"vertical"`'},paddingX:{description:"The horizontal padding, in pixels, when the `x2` channel is used for ranged text.\n\n**Default value:** `0`",type:"number"},paddingY:{description:"The vertical padding, in pixels, when the `y2` channel is used for ranged text.\n\n**Default value:** `0`",type:"number"},sampleFacetPadding:{description:"Padding between sample facet's upper/lower edge and the maximum point size. This property controls how tightly points are squeezed when facet's height is smaller than the maximum point size. The unit is a proportion of facet's height. The value must be between `0` and `0.5`. This property has no effect when sample faceting is not used.\n\n**Default value:** `0.1`",type:"number"},segments:{description:"The number of segments in the bézier curve. Affects the rendering quality and performance. Use a higher value for a smoother curve.\n\n**Default value:* `101`",type:"number"},semanticZoomFraction:{description:"TODO\n\n**Default value:** `0.02`",type:"number"},shape:{description:'One of `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.\n\n**Default value:** `"circle"`',type:"string"},size:{description:"The font size in pixels.\n\n**Default value:** `11`",type:"number"},squeeze:{description:"If the `squeeze` property is true and secondary positional channels (`x2` and/or `y2`) are used, the text is scaled to fit mark's width and/or height.\n\n**Default value:** `true`",type:"boolean"},stroke:{description:"The stroke color",type:"string"},strokeCap:{anyOf:[{const:"butt",type:"string"},{const:"square",type:"string"},{const:"round",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The style of stroke ends. Available choices: `"butt"`, `"round`", and `"square"`.\n\n**Default value:** `"butt"`'},strokeDash:{description:"An array of of alternating stroke and gap lengths or `null` for solid strokes.\n\n**Default value:** `null`",items:{type:"number"},type:"array"},strokeDashOffset:{description:"An offset for the stroke dash pattern.\n\n**Default value:** `0`",type:"number"},strokeOpacity:{description:"The stroke opacity. Value between [0, 1].",type:"number"},strokeWidth:{description:"The stroke width in pixels.",type:"number"},text:{$ref:"#/definitions/Scalar",description:'The text to display. The format of numeric data can be customized by setting a [format specifier](https://github.com/d3/d3-format#locale_format) to channel definition\'s `format` property.\n\n**Default value:** `""`'},tooltip:{$ref:"#/definitions/Tooltip",description:"TODO"},type:{$ref:"#/definitions/MarkType"},viewportEdgeFadeDistanceBottom:{type:"number"},viewportEdgeFadeDistanceLeft:{type:"number"},viewportEdgeFadeDistanceRight:{type:"number"},viewportEdgeFadeDistanceTop:{type:"number"},viewportEdgeFadeWidthBottom:{type:"number"},viewportEdgeFadeWidthLeft:{type:"number"},viewportEdgeFadeWidthRight:{type:"number"},viewportEdgeFadeWidthTop:{type:"number"},x:{type:"number"},x2:{type:"number"},xOffset:{description:"Offsets of the `x` and `x2` coordinates in pixels. The offset is applied after the viewport scaling and translation.\n\n**Default value:** `0`",type:"number"},y:{type:"number"},y2:{type:"number"},yOffset:{description:"Offsets of the `y` and `y2` coordinates in pixels. The offset is applied after the viewport scaling and translation.\n\n**Default value:** `0`",type:"number"}},required:["type"],type:"object"},"MarkPropDatumDef":{additionalProperties:!1,properties:{datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +**Default value:** \`1\``},opacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}]},orient:{anyOf:[{const:"vertical",type:"string"},{const:"horizontal",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The orientation of the link path. Either `"vertical"` or `"horizontal"`. Only applies to diagonal links.\n\n**Default value:** `"vertical"`'},paddingX:{description:"The horizontal padding, in pixels, when the `x2` channel is used for ranged text.\n\n**Default value:** `0`",type:"number"},paddingY:{description:"The vertical padding, in pixels, when the `y2` channel is used for ranged text.\n\n**Default value:** `0`",type:"number"},sampleFacetPadding:{description:"Padding between sample facet's upper/lower edge and the maximum point size. This property controls how tightly points are squeezed when facet's height is smaller than the maximum point size. The unit is a proportion of facet's height. The value must be between `0` and `0.5`. This property has no effect when sample faceting is not used.\n\n**Default value:** `0.1`",type:"number"},segments:{description:"The number of segments in the bézier curve. Affects the rendering quality and performance. Use a higher value for a smoother curve.\n\n**Default value:* `101`",type:"number"},semanticZoomFraction:{description:"TODO\n\n**Default value:** `0.02`",type:"number"},shape:{description:'One of `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.\n\n**Default value:** `"circle"`',type:"string"},size:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The font size in pixels.\n\n**Default value:** `11`"},squeeze:{description:"If the `squeeze` property is true and secondary positional channels (`x2` and/or `y2`) are used, the text is scaled to fit mark's width and/or height.\n\n**Default value:** `true`",type:"boolean"},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeCap:{anyOf:[{const:"butt",type:"string"},{const:"square",type:"string"},{const:"round",type:"string"},{$ref:"#/definitions/ExprRef"}],description:'The style of stroke ends. Available choices: `"butt"`, `"round`", and `"square"`.\n\n**Default value:** `"butt"`'},strokeDash:{description:"An array of of alternating stroke and gap lengths or `null` for solid strokes.\n\n**Default value:** `null`",items:{type:"number"},type:"array"},strokeDashOffset:{description:"An offset for the stroke dash pattern.\n\n**Default value:** `0`",type:"number"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between [0, 1]."},strokeWidth:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke width in pixels."},text:{$ref:"#/definitions/Scalar",description:'The text to display. The format of numeric data can be customized by setting a [format specifier](https://github.com/d3/d3-format#locale_format) to channel definition\'s `format` property.\n\n**Default value:** `""`'},tooltip:{$ref:"#/definitions/Tooltip",description:"TODO"},type:{$ref:"#/definitions/MarkType"},viewportEdgeFadeDistanceBottom:{type:"number"},viewportEdgeFadeDistanceLeft:{type:"number"},viewportEdgeFadeDistanceRight:{type:"number"},viewportEdgeFadeDistanceTop:{type:"number"},viewportEdgeFadeWidthBottom:{type:"number"},viewportEdgeFadeWidthLeft:{type:"number"},viewportEdgeFadeWidthRight:{type:"number"},viewportEdgeFadeWidthTop:{type:"number"},x:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}]},x2:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}]},xOffset:{description:"Offsets of the `x` and `x2` coordinates in pixels. The offset is applied after the viewport scaling and translation.\n\n**Default value:** `0`",type:"number"},y:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}]},y2:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}]},yOffset:{description:"Offsets of the `y` and `y2` coordinates in pixels. The offset is applied after the viewport scaling and translation.\n\n**Default value:** `0`",type:"number"}},required:["type"],type:"object"},"MarkPropDatumDef":{additionalProperties:!1,properties:{datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},"MarkPropDatumDef":{additionalProperties:!1,properties:{datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},"MarkPropDatumDef":{additionalProperties:!1,properties:{datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). @@ -3268,7 +3315,7 @@ If \`null\`, the scale will be [disabled and the data value will be directly enc __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/TypeForShape"}},required:["type"],type:"object"},"MarkPropFieldOrDatumOrExprDef":{anyOf:[{$ref:"#/definitions/MarkPropFieldDef%3Cstring%2CType%3E"},{$ref:"#/definitions/MarkPropDatumDef%3CType%3E"},{$ref:"#/definitions/MarkPropExprDef"}]},"MarkPropFieldOrDatumOrExprDef":{anyOf:[{$ref:"#/definitions/MarkPropFieldDef%3Cstring%2CTypeForShape%3E"},{$ref:"#/definitions/MarkPropDatumDef%3CTypeForShape%3E"},{$ref:"#/definitions/MarkPropExprDef"}]},MarkType:{enum:["rect","point","rule","text","link"],type:"string"},MeasureTextParams:{additionalProperties:!1,properties:{as:{type:"string"},field:{$ref:"#/definitions/Field"},fontSize:{type:"number"},type:{const:"measureText",description:"The type of the transform to be applied",type:"string"}},required:["as","field","fontSize","type"],type:"object"},MergeFacetsParams:{additionalProperties:!1,properties:{type:{const:"mergeFacets",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},NamedData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"}},required:["name"],type:"object"},NumericDomain:{items:{type:"number"},type:"array"},"NumericMarkPropDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2Cnumber%3E"},NumericValueDef:{$ref:"#/definitions/ValueDef%3Cnumber%3E"},OtherDataFormat:{additionalProperties:!1,description:'Other data format, such as `"fasta"`',properties:{type:{type:"string"}},required:["type"],type:"object"},PaddingConfig:{anyOf:[{$ref:"#/definitions/Paddings"},{type:"number"}]},Paddings:{additionalProperties:!1,properties:{bottom:{type:"number"},left:{type:"number"},right:{type:"number"},top:{type:"number"}},type:"object"},Parse:{additionalProperties:{$ref:"#/definitions/ParseValue"},type:"object"},ParseValue:{anyOf:[{type:"null"},{type:"string"},{const:"string",type:"string"},{const:"boolean",type:"string"},{const:"date",type:"string"},{const:"number",type:"string"}]},PileupParams:{additionalProperties:!1,properties:{as:{description:'The output field name for the computed lane.\n\n**Default:** `"lane"`.',type:"string"},end:{$ref:"#/definitions/Field",description:"The field representing the end coordinate of the segment (exclusive)."},preference:{$ref:"#/definitions/Field",description:"An optional field indicating the preferred lane. Use together with the `preferredOrder` property."},preferredOrder:{anyOf:[{items:{type:"string"},type:"array"},{items:{type:"number"},type:"array"},{items:{type:"boolean"},type:"array"}],description:"The order of the lane preferences. The first element contains the value that should place the segment on the first lane and so forth. If the preferred lane is occupied, the first available lane is taken."},spacing:{description:"The spacing between adjacent segments on the same lane in coordinate units.\n\n**Default:** `1`.",type:"number"},start:{$ref:"#/definitions/Field",description:"The field representing the start coordinate of the segment (inclusive)."},type:{const:"pileup",description:"The type of the transform to be applied",type:"string"}},required:["end","start","type"],type:"object"},"Position2Def":{anyOf:[{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},{$ref:"#/definitions/SecondaryChromPosDef"},{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"}},required:["expr"],type:"object"},{$ref:"#/definitions/PositionValueDef"}]},PositionDatumDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/TypeForShape"}},required:["type"],type:"object"},"MarkPropFieldOrDatumOrExprDef":{anyOf:[{$ref:"#/definitions/MarkPropFieldDef%3Cstring%2CType%3E"},{$ref:"#/definitions/MarkPropDatumDef%3CType%3E"},{$ref:"#/definitions/MarkPropExprDef"}]},"MarkPropFieldOrDatumOrExprDef":{anyOf:[{$ref:"#/definitions/MarkPropFieldDef%3Cstring%2CTypeForShape%3E"},{$ref:"#/definitions/MarkPropDatumDef%3CTypeForShape%3E"},{$ref:"#/definitions/MarkPropExprDef"}]},MarkType:{enum:["rect","point","rule","text","link"],type:"string"},MeasureTextParams:{additionalProperties:!1,properties:{as:{type:"string"},field:{$ref:"#/definitions/Field"},fontSize:{type:"number"},type:{const:"measureText",description:"The type of the transform to be applied",type:"string"}},required:["as","field","fontSize","type"],type:"object"},MergeFacetsParams:{additionalProperties:!1,properties:{type:{const:"mergeFacets",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},NamedData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"}},required:["name"],type:"object"},NumericDomain:{items:{type:"number"},type:"array"},"NumericMarkPropDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2Cnumber%3E"},NumericValueDef:{$ref:"#/definitions/ValueDef%3Cnumber%3E"},OtherDataFormat:{additionalProperties:!1,description:'Other data format, such as `"fasta"`',properties:{type:{type:"string"}},required:["type"],type:"object"},PaddingConfig:{anyOf:[{$ref:"#/definitions/Paddings"},{type:"number"}]},Paddings:{additionalProperties:!1,properties:{bottom:{type:"number"},left:{type:"number"},right:{type:"number"},top:{type:"number"}},type:"object"},Parse:{additionalProperties:{$ref:"#/definitions/ParseValue"},type:"object"},ParseValue:{anyOf:[{type:"null"},{type:"string"},{const:"string",type:"string"},{const:"boolean",type:"string"},{const:"date",type:"string"},{const:"number",type:"string"}]},PileupParams:{additionalProperties:!1,properties:{as:{description:'The output field name for the computed lane.\n\n**Default:** `"lane"`.',type:"string"},end:{$ref:"#/definitions/Field",description:"The field representing the end coordinate of the segment (exclusive)."},preference:{$ref:"#/definitions/Field",description:"An optional field indicating the preferred lane. Use together with the `preferredOrder` property."},preferredOrder:{anyOf:[{items:{type:"string"},type:"array"},{items:{type:"number"},type:"array"},{items:{type:"boolean"},type:"array"}],description:"The order of the lane preferences. The first element contains the value that should place the segment on the first lane and so forth. If the preferred lane is occupied, the first available lane is taken."},spacing:{description:"The spacing between adjacent segments on the same lane in coordinate units.\n\n**Default:** `1`.",type:"number"},start:{$ref:"#/definitions/Field",description:"The field representing the start coordinate of the segment (inclusive)."},type:{const:"pileup",description:"The type of the transform to be applied",type:"string"}},required:["end","start","type"],type:"object"},"Position2Def":{anyOf:[{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},field:{description:'__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo[\'bar\']"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `"a\\\\.b"` and `"a\\\\[0\\\\]"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`.',type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},{$ref:"#/definitions/SecondaryChromPosDef"},{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},{additionalProperties:!1,properties:{band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},expr:{description:"An expression. Properties of the data can be accessed through the `datum` object.",type:"string"}},required:["expr"],type:"object"},{$ref:"#/definitions/PositionValueDef"}]},PositionDatumDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},resolutionChannel:{$ref:"#/definitions/ChannelWithScale",description:"An alternative channel for scale resolution.\n\nThis is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances."},scale:{anyOf:[{$ref:"#/definitions/Scale"},{type:"null"}],description:`An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If \`null\`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable). @@ -3280,11 +3327,23 @@ If \`null\`, the scale will be [disabled and the data value will be directly enc __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied. -__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},PositionValueDef:{$ref:"#/definitions/NumericValueDef"},PositionalChannel:{anyOf:[{$ref:"#/definitions/PrimaryPositionalChannel"},{$ref:"#/definitions/SecondaryPositionalChannel"}]},PrimaryPositionalChannel:{enum:["x","y"],type:"string"},ProjectParams:{additionalProperties:!1,properties:{as:{description:"New names for the projected fields. If omitted, the names of the source fields are used.",items:{type:"string"},type:"array"},fields:{description:"The fields to be projected.",items:{$ref:"#/definitions/Field"},type:"array"},type:{const:"project",description:"The type of the transform to be applied",type:"string"}},required:["fields","type"],type:"object"},RegexExtractParams:{additionalProperties:!1,properties:{as:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"The new field or an array of fields where the extracted values are written."},field:{$ref:"#/definitions/Field",description:"The source field"},regex:{description:'A valid JavaScript regular expression with at least one group. For example: `"^Sample(\\\\d+)$"`.\n\nRead more at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions',type:"string"},skipInvalidInput:{description:"Do not complain about invalid input. Just skip it and leave the new fields undefined on the affected datum.\n\n**Default:** `false`",type:"boolean"},type:{const:"regexExtract",description:"The type of the transform to be applied",type:"string"}},required:["as","field","regex","type"],type:"object"},RegexFoldParams:{additionalProperties:!1,properties:{asKey:{description:'**Default:** `"sample"`',type:"string"},asValue:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:"A new column name for the extracted values."},columnRegex:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:"A regular expression that matches to column names. The regex must have one capturing group that is used for extracting the key (e.g., a sample id) from the column name."},skipRegex:{description:"An optional regex that matches to fields that should not be included in the new folded data objects.",type:"string"},type:{const:"regexFold",description:"The type of the transform to be applied",type:"string"}},required:["asValue","columnRegex","type"],type:"object"},ResolutionBehavior:{description:'`"independent"` and `"shared"` behave similarly to Vega-Lite. `"excluded"` behaves like `"shared"`, but is not pulled towards the root. `"forced"` behaves like `"shared"`, but is forced towards the root even if the parent has `"independent"` behavior.',enum:["independent","shared","excluded","forced"],type:"string"},RootSpec:{anyOf:[{additionalProperties:!1,properties:{$schema:{type:"string"},aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},mark:{anyOf:[{$ref:"#/definitions/MarkType"},{$ref:"#/definitions/MarkConfigAndType"}]},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},layer:{items:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}]},type:"array"},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["layer"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},hconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["hconcat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},columns:{type:"number"},concat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["columns","concat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},samples:{$ref:"#/definitions/SampleDef",description:"Sample metadata definition. If the object is empty, the sample identifiers will be inferred from the data."},spec:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}],description:"The view specification to be repeated for each sample."},stickySummaries:{type:"boolean"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"An object defining the view background and outline. The background is repeated for each group."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["samples","spec"],type:"object"}]},SampleAttributeDef:{additionalProperties:!1,properties:{barScale:{$ref:"#/definitions/Scale",description:"An optional scale definition for mapping the attribute to the width of a metadata rectangle."},scale:{$ref:"#/definitions/Scale",description:"Scale definition for the (default) color channel"},type:{$ref:"#/definitions/Type",description:'The attribute type. One of `"nominal"`, `"ordinal"`, or `"quantitative"`.'},visible:{description:"Whether the attribute is visible by default.",type:"boolean"},width:{description:"Width of the column in pixels.",type:"number"}},required:["type"],type:"object"},SampleDef:{additionalProperties:!1,properties:{attributeLabelAngle:{description:"Angle to be added to the default label angle (-90).\n\n**Default value:** `0`",type:"number"},attributeLabelFont:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},attributeLabelFontSize:{description:"The font size in pixels.\n\n**Default value:** `11`",type:"number"},attributeLabelFontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},attributeLabelFontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},attributeSize:{description:"Default size (width) of the metadata attribute columns. Can be configured per attribute using the `attributes` property.\n\n**Default value:** `10`",type:"number"},attributeSpacing:{description:"Spacing between attribute columns in pixels.\n\n**Default value:** `1`",type:"number"},attributes:{additionalProperties:{$ref:"#/definitions/SampleAttributeDef"},description:"Explicitly specify the sample attributes.",type:"object"},data:{$ref:"#/definitions/Data",description:"Optional metadata about the samples."},labelAlign:{$ref:"#/definitions/Align",description:'The horizontal alignment of the text. One of `"left"`, `"center"`, or `"right"`.\n\n**Default value:** `"left"`'},labelFont:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},labelFontSize:{description:"The font size in pixels.\n\n**Default value:** `11`",type:"number"},labelFontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},labelFontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},labelLength:{description:"How much space in pixels to reserve for the labels.\n\n**Default:** `140`",type:"number"},labelTitleText:{description:'Text in the label title\n\n**Default:** `"Sample name"`',type:"string"}},type:"object"},SampleParams:{additionalProperties:!1,properties:{size:{description:"The maximum sample size.\n\n**Default:** `500`",type:"number"},type:{const:"sample",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},SampleSpec:{additionalProperties:!1,description:"A view specification for a SampleView. This is only functional in the GenomeSpy app.",properties:{baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},samples:{$ref:"#/definitions/SampleDef",description:"Sample metadata definition. If the object is empty, the sample identifiers will be inferred from the data."},spec:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}],description:"The view specification to be repeated for each sample."},stickySummaries:{type:"boolean"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"An object defining the view background and outline. The background is repeated for each group."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["samples","spec"],type:"object"},Scalar:{type:["string","number","boolean"]},ScalarDomain:{anyOf:[{$ref:"#/definitions/NumericDomain"},{items:{type:"string"},type:"array"},{items:{type:"boolean"},type:"array"}]},Scale:{additionalProperties:!1,properties:{align:{description:"The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`",type:"number"},base:{description:"The logarithm base of the `log` scale (default `10`).",type:"number"},bins:{description:"An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels.",items:{type:"number"},type:"array"},clamp:{description:"If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true` by default).",type:"boolean"},constant:{description:"A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`",type:"number"},domain:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"Customized domain values.\n\nFor _quantitative_ fields, `domain` can take the form of a two-element array with minimum and maximum values. [Piecewise scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise) can be created by providing a `domain` with more than two entries.\n\nFor _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\nFor _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input values."},domainMax:{description:"Sets the maximum value in the scale domain, overriding the `domain` property. This property is only intended for use with scales having continuous domains.",type:"number"},domainMid:{description:"Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for [diverging color scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). The domainMid property is only intended for use with scales supporting continuous, piecewise domains.",type:"number"},domainMin:{description:"Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains.",type:"number"},exponent:{description:"The exponent of the `pow` scale.",type:"number"},interpolate:{anyOf:[{$ref:"#/definitions/ScaleInterpolate"},{$ref:"#/definitions/ScaleInterpolateParams"}],description:"The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n__Default value:__ `hcl`"},name:{description:"The name of the scale. Names are optional but allow the scales to be referenced and found with the API.",type:"string"},nice:{anyOf:[{type:"boolean"},{type:"number"},{additionalProperties:!1,properties:{interval:{type:"string"},step:{type:"number"}},required:["interval","step"],type:"object"}],description:"Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise."},padding:{description:"For _[continuous](https://vega.github.io/vega-lite/docs/scale.html#continuous)_ scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`. For _band and point_ scales, see `paddingInner` and `paddingOuter`. By default, Vega-Lite sets padding such that _width/height = number of unique values * step_.",minimum:0,type:"number"},paddingInner:{description:`The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1]. +__See also:__ [\`scale\`](https://vega.github.io/vega-lite/docs/scale.html) documentation.`},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},type:{$ref:"#/definitions/Type"}},required:["type"],type:"object"},PositionValueDef:{$ref:"#/definitions/NumericValueDef"},PositionalChannel:{anyOf:[{$ref:"#/definitions/PrimaryPositionalChannel"},{$ref:"#/definitions/SecondaryPositionalChannel"}]},PrimaryPositionalChannel:{enum:["x","y"],type:"string"},ProjectParams:{additionalProperties:!1,properties:{as:{description:"New names for the projected fields. If omitted, the names of the source fields are used.",items:{type:"string"},type:"array"},fields:{description:"The fields to be projected.",items:{$ref:"#/definitions/Field"},type:"array"},type:{const:"project",description:"The type of the transform to be applied",type:"string"}},required:["fields","type"],type:"object"},RegexExtractParams:{additionalProperties:!1,properties:{as:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"The new field or an array of fields where the extracted values are written."},field:{$ref:"#/definitions/Field",description:"The source field"},regex:{description:'A valid JavaScript regular expression with at least one group. For example: `"^Sample(\\\\d+)$"`.\n\nRead more at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions',type:"string"},skipInvalidInput:{description:"Do not complain about invalid input. Just skip it and leave the new fields undefined on the affected datum.\n\n**Default:** `false`",type:"boolean"},type:{const:"regexExtract",description:"The type of the transform to be applied",type:"string"}},required:["as","field","regex","type"],type:"object"},RegexFoldParams:{additionalProperties:!1,properties:{asKey:{description:'**Default:** `"sample"`',type:"string"},asValue:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:"A new column name for the extracted values."},columnRegex:{anyOf:[{items:{type:"string"},type:"array"},{type:"string"}],description:"A regular expression that matches to column names. The regex must have one capturing group that is used for extracting the key (e.g., a sample id) from the column name."},skipRegex:{description:"An optional regex that matches to fields that should not be included in the new folded data objects.",type:"string"},type:{const:"regexFold",description:"The type of the transform to be applied",type:"string"}},required:["asValue","columnRegex","type"],type:"object"},ResolutionBehavior:{description:'`"independent"` and `"shared"` behave similarly to Vega-Lite. `"excluded"` behaves like `"shared"`, but is not pulled towards the root. `"forced"` behaves like `"shared"`, but is forced towards the root even if the parent has `"independent"` behavior.',enum:["independent","shared","excluded","forced"],type:"string"},RootSpec:{anyOf:[{additionalProperties:!1,properties:{$schema:{type:"string"},aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},mark:{anyOf:[{$ref:"#/definitions/MarkType"},{$ref:"#/definitions/MarkConfigAndType"}]},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},layer:{items:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}]},type:"array"},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["layer"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},hconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["hconcat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},columns:{type:"number"},concat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["columns","concat"],type:"object"},{additionalProperties:!1,properties:{$schema:{type:"string"},background:{description:"Background color of the canvas.",type:"string"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},datasets:{additionalProperties:{items:{},type:"array"},description:"https://vega.github.io/vega-lite/docs/data.html#datasets",type:"object"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},genome:{$ref:"#/definitions/GenomeConfig"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},params:{description:`Dynamic variables that parameterize a visualization. + +For now, these are only supported in mark properties, i.e., they are not supported in the filter and formula transforms (yet).`,items:{$ref:"#/definitions/VariableParameter"},type:"array"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},samples:{$ref:"#/definitions/SampleDef",description:"Sample metadata definition. If the object is empty, the sample identifiers will be inferred from the data."},spec:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}],description:"The view specification to be repeated for each sample."},stickySummaries:{type:"boolean"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"An object defining the view background and outline. The background is repeated for each group."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["samples","spec"],type:"object"}]},SampleAttributeDef:{additionalProperties:!1,properties:{barScale:{$ref:"#/definitions/Scale",description:"An optional scale definition for mapping the attribute to the width of a metadata rectangle."},scale:{$ref:"#/definitions/Scale",description:"Scale definition for the (default) color channel"},type:{$ref:"#/definitions/Type",description:'The attribute type. One of `"nominal"`, `"ordinal"`, or `"quantitative"`.'},visible:{description:"Whether the attribute is visible by default.",type:"boolean"},width:{description:"Width of the column in pixels.",type:"number"}},required:["type"],type:"object"},SampleDef:{additionalProperties:!1,properties:{attributeLabelAngle:{description:"Angle to be added to the default label angle (-90).\n\n**Default value:** `0`",type:"number"},attributeLabelFont:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},attributeLabelFontSize:{description:"The font size in pixels.\n\n**Default value:** `11`",type:"number"},attributeLabelFontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},attributeLabelFontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},attributeSize:{description:"Default size (width) of the metadata attribute columns. Can be configured per attribute using the `attributes` property.\n\n**Default value:** `10`",type:"number"},attributeSpacing:{description:"Spacing between attribute columns in pixels.\n\n**Default value:** `1`",type:"number"},attributes:{additionalProperties:{$ref:"#/definitions/SampleAttributeDef"},description:"Explicitly specify the sample attributes.",type:"object"},data:{$ref:"#/definitions/Data",description:"Optional metadata about the samples."},labelAlign:{$ref:"#/definitions/Align",description:'The horizontal alignment of the text. One of `"left"`, `"center"`, or `"right"`.\n\n**Default value:** `"left"`'},labelFont:{description:'The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen) versions of [Google Fonts](https://fonts.google.com/). Check their availability at the [A-Frame Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts) repository. System fonts are **not** supported.\n\n**Default value:** `"Lato"`',type:"string"},labelFontSize:{description:"The font size in pixels.\n\n**Default value:** `11`",type:"number"},labelFontStyle:{$ref:"#/definitions/FontStyle",description:'The font style. Valid values: `"normal"` and `"italic"`.\n\n**Default value:** `"normal"`'},labelFontWeight:{$ref:"#/definitions/FontWeight",description:'The font weight. The following strings and numbers are valid values: `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`), `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`), `"black"` (`900`)\n\n**Default value:** `"regular"`'},labelLength:{description:"How much space in pixels to reserve for the labels.\n\n**Default:** `140`",type:"number"},labelTitleText:{description:'Text in the label title\n\n**Default:** `"Sample name"`',type:"string"}},type:"object"},SampleParams:{additionalProperties:!1,properties:{size:{description:"The maximum sample size.\n\n**Default:** `500`",type:"number"},type:{const:"sample",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},SampleSpec:{additionalProperties:!1,description:"A view specification for a SampleView. This is only functional in the GenomeSpy app.",properties:{baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},samples:{$ref:"#/definitions/SampleDef",description:"Sample metadata definition. If the object is empty, the sample identifiers will be inferred from the data."},spec:{anyOf:[{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/UnitSpec"}],description:"The view specification to be repeated for each sample."},stickySummaries:{type:"boolean"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"An object defining the view background and outline. The background is repeated for each group."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["samples","spec"],type:"object"},Scalar:{type:["string","number","boolean"]},ScalarDomain:{anyOf:[{$ref:"#/definitions/NumericDomain"},{items:{type:"string"},type:"array"},{items:{type:"boolean"},type:"array"}]},Scale:{additionalProperties:!1,properties:{align:{description:"The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`",type:"number"},base:{description:"The logarithm base of the `log` scale (default `10`).",type:"number"},bins:{description:"An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels.",items:{type:"number"},type:"array"},clamp:{description:"If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true` by default).",type:"boolean"},constant:{description:"A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`",type:"number"},domain:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"Customized domain values.\n\nFor _quantitative_ fields, `domain` can take the form of a two-element array with minimum and maximum values. [Piecewise scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise) can be created by providing a `domain` with more than two entries.\n\nFor _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\nFor _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input values."},domainMax:{description:"Sets the maximum value in the scale domain, overriding the `domain` property. This property is only intended for use with scales having continuous domains.",type:"number"},domainMid:{description:"Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for [diverging color scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). The domainMid property is only intended for use with scales supporting continuous, piecewise domains.",type:"number"},domainMin:{description:"Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains.",type:"number"},exponent:{description:"The exponent of the `pow` scale.",type:"number"},interpolate:{anyOf:[{$ref:"#/definitions/ScaleInterpolate"},{$ref:"#/definitions/ScaleInterpolateParams"}],description:"The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n__Default value:__ `hcl`"},name:{description:"The name of the scale. Names are optional but allow the scales to be referenced and found with the API.",type:"string"},nice:{anyOf:[{type:"boolean"},{type:"number"},{additionalProperties:!1,properties:{interval:{type:"string"},step:{type:"number"}},required:["interval","step"],type:"object"}],description:"Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise."},padding:{description:"For _[continuous](https://vega.github.io/vega-lite/docs/scale.html#continuous)_ scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`. For _band and point_ scales, see `paddingInner` and `paddingOuter`. By default, Vega-Lite sets padding such that _width/height = number of unique values * step_.",minimum:0,type:"number"},paddingInner:{description:`The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1]. For point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands). -__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s \`bandPaddingInner\`.`,maximum:1,minimum:0,type:"number"},paddingOuter:{description:"The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for band scales and `pointPadding` for point scales. By default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.",maximum:1,minimum:0,type:"number"},range:{anyOf:[{items:{type:"number"},type:"array"},{items:{type:"string"},type:"array"},{type:"string"}],description:'The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `"symbol"`, or `"diverging"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be customized via the view\'s corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`).'},reverse:{description:"If true, reverses the order of the scale range.\n\n__Default value:__ `false`.",type:"boolean"},round:{description:"If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`.",type:"boolean"},scheme:{anyOf:[{type:"string"},{$ref:"#/definitions/SchemeParams"}],description:'A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `"category10"` or `"blues"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.'},type:{$ref:"#/definitions/ScaleType",description:'The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`"linear"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`"pow"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`"sqrt"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`"symlog"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`"log"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`"time"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`"utc"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`"ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`"band"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`"point"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`"bin-ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`"quantile"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`"quantize"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`"threshold"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type).'},zero:{description:"If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`.",type:"boolean"},zoom:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ZoomParams"}],description:"If `true` and the scale is used on a positional channel, it can bee zoomed and translated interactively."}},type:"object"},ScaleInterpolate:{enum:["rgb","lab","hcl","hsl","hsl-long","hcl-long","cubehelix","cubehelix-long"],type:"string"},ScaleInterpolateParams:{additionalProperties:!1,properties:{gamma:{type:"number"},type:{enum:["rgb","cubehelix","cubehelix-long"],type:"string"}},required:["type"],type:"object"},ScaleType:{enum:["null","linear","log","pow","sqrt","symlog","identity","sequential","quantize","threshold","ordinal","point","band","index","locus"],type:"string"},SchemeParams:{additionalProperties:!1,properties:{count:{description:'The number of colors to use in the scheme. This can be useful for scale types such as `"quantize"`, which use the length of the scale range to determine the number of discrete bins for the scale domain.',type:"number"},extent:{description:"The extent of the color range to use. For example `[0.2, 1]` will rescale the color scheme such that color values in the range _[0, 0.2)_ are excluded from the scheme.",items:{type:"number"},type:"array"},name:{description:'A color scheme name for ordinal scales (e.g., `"category10"` or `"blues"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.',type:"string"}},required:["name"],type:"object"},SecondaryChromPosDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},chrom:{$ref:"#/definitions/FieldName",description:"The field having the chromosome or contig."},offset:{description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/FieldName",description:"The field having an intra-chromosomal position."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},required:["chrom"],type:"object"},SecondaryPositionalChannel:{enum:["x2","y2"],type:"string"},SequenceGenerator:{additionalProperties:!1,properties:{name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},sequence:{$ref:"#/definitions/SequenceParams",description:"Generate a sequence of numbers."}},required:["sequence"],type:"object"},SequenceParams:{additionalProperties:!1,properties:{as:{$ref:"#/definitions/FieldName",description:'The name of the generated sequence field.\n\n__Default value:__ `"data"`'},start:{description:"The starting value of the sequence (inclusive).",type:"number"},step:{description:"The step value between sequence entries.\n\n__Default value:__ `1`",type:"number"},stop:{description:"The ending value of the sequence (exclusive).",type:"number"}},required:["start","stop"],type:"object"},"ShapeDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2C(string%7Cnull)%2CTypeForShape%3E"},SizeDef:{additionalProperties:!1,properties:{grow:{description:"Share of the remaining space",type:"number"},px:{description:"Size in pixels",type:"number"}},type:"object"},SortOrder:{enum:["ascending","descending"],type:"string"},StackParams:{additionalProperties:!1,properties:{as:{description:'Fields to write the stacked values.\n\n**Default:** `["y0", "y1"]`',items:{type:"string"},type:"array"},baseField:{$ref:"#/definitions/Field",description:'The field that contains the base or amino acid. Used for information content calculation when the offset is `"information"`. The data objects that have `null` in the baseField are considered gaps and they are taken into account when scaling the the locus\' information content.'},cardinality:{description:'Cardinality, e.g., the number if distinct bases or amino acids. Used for information content calculation when the offset is `"information"`.\n\n**Default:** `4`',type:"number"},field:{$ref:"#/definitions/Field",description:"The field to stack. If no field is defined, a constant value of one is assumed."},groupby:{description:"The fields to be used for forming groups for different stacks.",items:{$ref:"#/definitions/Field"},type:"array"},offset:{description:'How to offset the values in a stack. `"zero"` (default) starts stacking at 0. `"center"` centers the values around zero. `"normalize"` computes intra-stack percentages and normalizes the values to the range of `[0, 1]`. `"information"` computes a layout for a sequence logo. The total height of the stack reflects the group\'s information content.',enum:["zero","center","normalize","information"],type:"string"},sort:{$ref:"#/definitions/CompareParams",description:"The sort order of data in each stack."},type:{const:"stack",description:"The type of the transform to be applied",type:"string"}},required:["as","groupby","type"],type:"object"},Step:{additionalProperties:!1,properties:{step:{type:"number"}},required:["step"],type:"object"},StringDatumDef:{additionalProperties:!1,properties:{datum:{$ref:"#/definitions/Scalar",description:"A constant value in data domain."},format:{description:`When used with the default \`"number"\` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. +__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s \`bandPaddingInner\`.`,maximum:1,minimum:0,type:"number"},paddingOuter:{description:"The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for band scales and `pointPadding` for point scales. By default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.",maximum:1,minimum:0,type:"number"},range:{anyOf:[{items:{type:"number"},type:"array"},{items:{type:"string"},type:"array"},{type:"string"},{items:{$ref:"#/definitions/ExprRef"},type:"array"}],description:'The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `"symbol"`, or `"diverging"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be customized via the view\'s corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`).'},reverse:{description:"If true, reverses the order of the scale range.\n\n__Default value:__ `false`.",type:"boolean"},round:{description:"If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`.",type:"boolean"},scheme:{anyOf:[{type:"string"},{$ref:"#/definitions/SchemeParams"}],description:'A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `"category10"` or `"blues"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.'},type:{$ref:"#/definitions/ScaleType",description:'The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`"linear"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`"pow"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`"sqrt"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`"symlog"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`"log"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`"time"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`"utc"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`"ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`"band"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`"point"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`"bin-ordinal"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`"quantile"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`"quantize"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`"threshold"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type).'},zero:{description:"If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`.",type:"boolean"},zoom:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ZoomParams"}],description:"If `true` and the scale is used on a positional channel, it can bee zoomed and translated interactively."}},type:"object"},ScaleInterpolate:{enum:["rgb","lab","hcl","hsl","hsl-long","hcl-long","cubehelix","cubehelix-long"],type:"string"},ScaleInterpolateParams:{additionalProperties:!1,properties:{gamma:{type:"number"},type:{enum:["rgb","cubehelix","cubehelix-long"],type:"string"}},required:["type"],type:"object"},ScaleType:{enum:["null","linear","log","pow","sqrt","symlog","identity","sequential","quantize","threshold","ordinal","point","band","index","locus"],type:"string"},SchemeParams:{additionalProperties:!1,properties:{count:{description:'The number of colors to use in the scheme. This can be useful for scale types such as `"quantize"`, which use the length of the scale range to determine the number of discrete bins for the scale domain.',type:"number"},extent:{description:"The extent of the color range to use. For example `[0.2, 1]` will rescale the color scheme such that color values in the range _[0, 0.2)_ are excluded from the scheme.",items:{type:"number"},type:"array"},name:{description:'A color scheme name for ordinal scales (e.g., `"category10"` or `"blues"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.',type:"string"}},required:["name"],type:"object"},SecondaryChromPosDef:{additionalProperties:!1,properties:{axis:{anyOf:[{$ref:"#/definitions/GenomeAxis"},{type:"null"}],description:"An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation."},band:{description:"Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.",maximum:1,minimum:0,type:"number"},chrom:{$ref:"#/definitions/FieldName",description:"The field having the chromosome or contig."},offset:{description:"An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions.\n\nGenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to `1`.\n\n**Default:** `0`",type:"number"},pos:{$ref:"#/definitions/FieldName",description:"The field having an intra-chromosomal position."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},required:["chrom"],type:"object"},SecondaryPositionalChannel:{enum:["x2","y2"],type:"string"},SequenceGenerator:{additionalProperties:!1,properties:{name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},sequence:{$ref:"#/definitions/SequenceParams",description:"Generate a sequence of numbers."}},required:["sequence"],type:"object"},SequenceParams:{additionalProperties:!1,properties:{as:{$ref:"#/definitions/FieldName",description:'The name of the generated sequence field.\n\n__Default value:__ `"data"`'},start:{description:"The starting value of the sequence (inclusive).",type:"number"},step:{description:"The step value between sequence entries.\n\n__Default value:__ `1`",type:"number"},stop:{description:"The ending value of the sequence (exclusive).",type:"number"}},required:["start","stop"],type:"object"},"ShapeDef":{$ref:"#/definitions/MarkPropDef%3Cstring%2C(string%7Cnull)%2CTypeForShape%3E"},SizeDef:{additionalProperties:!1,properties:{grow:{description:"Share of the remaining space",type:"number"},px:{description:"Size in pixels",type:"number"}},type:"object"},SortOrder:{enum:["ascending","descending"],type:"string"},StackParams:{additionalProperties:!1,properties:{as:{description:'Fields to write the stacked values.\n\n**Default:** `["y0", "y1"]`',items:{type:"string"},type:"array"},baseField:{$ref:"#/definitions/Field",description:'The field that contains the base or amino acid. Used for information content calculation when the offset is `"information"`. The data objects that have `null` in the baseField are considered gaps and they are taken into account when scaling the the locus\' information content.'},cardinality:{description:'Cardinality, e.g., the number if distinct bases or amino acids. Used for information content calculation when the offset is `"information"`.\n\n**Default:** `4`',type:"number"},field:{$ref:"#/definitions/Field",description:"The field to stack. If no field is defined, a constant value of one is assumed."},groupby:{description:"The fields to be used for forming groups for different stacks.",items:{$ref:"#/definitions/Field"},type:"array"},offset:{description:'How to offset the values in a stack. `"zero"` (default) starts stacking at 0. `"center"` centers the values around zero. `"normalize"` computes intra-stack percentages and normalizes the values to the range of `[0, 1]`. `"information"` computes a layout for a sequence logo. The total height of the stack reflects the group\'s information content.',enum:["zero","center","normalize","information"],type:"string"},sort:{$ref:"#/definitions/CompareParams",description:"The sort order of data in each stack."},type:{const:"stack",description:"The type of the transform to be applied",type:"string"}},required:["as","groupby","type"],type:"object"},Step:{additionalProperties:!1,properties:{step:{type:"number"}},required:["step"],type:"object"},StringDatumDef:{additionalProperties:!1,properties:{datum:{anyOf:[{$ref:"#/definitions/Scalar"},{$ref:"#/definitions/ExprRef"}],description:"A constant value in data domain."},format:{description:`When used with the default \`"number"\` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. - If the format type is \`"number"\` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). @@ -3292,29 +3351,29 @@ See the [format documentation](https://vega.github.io/vega-lite/docs/format.html - If the format type is \`"number"\` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). -See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.`,type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},"TextDef":{anyOf:[{$ref:"#/definitions/StringFieldDef%3Cstring%3E"},{$ref:"#/definitions/StringDatumDef"},{$ref:"#/definitions/ExprDef"}]},Title:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/Align",description:'Horizontal text alignment for title text. One of `"left"`, `"center"`, or `"right"`.'},anchor:{$ref:"#/definitions/TitleAnchor",description:'The anchor position for placing the title and subtitle text. One of `"start"`, `"middle"`, or `"end"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.'},angle:{description:"Angle in degrees of title and subtitle text.",type:"number"},baseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline for title and subtitle text. One of `"alphabetic"` (default), `"top"`, `"middle"`, or `"bottom"`.'},color:{description:"Text color for title text.",type:"string"},dx:{description:"Delta offset for title and subtitle text x-coordinate.",type:"number"},dy:{description:"Delta offset for title and subtitle text y-coordinate.",type:"number"},font:{description:"Font name for title text.",type:"string"},fontSize:{description:"Font size in pixels for title text.",minimum:0,type:"number"},fontStyle:{$ref:"#/definitions/FontStyle",description:"Font style for title text."},fontWeight:{$ref:"#/definitions/FontWeight",description:'Font weight for title text. This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).'},frame:{$ref:"#/definitions/TitleFrame",description:'The reference frame for the anchor position, one of `"bounds"` (to anchor relative to the full bounding box) or `"group"` (to anchor relative to the group width or height).'},offset:{description:"The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/TitleOrient",description:'Default title orientation (`"top"`, `"bottom"`, `"left"`, or `"right"`)'},style:{description:'A mark style property to apply to the title text mark. If not specified, a default style of `"group-title"` is applied.',type:"string"},text:{description:"The title text.",type:"string"}},required:["text"],type:"object"},TitleAnchor:{enum:[null,"start","middle","end"],type:["null","string"]},TitleFrame:{enum:["bounds","group"],type:"string"},TitleOrient:{enum:["none","left","right","top","bottom"],type:"string"},Tooltip:{anyOf:[{$ref:"#/definitions/HandledTooltip"},{type:"null"}]},TransformParams:{anyOf:[{$ref:"#/definitions/AggregateParams"},{$ref:"#/definitions/CollectParams"},{$ref:"#/definitions/CoverageParams"},{$ref:"#/definitions/FlattenDelimitedParams"},{$ref:"#/definitions/FormulaParams"},{$ref:"#/definitions/FilterParams"},{$ref:"#/definitions/FilterScoredLabelsParams"},{$ref:"#/definitions/FlattenParams"},{$ref:"#/definitions/FlattenCompressedExonsParams"},{$ref:"#/definitions/FlattenSequenceParams"},{$ref:"#/definitions/IdentifierParams"},{$ref:"#/definitions/LinearizeGenomicCoordinateParams"},{$ref:"#/definitions/MeasureTextParams"},{$ref:"#/definitions/MergeFacetsParams"},{$ref:"#/definitions/PileupParams"},{$ref:"#/definitions/ProjectParams"},{$ref:"#/definitions/RegexExtractParams"},{$ref:"#/definitions/RegexFoldParams"},{$ref:"#/definitions/SampleParams"},{$ref:"#/definitions/StackParams"}]},Type:{enum:["quantitative","ordinal","nominal","index","locus"],type:"string"},TypeForShape:{enum:["ordinal","nominal"],type:"string"},UnitSpec:{additionalProperties:!1,properties:{aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},mark:{anyOf:[{$ref:"#/definitions/MarkType"},{$ref:"#/definitions/MarkConfigAndType"}]},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef<(string|null)>":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).',type:["string","null"]}},required:["value"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).',type:"number"}},required:["value"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{description:"The fill color",type:"string"},fillOpacity:{description:"The fill opacity. Value between [0, 1].",type:"number"},stroke:{description:"The stroke color",type:"string"},strokeOpacity:{description:"The stroke opacity. Value between [0, 1].",type:"number"},strokeWidth:{type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},x6={$ref:NAe,$schema:MAe,definitions:RAe},PAe="@genome-spy/playground",OAe="0.43.3",FAe="A playground for testing GenomeSpy visualizations",BAe="module",WAe={dev:"vite",build:"vite build",serve:"vite preview"},VAe="Kari Lavikka",HAe="MIT",zAe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.43.3",lit:"^3.0.2","monaco-editor":"^0.44.0","vega-loader":"^4.4.0"},L6={name:PAe,private:!0,version:OAe,description:FAe,type:BAe,scripts:WAe,author:VAe,license:HAe,dependencies:zAe};/*!----------------------------------------------------------------------------- +See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.`,type:"string"},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]}},type:"object"},"TextDef":{anyOf:[{$ref:"#/definitions/StringFieldDef%3Cstring%3E"},{$ref:"#/definitions/StringDatumDef"},{$ref:"#/definitions/ExprDef"}]},Title:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/Align",description:'Horizontal text alignment for title text. One of `"left"`, `"center"`, or `"right"`.'},anchor:{$ref:"#/definitions/TitleAnchor",description:'The anchor position for placing the title and subtitle text. One of `"start"`, `"middle"`, or `"end"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.'},angle:{description:"Angle in degrees of title and subtitle text.",type:"number"},baseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline for title and subtitle text. One of `"alphabetic"` (default), `"top"`, `"middle"`, or `"bottom"`.'},color:{description:"Text color for title text.",type:"string"},dx:{description:"Delta offset for title and subtitle text x-coordinate.",type:"number"},dy:{description:"Delta offset for title and subtitle text y-coordinate.",type:"number"},font:{description:"Font name for title text.",type:"string"},fontSize:{description:"Font size in pixels for title text.",minimum:0,type:"number"},fontStyle:{$ref:"#/definitions/FontStyle",description:"Font style for title text."},fontWeight:{$ref:"#/definitions/FontWeight",description:'Font weight for title text. This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).'},frame:{$ref:"#/definitions/TitleFrame",description:'The reference frame for the anchor position, one of `"bounds"` (to anchor relative to the full bounding box) or `"group"` (to anchor relative to the group width or height).'},offset:{description:"The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/TitleOrient",description:'Default title orientation (`"top"`, `"bottom"`, `"left"`, or `"right"`)'},style:{description:'A mark style property to apply to the title text mark. If not specified, a default style of `"group-title"` is applied.',type:"string"},text:{description:"The title text.",type:"string"}},required:["text"],type:"object"},TitleAnchor:{enum:[null,"start","middle","end"],type:["null","string"]},TitleFrame:{enum:["bounds","group"],type:"string"},TitleOrient:{enum:["none","left","right","top","bottom"],type:"string"},Tooltip:{anyOf:[{$ref:"#/definitions/HandledTooltip"},{type:"null"}]},TransformParams:{anyOf:[{$ref:"#/definitions/AggregateParams"},{$ref:"#/definitions/CollectParams"},{$ref:"#/definitions/CoverageParams"},{$ref:"#/definitions/FlattenDelimitedParams"},{$ref:"#/definitions/FormulaParams"},{$ref:"#/definitions/FilterParams"},{$ref:"#/definitions/FilterScoredLabelsParams"},{$ref:"#/definitions/FlattenParams"},{$ref:"#/definitions/FlattenCompressedExonsParams"},{$ref:"#/definitions/FlattenSequenceParams"},{$ref:"#/definitions/IdentifierParams"},{$ref:"#/definitions/LinearizeGenomicCoordinateParams"},{$ref:"#/definitions/MeasureTextParams"},{$ref:"#/definitions/MergeFacetsParams"},{$ref:"#/definitions/PileupParams"},{$ref:"#/definitions/ProjectParams"},{$ref:"#/definitions/RegexExtractParams"},{$ref:"#/definitions/RegexFoldParams"},{$ref:"#/definitions/SampleParams"},{$ref:"#/definitions/StackParams"}]},Type:{enum:["quantitative","ordinal","nominal","index","locus"],type:"string"},TypeForShape:{enum:["ordinal","nominal"],type:"string"},UnitSpec:{additionalProperties:!1,properties:{aggregateSamples:{items:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"}]},type:"array"},baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},mark:{anyOf:[{$ref:"#/definitions/MarkType"},{$ref:"#/definitions/MarkConfigAndType"}]},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the App. Configurability requires that the view has an explicitly specified name that is *unique* in within the view specification.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data"},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Multiple lines can be provided as an array."},encoding:{$ref:"#/definitions/Encoding"},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'},name:{type:"string"},opacity:{$ref:"#/definitions/ViewOpacityDef",description:"Opacity of the view and all its children.\n\n**Default:** `1.0`"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding in pixels.\n\n**Default:* `0`"},resolve:{additionalProperties:!1,properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{type:"number"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}]},transform:{items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with scrollbars. This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"Visibility of the view. An invisible view is removed from the layout and not rendered.\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef<(string|null)>":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"string"},{type:"null"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},VariableParameter:{additionalProperties:!1,properties:{bind:{$ref:"#/definitions/Binding",description:"Binds the parameter to an external input element such as a slider, selection list or radio button group."},name:{description:'A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are: "datum".',type:"string"},value:{description:"The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`"}},required:["name"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color"},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between [0, 1]."},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between [0, 1]."},strokeWidth:{type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},F6={$ref:QAe,$schema:JAe,definitions:eTe},tTe="@genome-spy/playground",iTe="0.44.0",nTe="A playground for testing GenomeSpy visualizations",sTe="module",oTe={dev:"vite",build:"vite build",serve:"vite preview"},rTe="Kari Lavikka",aTe="MIT",lTe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.44.0",lit:"^3.0.2","monaco-editor":"^0.44.0","vega-loader":"^4.4.0"},B6={name:tTe,private:!0,version:iTe,description:nTe,type:sTe,scripts:oTe,author:rTe,license:aTe,dependencies:lTe};/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var $Ae=Object.defineProperty,UAe=Object.getOwnPropertyDescriptor,jAe=Object.getOwnPropertyNames,qAe=Object.prototype.hasOwnProperty,D6=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of jAe(e))!qAe.call(n,s)&&s!==t&&$Ae(n,s,{get:()=>e[s],enumerable:!(i=UAe(e,s))||i.enumerable});return n},GAe=(n,e,t)=>(D6(n,e,"default"),t&&D6(t,e,"default")),P1={};GAe(P1,TAe);var KAe=class{constructor(n,e,t){Dn(this,"_onDidChange",new P1.Emitter);Dn(this,"_diagnosticsOptions");Dn(this,"_modeConfiguration");Dn(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},YAe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ZAe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},UG=new KAe("json",YAe,ZAe);P1.languages.json={jsonDefaults:UG};function XAe(){return Gs(()=>import("./jsonMode-HHMLu35g.js"),__vite__mapDeps([]),import.meta.url)}P1.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});P1.languages.onLanguage("json",()=>{XAe().then(n=>n.setupMode(UG))});const QAe={0:" ",1:"u",2:"r"},k6=65535,Fr=16777215,E6=4278190080;class K2{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<k6)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new K2(e.length),this._userDefinedStates=new K2(e.length),this._recoveredStates=new K2(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iFr||r>Fr)throw new Error("startLineNumber or endLineNumber must not exceed "+Fr);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Fr}getEndLineNumber(e){return this._endIndexes[e]&Fr}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&E6)>>>16);return t===k6?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class JAe{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class eTe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new ho(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&s.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const r=ho.sanitizeAndMerge(this._regions,s,o);this.updatePost(ho.fromFoldRanges(r))}_getLinesChecksum(e,t){return Qpe(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==r&&c0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function iTe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function nTe(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function qG(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function QP(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function JP(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function sTe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function oTe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function rTe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||of(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return I6(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!lTe(r,s))&&(s=I6(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function lTe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function I6(n,e){const t=Cb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const cTe=5e3,dTe="indent";class GG{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=dTe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(fTe(this.editorModel,i,s,this.foldingRangesLimit))}}let uTe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Fr||t>Fr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new ho(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=ZL(u,o);(h{}};function fTe(n,e,t,i=hTe){const s=n.getOptions().tabSize,o=new uTe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=ZL(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const gTe=E("editor.foldBackground",{light:ye(Zc,.3),dark:ye(Zc,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:Yc,light:Yc,hcDark:Yc,hcLight:Yc},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const e3=Yi("folding-expanded",ie.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),t3=Yi("folding-collapsed",ie.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),KG=Yi("folding-manual-collapsed",t3,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),YG=Yi("folding-manual-expanded",e3,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),i3={color:sn(gTe),position:Ys.Inline};class Li{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Li.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Li.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Li.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Li.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Li.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Li.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Li.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Li.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Li.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Li.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Li.MANUALLY_EXPANDED_VISUAL_DECORATION:Li.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Li.COLLAPSED_VISUAL_DECORATION=Qe.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(t3)});Li.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Qe.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:i3,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(t3)});Li.MANUALLY_COLLAPSED_VISUAL_DECORATION=Qe.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(KG)});Li.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Qe.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:i3,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(KG)});Li.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Qe.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Li.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Qe.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:i3,isWholeLine:!0});Li.EXPANDED_VISUAL_DECORATION=Qe.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ae.asClassName(e3)});Li.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Qe.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(e3)});Li.MANUALLY_EXPANDED_VISUAL_DECORATION=Qe.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ae.asClassName(YG)});Li.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Qe.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(YG)});Li.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Qe.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Li.HIDDEN_RANGE_DECORATION=Qe.register({description:"folding-hidden-range-decoration",stickiness:1});const pTe={},mTe="syntax";class ZG{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=mTe,this.disposables=new fe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return _Te(this.providers,this.editorModel,e).then(t=>{var i,s;return t?vTe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function _Te(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,pTe,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},lc));return Promise.all(s).then(o=>i)}class bTe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Fr||t>Fr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new bTe(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var wTe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},m0=function(n,e){return function(t,i){e(t,i,n)}},yTe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},mg;const Vn=new me("foldingEnabled",!1);let cf=mg=class extends K{static get(e){return e.getContribution(mg.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=mg._foldingRangeSelector)===null||i===void 0?void 0:i.call(mg,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new fe),this.editor=e,this._foldingLimitReporter=new CTe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Li(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Vn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new eTe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new aTe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new cu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Ci(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new GG(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=mg.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new ZG(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new ou,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=uc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(ls.Imports.value,!0);d&&(r=rv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(pt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,pt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};cf.ID="editor.contrib.folding";cf=mg=wTe([m0(1,Je),m0(2,no),m0(3,Ln),m0(4,rq),m0(5,nt)],cf);class CTe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Jn extends Yt{runEditorCommand(e,t,i){const s=e.get(no),o=cf.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function XG(n){if(!Us(n)){if(!Ds(n))return!1;const e=n;if(!Us(e.levels)&&!Fd(e.levels)||!Us(e.direction)&&!Ms(e.direction)||!Us(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Fd)))return!1}return!0}class STe extends Jn{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: + *-----------------------------------------------------------------------------*/var cTe=Object.defineProperty,dTe=Object.getOwnPropertyDescriptor,uTe=Object.getOwnPropertyNames,hTe=Object.prototype.hasOwnProperty,W6=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of uTe(e))!hTe.call(n,s)&&s!==t&&cTe(n,s,{get:()=>e[s],enumerable:!(i=dTe(e,s))||i.enumerable});return n},fTe=(n,e,t)=>(W6(n,e,"default"),t&&W6(t,e,"default")),z1={};fTe(z1,XAe);var gTe=class{constructor(n,e,t){Dn(this,"_onDidChange",new z1.Emitter);Dn(this,"_diagnosticsOptions");Dn(this,"_modeConfiguration");Dn(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},pTe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},mTe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},aK=new gTe("json",pTe,mTe);z1.languages.json={jsonDefaults:aK};function _Te(){return qs(()=>import("./jsonMode-7xyoogtf.js"),__vite__mapDeps([]),import.meta.url)}z1.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});z1.languages.onLanguage("json",()=>{_Te().then(n=>n.setupMode(aK))});const bTe={0:" ",1:"u",2:"r"},V6=65535,Wr=16777215,H6=4278190080;class eE{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<V6)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new eE(e.length),this._userDefinedStates=new eE(e.length),this._recoveredStates=new eE(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iWr||r>Wr)throw new Error("startLineNumber or endLineNumber must not exceed "+Wr);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Wr}getEndLineNumber(e){return this._endIndexes[e]&Wr}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&H6)>>>16);return t===V6?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class vTe{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class wTe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new ho(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&s.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const r=ho.sanitizeAndMerge(this._regions,s,o);this.updatePost(ho.fromFoldRanges(r))}_getLinesChecksum(e,t){return bme(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==r&&c0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function CTe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function STe(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function cK(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function c3(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function d3(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function xTe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function LTe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function DTe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||of(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return z6(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!ETe(r,s))&&(s=z6(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function ETe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function z6(n,e){const t=xb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const ITe=5e3,ATe="indent";class dK{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=ATe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(MTe(this.editorModel,i,s,this.foldingRangesLimit))}}let TTe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Wr||t>Wr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new ho(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=sD(u,o);(h{}};function MTe(n,e,t,i=NTe){const s=n.getOptions().tabSize,o=new TTe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=sD(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const RTe=E("editor.foldBackground",{light:ye(Jc,.3),dark:ye(Jc,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const u3=Yi("folding-expanded",ie.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),h3=Yi("folding-collapsed",ie.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),uK=Yi("folding-manual-collapsed",h3,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),hK=Yi("folding-manual-expanded",u3,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),f3={color:sn(RTe),position:Ks.Inline};class ki{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?ki.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?ki.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:ki.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:ki.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?ki.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:ki.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?ki.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:ki.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?ki.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:ki.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?ki.MANUALLY_EXPANDED_VISUAL_DECORATION:ki.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}ki.COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(h3)});ki.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:f3,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(h3)});ki.MANUALLY_COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(uK)});ki.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:f3,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(uK)});ki.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});ki.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:f3,isWholeLine:!0});ki.EXPANDED_VISUAL_DECORATION=et.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ae.asClassName(u3)});ki.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(u3)});ki.MANUALLY_EXPANDED_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ae.asClassName(hK)});ki.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ae.asClassName(hK)});ki.NO_CONTROLS_EXPANDED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});ki.HIDDEN_RANGE_DECORATION=et.register({description:"folding-hidden-range-decoration",stickiness:1});const PTe={},OTe="syntax";class fK{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=OTe,this.disposables=new fe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return FTe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?WTe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function FTe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,PTe,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},uc));return Promise.all(s).then(o=>i)}class BTe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Wr||t>Wr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new BTe(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var VTe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},b0=function(n,e){return function(t,i){e(t,i,n)}},HTe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},mg;const Vn=new _e("foldingEnabled",!1);let cf=mg=class extends Y{static get(e){return e.getContribution(mg.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=mg._foldingRangeSelector)===null||i===void 0?void 0:i.call(mg,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new fe),this.editor=e,this._foldingLimitReporter=new zTe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new ki(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Vn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new wTe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new kTe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new gu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new xi(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new dK(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=mg.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new fK(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new du,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=gc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(as.Imports.value,!0);d&&(r=lv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(pt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,pt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};cf.ID="editor.contrib.folding";cf=mg=VTe([b0(1,tt),b0(2,no),b0(3,Ln),b0(4,Sq),b0(5,nt)],cf);class zTe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Jn extends Zt{runEditorCommand(e,t,i){const s=e.get(no),o=cf.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function gK(n){if(!$s(n)){if(!Ls(n))return!1;const e=n;if(!$s(e.levels)&&!zd(e.levels)||!$s(e.direction)&&!Ns(e.direction)||!$s(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(zd)))return!1}return!0}class $Te extends Jn{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:XG,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,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?jG(t,!1,o,r):Vm(t,!1,o,r)}}class xTe extends Jn{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2142),weight:100}})}invoke(e,t,i,s){Vm(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class LTe extends Jn{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:gK,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,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?lK(t,!1,o,r):zm(t,!1,o,r)}}class UTe extends Jn{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2142),weight:100}})}invoke(e,t,i,s){zm(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class jTe extends Jn{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:XG,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?iTe(t,!0,o):a==="up"?jG(t,!0,r||1,o):Vm(t,!0,r||1,o)}}class DTe extends Jn{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);tTe(t,1,s)}}class kTe extends Jn{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);Vm(t,!0,Number.MAX_VALUE,s)}}class ETe extends Jn{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())JP(t,ls.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+pr(a.blockCommentStartToken));QP(t,l,!0)}}}}class ITe extends Jn{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())JP(t,ls.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);QP(t,l,!0)}}}}class ATe extends Jn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())JP(t,ls.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);QP(t,l,!1)}}}}class TTe extends Jn{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);qG(t,!0,s)}}class NTe extends Jn{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);qG(t,!1,s)}}class MTe extends Jn{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2069),weight:100}})}invoke(e,t,i){Vm(t,!0)}}class RTe extends Jn{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2088),weight:100}})}invoke(e,t,i){Vm(t,!1)}}class df extends Jn{getFoldingLevel(){return parseInt(this.id.substr(df.ID_PREFIX.length))}invoke(e,t,i){nTe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}df.ID_PREFIX="editor.foldLevel";df.ID=n=>df.ID_PREFIX+n;class PTe extends Jn{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=sTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class OTe extends Jn{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=oTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class FTe extends Jn{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=rTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class BTe extends Jn{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2135),weight:100}})}invoke(e,t,i){var s;const o=[],r=i.getSelections();if(r){for(const a of r){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=ho.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(ho.fromFoldRanges(a))}}}}class WTe extends Jn{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Cr(cf.ID,cf,0);Ye(STe);Ye(xTe);Ye(LTe);Ye(kTe);Ye(MTe);Ye(RTe);Ye(ETe);Ye(ITe);Ye(ATe);Ye(TTe);Ye(NTe);Ye(DTe);Ye(PTe);Ye(OTe);Ye(FTe);Ye(BTe);Ye(WTe);for(let n=1;n<=7;n++)Yge(new df({id:df.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:Vn,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2048|21+n),weight:100}}));qt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return yTe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof $e))throw Kl();const i=n.get(nt),s=n.get(fs).getModel(t);if(!s)throw Kl();const o=n.get(Jt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(no),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new GG(s,r,l);let d=c;if(a!=="indentation"){const f=cf.getFoldingRangeProviders(i,s);f.length&&(d=new ZG(s,f,()=>{},l,c))}const u=yield d.compute(rn.None),h=[];try{if(u)for(let f=0;fthis._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,jn._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,jn._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new N(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,jn._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=jn._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=jn._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,jn._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rN.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function A6(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function T6(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=QG([s[a]],r)+t}),o.slice(0,-1)}class N6{constructor(e){this.staticValue=e,this.kind=0}}class HTe{constructor(e){this.pieces=e,this.kind=1}}class _m{static fromStaticValue(e){return new _m([Bh.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new N6(""):e.length===1&&e[0].staticValue!==null?this._state=new N6(e[0].staticValue):this._state=new HTe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?QG(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(r.caseOps[d]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),d++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),d++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.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+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Pt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},UTe)):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 N(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,od);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=Cb(s.map(l=>l.range),l=>N.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new V(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new V(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()k_._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=od?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Ou(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let u="mu";i.ignoreCase&&(u+="i"),i.global&&(u+="g"),i=new RegExp(i.source,u)}const s=this._editor.getModel(),o=s.getValue(1),r=s.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const d=new vj(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:oe(I4),inputActiveOptionForeground:oe(A4),inputActiveOptionBackground:oe(lh)};this.caseSensitive=this._register(new $q(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},s))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new Uq(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleWholeWordCommand),isChecked:this._state.wholeWord},s))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new jq(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleRegexCommand),isChecked:this._state.isRegex},s))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let r=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,r=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,r=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,r=!0),!this._state.isRevealed&&r&&this._revealTemporarily()})),this._register(G(this._domNode,le.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(G(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return DD.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}DD.ID="editor.contrib.findOptionsWidget";function oy(n,e){return n===1?!0:n===2?!1:e}class jTe extends K{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return oy(this._isRegexOverride,this._isRegex)}get wholeWord(){return oy(this._wholeWordOverride,this._wholeWord)}get matchCase(){return oy(this._matchCaseOverride,this._matchCase)}get preserveCase(){return oy(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new B),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(N.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;const o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let r=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!N.equalsRange(f,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),c!==this.matchCase&&(r=!0,o.matchCase=!0),d!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=od}}const qTe=m("defaultLabel","input"),GTe=m("label.preserveCaseToggle","Preserve Case");class KTe extends Bm{constructor(e){super({icon:ie.preserveCase,title:GTe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class YTe extends oa{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onPreserveCaseKeyDown=this._register(new B),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||qTe;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qq(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new KTe(Object.assign({appendTitle:o,isChecked:!1},s.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),ze.stop(h,!0)}}});const u=document.createElement("div");u.className="controls",u.style.display=this._showOptionButtons?"block":"none",u.appendChild(this.preserveCase.domNode),this.domNode.appendChild(u),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var JG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eK=function(n,e){return function(t,i){e(t,i,n)}};const tK=new me("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),s3="historyNavigationWidgetFocus",iK="historyNavigationForwardsEnabled",nK="historyNavigationBackwardsEnabled";let Jl;const ry=[];function sK(n,e){if(ry.includes(e))throw new Error("Cannot register the same widget multiple times");ry.push(e);const t=new fe,i=new me(s3,!1).bindTo(n),s=new me(iK,!0).bindTo(n),o=new me(nK,!0).bindTo(n),r=()=>{i.set(!0),Jl=e},a=()=>{i.set(!1),Jl===e&&(Jl=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ke(()=>{ry.splice(ry.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let RN=class extends Gq{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(sK(o,this.inputBox))}};RN=JG([eK(3,Je)],RN);let PN=class extends YTe{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(sK(r,this.inputBox))}};PN=JG([eK(3,Je)],PN);Os.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:xe.and(xe.has(s3),xe.equals(nK,!0),xe.not("isComposing"),tK.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{Jl==null||Jl.showPreviousValue()}});Os.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:xe.and(xe.has(s3),xe.equals(iK,!0),xe.not("isComposing"),tK.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{Jl==null||Jl.showNextValue()}});function M6(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var ZTe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const XTe=Yi("find-selection",ie.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),R6=Yi("find-collapsed",ie.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),P6=Yi("find-expanded",ie.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),QTe=Yi("find-replace",ie.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),JTe=Yi("find-replace-all",ie.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),eNe=Yi("find-previous-match",ie.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),tNe=Yi("find-next-match",ie.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),iNe=m("label.findDialog","Find / Replace"),nNe=m("label.find","Find"),sNe=m("placeholder.find","Find"),oNe=m("label.previousMatchButton","Previous Match"),rNe=m("label.nextMatchButton","Next Match"),aNe=m("label.toggleSelectionFind","Find in Selection"),lNe=m("label.closeButton","Close"),cNe=m("label.replace","Replace"),dNe=m("placeholder.replace","Replace"),uNe=m("label.replaceButton","Replace"),hNe=m("label.replaceAllButton","Replace All"),fNe=m("label.toggleReplaceButton","Toggle Replace"),gNe=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",od),pNe=m("label.matchesLocation","{0} of {1}"),O6=m("label.noResults","No results"),ha=419,mNe=275,_Ne=mNe-54;let _0=69;const bNe=33,F6="ctrlEnterReplaceAll.windows.donotask",B6=gt?256:2048;class Y2{constructor(e){this.afterLineNumber=e,this.heightInPx=bNe,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function W6(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function V6(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(143)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const u=this._codeEditor.getOption(41).loop;this._state.change({loop:u},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new Y2(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>ZTe(this,void 0,void 0,function*(){if(this._isVisible){const d=yield this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}}))),this._findInputFocused=LD.bindTo(r),this._findFocusTracker=this._register(Vd(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=n3.bindTo(r),this._replaceFocusTracker=this._register(Vd(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new Y2(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return kD.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ys(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,pt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=_0+"px",this._state.matchesCount>=od?this._matchesCount.title=gNe:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=od&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=ub(pNe,i,t)}else e=O6;this._matchesCount.appendChild(document.createTextNode(e)),_1(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),_0=Math.max(_0,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===O6)return i===""?m("ariaSearchNoResultEmpty","{0} found",e):m("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=m("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return m("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=Nn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=eU(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new Y2(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!h4(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&ys(this._domNode)>ha){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=ys(this._findInput.domNode);return}if(ha+28+s>=i&&(r=!0),ha+28+s-_0>=i&&(a=!0),ha+28+s-_0>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ys(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!N.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(B6|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return W6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return V6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(B6|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Rs&&Yg&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("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(F6,!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 W6(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return V6(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 RN(null,this._contextViewProvider,{width:_Ne,label:nNe,placeholder:sNe,appendCaseSensitiveLabel:this._keybindingLabelFor(Nt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Nt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Nt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>M6(this._keybindingService),inputBoxStyles:VS,toggleStyles:WS},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(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Zn&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new cg({label:oNe+this._keybindingLabelFor(Nt.PreviousMatchFindAction),icon:eNe,onTrigger:()=>{gI(this._codeEditor.getAction(Nt.PreviousMatchFindAction)).run().then(void 0,pt)}})),this._nextBtn=this._register(new cg({label:rNe+this._keybindingLabelFor(Nt.NextMatchFindAction),icon:tNe,onTrigger:()=>{gI(this._codeEditor.getAction(Nt.NextMatchFindAction)).run().then(void 0,pt)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Bm({icon:XTe,title:aNe+this._keybindingLabelFor(Nt.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:oe(lh),inputActiveOptionBorder:oe(I4),inputActiveOptionForeground:oe(A4)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new cg({label:lNe+this._keybindingLabelFor(Nt.CloseFindWidgetCommand),icon:e2e,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new PN(null,void 0,{label:cNe,placeholder:dNe,appendPreserveCaseLabel:this._keybindingLabelFor(Nt.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>M6(this._keybindingService),inputBoxStyles:VS,toggleStyles:WS},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new cg({label:uNe+this._keybindingLabelFor(Nt.ReplaceOneAction),icon:QTe,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new cg({label:hNe+this._keybindingLabelFor(Nt.ReplaceAllAction),icon:JTe,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new cg({label:fNe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ys(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=iNe,this._domNode.role="dialog",this._domNode.style.width=`${ha}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new En(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=ha;this._register(this._resizeSash.onDidStart(()=>{a=ys(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cd||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ys(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ys(this._domNode);if(l{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var s,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(s=this._opts).onKeyDown)===null||o===void 0||o.call(s,i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Ae.asClassNameArray(R6)),this._domNode.classList.add(...Ae.asClassNameArray(P6))):(this._domNode.classList.remove(...Ae.asClassNameArray(P6)),this._domNode.classList.add(...Ae.asClassNameArray(R6)))}}Sr((n,e)=>{const t=(p,_)=>{_&&e.addRule(`.monaco-editor ${p} { background-color: ${_}; }`)};t(".findMatch",n.getColor(Pa)),t(".currentFindMatch",n.getColor(R_e)),t(".findScope",n.getColor(P_e));const i=n.getColor(Vi);t(".find-widget",i);const s=n.getColor(Hl);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(qU);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const r=n.getColor(Xc);r&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Zl(n.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const a=n.getColor(O_e);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(F_e);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Zl(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(Xe);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=n.getColor(Ra);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=n.getColor(e_e);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=n.getColor(L_e);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=n.getColor(Ig);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=n.getColor(UA);f&&e.addRule(` + `,constraint:gK,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?CTe(t,!0,o):a==="up"?lK(t,!0,r||1,o):zm(t,!0,r||1,o)}}class qTe extends Jn{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);yTe(t,1,s)}}class GTe extends Jn{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);zm(t,!0,Number.MAX_VALUE,s)}}class KTe extends Jn{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())d3(t,as.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+mr(a.blockCommentStartToken));c3(t,l,!0)}}}}class YTe extends Jn{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())d3(t,as.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);c3(t,l,!0)}}}}class ZTe extends Jn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())d3(t,as.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);c3(t,l,!1)}}}}class XTe extends Jn{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);cK(t,!0,s)}}class QTe extends Jn{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);cK(t,!1,s)}}class JTe extends Jn{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2069),weight:100}})}invoke(e,t,i){zm(t,!0)}}class eNe extends Jn{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2088),weight:100}})}invoke(e,t,i){zm(t,!1)}}class df extends Jn{getFoldingLevel(){return parseInt(this.id.substr(df.ID_PREFIX.length))}invoke(e,t,i){STe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}df.ID_PREFIX="editor.foldLevel";df.ID=n=>df.ID_PREFIX+n;class tNe extends Jn{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=xTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class iNe extends Jn{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=LTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class nNe extends Jn{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=DTe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class sNe extends Jn{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2135),weight:100}})}invoke(e,t,i){var s;const o=[],r=i.getSelections();if(r){for(const a of r){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=ho.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(ho.fromFoldRanges(a))}}}}class oNe extends Jn{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Sr(cf.ID,cf,0);Xe($Te);Xe(UTe);Xe(jTe);Xe(GTe);Xe(JTe);Xe(eNe);Xe(KTe);Xe(YTe);Xe(ZTe);Xe(XTe);Xe(QTe);Xe(qTe);Xe(tNe);Xe(iNe);Xe(nNe);Xe(sNe);Xe(oNe);for(let n=1;n<=7;n++)ppe(new df({id:df.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2048|21+n),weight:100}}));Gt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return HTe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof je))throw Xl();const i=n.get(nt),s=n.get(hs).getModel(t);if(!s)throw Xl();const o=n.get(ei);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(no),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new dK(s,r,l);let d=c;if(a!=="indentation"){const f=cf.getFoldingRangeProviders(i,s);f.length&&(d=new fK(s,f,()=>{},l,c))}const u=yield d.compute(rn.None),h=[];try{if(u)for(let f=0;fthis._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,jn._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,jn._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new N(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,jn._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=jn._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=jn._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,jn._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rN.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function $6(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function U6(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=pK([s[a]],r)+t}),o.slice(0,-1)}class j6{constructor(e){this.staticValue=e,this.kind=0}}class aNe{constructor(e){this.pieces=e,this.kind=1}}class vm{static fromStaticValue(e){return new vm([Wh.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new j6(""):e.length===1&&e[0].staticValue!==null?this._state=new j6(e[0].staticValue):this._state=new aNe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?pK(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(r.caseOps[d]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),d++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),d++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.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+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Pt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},dNe)):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 N(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,ld);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=xb(s.map(l=>l.range),l=>N.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new H(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new H(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()I_._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=ld?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Hu(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let u="mu";i.ignoreCase&&(u+="i"),i.global&&(u+="g"),i=new RegExp(i.source,u)}const s=this._editor.getModel(),o=s.getValue(1),r=s.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const d=new Oj(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:oe(V4),inputActiveOptionForeground:oe(H4),inputActiveOptionBackground:oe(hh)};this.caseSensitive=this._register(new rG(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},s))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new aG(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleWholeWordCommand),isChecked:this._state.wholeWord},s))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new lG(Object.assign({appendTitle:this._keybindingLabelFor(Nt.ToggleRegexCommand),isChecked:this._state.isRegex},s))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let r=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,r=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,r=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,r=!0),!this._state.isRevealed&&r&&this._revealTemporarily()})),this._register(K(this._domNode,le.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(K(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return RD.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}RD.ID="editor.contrib.findOptionsWidget";function hy(n,e){return n===1?!0:n===2?!1:e}class uNe extends Y{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return hy(this._isRegexOverride,this._isRegex)}get wholeWord(){return hy(this._wholeWordOverride,this._wholeWord)}get matchCase(){return hy(this._matchCaseOverride,this._matchCase)}get preserveCase(){return hy(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new B),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(N.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;const o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let r=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!N.equalsRange(f,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),c!==this.matchCase&&(r=!0,o.matchCase=!0),d!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=ld}}const hNe=m("defaultLabel","input"),fNe=m("label.preserveCaseToggle","Preserve Case");class gNe extends Vm{constructor(e){super({icon:ie.preserveCase,title:fNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class pNe extends ra{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onPreserveCaseKeyDown=this._register(new B),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||hNe;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new cG(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new gNe(Object.assign({appendTitle:o,isChecked:!1},s.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),Ue.stop(h,!0)}}});const u=document.createElement("div");u.className="controls",u.style.display=this._showOptionButtons?"block":"none",u.appendChild(this.preserveCase.domNode),this.domNode.appendChild(u),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var mK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_K=function(n,e){return function(t,i){e(t,i,n)}};const bK=new _e("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),p3="historyNavigationWidgetFocus",vK="historyNavigationForwardsEnabled",wK="historyNavigationBackwardsEnabled";let ic;const fy=[];function yK(n,e){if(fy.includes(e))throw new Error("Cannot register the same widget multiple times");fy.push(e);const t=new fe,i=new _e(p3,!1).bindTo(n),s=new _e(vK,!0).bindTo(n),o=new _e(wK,!0).bindTo(n),r=()=>{i.set(!0),ic=e},a=()=>{i.set(!1),ic===e&&(ic=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ze(()=>{fy.splice(fy.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let UN=class extends dG{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(yK(o,this.inputBox))}};UN=mK([_K(3,tt)],UN);let jN=class extends pNe{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(yK(r,this.inputBox))}};jN=mK([_K(3,tt)],jN);Ps.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:xe.and(xe.has(p3),xe.equals(wK,!0),xe.not("isComposing"),bK.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{ic==null||ic.showPreviousValue()}});Ps.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:xe.and(xe.has(p3),xe.equals(vK,!0),xe.not("isComposing"),bK.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{ic==null||ic.showNextValue()}});function q6(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var mNe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const _Ne=Yi("find-selection",ie.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),G6=Yi("find-collapsed",ie.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),K6=Yi("find-expanded",ie.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),bNe=Yi("find-replace",ie.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),vNe=Yi("find-replace-all",ie.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),wNe=Yi("find-previous-match",ie.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),yNe=Yi("find-next-match",ie.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),CNe=m("label.findDialog","Find / Replace"),SNe=m("label.find","Find"),xNe=m("placeholder.find","Find"),LNe=m("label.previousMatchButton","Previous Match"),DNe=m("label.nextMatchButton","Next Match"),kNe=m("label.toggleSelectionFind","Find in Selection"),ENe=m("label.closeButton","Close"),INe=m("label.replace","Replace"),ANe=m("placeholder.replace","Replace"),TNe=m("label.replaceButton","Replace"),NNe=m("label.replaceAllButton","Replace All"),MNe=m("label.toggleReplaceButton","Toggle Replace"),RNe=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",ld),PNe=m("label.matchesLocation","{0} of {1}"),Y6=m("label.noResults","No results"),fa=419,ONe=275,FNe=ONe-54;let v0=69;const BNe=33,Z6="ctrlEnterReplaceAll.windows.donotask",X6=gt?256:2048;class tE{constructor(e){this.afterLineNumber=e,this.heightInPx=BNe,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Q6(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function J6(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(143)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const u=this._codeEditor.getOption(41).loop;this._state.change({loop:u},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new tE(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>mNe(this,void 0,void 0,function*(){if(this._isVisible){const d=yield this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}}))),this._findInputFocused=MD.bindTo(r),this._findFocusTracker=this._register(jd(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=g3.bindTo(r),this._replaceFocusTracker=this._register(jd(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new tE(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return PD.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ws(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,pt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=v0+"px",this._state.matchesCount>=ld?this._matchesCount.title=RNe:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=ld&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=fb(PNe,i,t)}else e=Y6;this._matchesCount.appendChild(document.createTextNode(e)),x1(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),v0=Math.max(v0,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Y6)return i===""?m("ariaSearchNoResultEmpty","{0} found",e):m("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=m("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return m("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=Nn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=_U(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new tE(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!S4(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&ws(this._domNode)>fa){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=ws(this._findInput.domNode);return}if(fa+28+s>=i&&(r=!0),fa+28+s-v0>=i&&(a=!0),fa+28+s-v0>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ws(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!N.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(X6|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Q6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return J6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(X6|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Ms&&Zg&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("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(Z6,!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 Q6(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return J6(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 UN(null,this._contextViewProvider,{width:FNe,label:SNe,placeholder:xNe,appendCaseSensitiveLabel:this._keybindingLabelFor(Nt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Nt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Nt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>q6(this._keybindingService),inputBoxStyles:US,toggleStyles:$S},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(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Zn&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new cg({label:LNe+this._keybindingLabelFor(Nt.PreviousMatchFindAction),icon:wNe,onTrigger:()=>{xI(this._codeEditor.getAction(Nt.PreviousMatchFindAction)).run().then(void 0,pt)}})),this._nextBtn=this._register(new cg({label:DNe+this._keybindingLabelFor(Nt.NextMatchFindAction),icon:yNe,onTrigger:()=>{xI(this._codeEditor.getAction(Nt.NextMatchFindAction)).run().then(void 0,pt)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Vm({icon:_Ne,title:kNe+this._keybindingLabelFor(Nt.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:oe(hh),inputActiveOptionBorder:oe(V4),inputActiveOptionForeground:oe(H4)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new cg({label:ENe+this._keybindingLabelFor(Nt.CloseFindWidgetCommand),icon:w2e,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new jN(null,void 0,{label:INe,placeholder:ANe,appendPreserveCaseLabel:this._keybindingLabelFor(Nt.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>q6(this._keybindingService),inputBoxStyles:US,toggleStyles:$S},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new cg({label:TNe+this._keybindingLabelFor(Nt.ReplaceOneAction),icon:bNe,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new cg({label:NNe+this._keybindingLabelFor(Nt.ReplaceAllAction),icon:vNe,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new cg({label:MNe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ws(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=CNe,this._domNode.role="dialog",this._domNode.style.width=`${fa}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new En(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=fa;this._register(this._resizeSash.onDidStart(()=>{a=ws(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cd||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ws(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ws(this._domNode);if(l{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var s,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(s=this._opts).onKeyDown)===null||o===void 0||o.call(s,i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Ae.asClassNameArray(G6)),this._domNode.classList.add(...Ae.asClassNameArray(K6))):(this._domNode.classList.remove(...Ae.asClassNameArray(K6)),this._domNode.classList.add(...Ae.asClassNameArray(G6)))}}xr((n,e)=>{const t=(p,_)=>{_&&e.addRule(`.monaco-editor ${p} { background-color: ${_}; }`)};t(".findMatch",n.getColor(Pa)),t(".currentFindMatch",n.getColor(ebe)),t(".findScope",n.getColor(tbe));const i=n.getColor(Vi);t(".find-widget",i);const s=n.getColor($l);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(cj);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const r=n.getColor(ed);r&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Jl(n.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const a=n.getColor(ibe);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(nbe);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Jl(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(Je);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=n.getColor(Ra);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=n.getColor(w_e);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=n.getColor(j_e);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=n.getColor(Ig);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=n.getColor(eT);f&&e.addRule(` .monaco-editor .find-widget .button:not(.disabled):hover, .monaco-editor .find-widget .codicon-find-selection:hover { background-color: ${f} !important; } - `);const g=n.getColor(vo);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var oK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Br=function(n,e){return function(t,i){e(t,i,n)}},uf=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},ON;const vNe=524288;function FN(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(r))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const r=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),r&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!LD.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=pr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return uf(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const s=FN(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=pr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=FN(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new k_(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(m("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return uf(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};hs.ID="editor.contrib.findController";hs=ON=oK([Br(1,Je),Br(2,Of),Br(3,M1),Br(4,Ln)],hs);let BN=class extends hs{constructor(e,t,i,s,o,r,a,l){super(e,i,a,l,r),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return uf(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const s=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!s&&s.startLineNumber!==s.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||o,yield i._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new kD(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new DD(this._editor,this._state,this._keybindingService))}};BN=oK([Br(1,fu),Br(2,Je),Br(3,gi),Br(4,oo),Br(5,Ln),Br(6,Of),Br(7,M1)],BN);const wNe=lU(new aU({id:Nt.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:xe.or(z.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));wNe.addImplementation(0,(n,e,t)=>{const i=hs.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const yNe={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:m("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. + `);const g=n.getColor(bo);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var CK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vr=function(n,e){return function(t,i){e(t,i,n)}},uf=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},qN;const WNe=524288;function GN(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(r))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const r=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),r&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!MD.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=mr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return uf(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const s=GN(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=mr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=GN(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new I_(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(m("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return uf(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};us.ID="editor.contrib.findController";us=qN=CK([Vr(1,tt),Vr(2,Of),Vr(3,V1),Vr(4,Ln)],us);let KN=class extends us{constructor(e,t,i,s,o,r,a,l){super(e,i,a,l,r),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return uf(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const s=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!s&&s.startLineNumber!==s.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||o,yield i._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new PD(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new RD(this._editor,this._state,this._keybindingService))}};KN=CK([Vr(1,bu),Vr(2,tt),Vr(3,pi),Vr(4,oo),Vr(5,Ln),Vr(6,Of),Vr(7,V1)],KN);const VNe=LU(new xU({id:Nt.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:xe.or($.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));VNe.addImplementation(0,(n,e,t)=>{const i=us.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const HNe={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:m("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. The flag will not be saved for the future. 0: Do Nothing 1: True @@ -3330,17 +3389,17 @@ The flag will not be saved for the future. The flag will not be saved for the future. 0: Do Nothing 1: True -2: False`)},findInSelection:{type:"boolean"}}}}]};class CNe extends Yt{constructor(){super({id:Nt.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:yNe})}run(e,t,i){return uf(this,void 0,void 0,function*(){const s=hs.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}})}}class SNe extends Yt{constructor(){super({id:Nt.StartFindWithSelection,label:m("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return uf(this,void 0,void 0,function*(){const i=hs.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class rK extends Yt{run(e,t){return uf(this,void 0,void 0,function*(){const i=hs.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class xNe extends rK{constructor(){super({id:Nt.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:z.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:xe.and(z.focus,LD),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class LNe extends rK{constructor(){super({id:Nt.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:z.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:xe.and(z.focus,LD),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class DNe extends Yt{constructor(){super({id:Nt.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:mc}),this._highlightDecorations=[]}run(e,t,i){const s=hs.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Ln).notify({severity:Zj.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(BP).createInputBox();a.placeholder=m("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=s.getState().matchesCount;if(u>0&&u<=h)return u-1;if(u<0&&u>=-h)return h+u},c=d=>{const u=l(d);if(typeof u=="number"){a.validationMessage=void 0,s.goToMatch(u);const h=s.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:sn(Ave),position:Uo.Full}}}])})}}class aK extends Yt{run(e,t){return uf(this,void 0,void 0,function*(){const i=hs.get(t);if(!i)return;const s=FN(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class kNe extends aK{constructor(){super({id:Nt.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class ENe extends aK{constructor(){super({id:Nt.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const INe=lU(new aU({id:Nt.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:xe.or(z.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));INe.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=hs.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Cr(hs.ID,BN,0);Ye(CNe);Ye(SNe);Ye(xNe);Ye(LNe);Ye(DNe);Ye(kNe);Ye(ENe);const aa=vr.bindToContribution(hs.get);ke(new aa({id:Nt.CloseFindWidgetCommand,precondition:mc,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:xe.and(z.focus,xe.not("isComposing")),primary:9,secondary:[1033]}}));ke(new aa({id:Nt.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:ey.primary,mac:ey.mac,win:ey.win,linux:ey.linux}}));ke(new aa({id:Nt.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:ty.primary,mac:ty.mac,win:ty.win,linux:ty.linux}}));ke(new aa({id:Nt.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:iy.primary,mac:iy.mac,win:iy.win,linux:iy.linux}}));ke(new aa({id:Nt.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:ny.primary,mac:ny.mac,win:ny.win,linux:ny.linux}}));ke(new aa({id:Nt.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:sy.primary,mac:sy.mac,win:sy.win,linux:sy.linux}}));ke(new aa({id:Nt.ReplaceOneAction,precondition:mc,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:3094}}));ke(new aa({id:Nt.ReplaceOneAction,precondition:mc,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:xe.and(z.focus,n3),primary:3}}));ke(new aa({id:Nt.ReplaceAllAction,precondition:mc,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:2563}}));ke(new aa({id:Nt.ReplaceAllAction,precondition:mc,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:xe.and(z.focus,n3),primary:void 0,mac:{primary:2051}}}));ke(new aa({id:Nt.SelectAllMatchesAction,precondition:mc,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:z.focus,primary:515}}));const ay=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightTextBackground",{light:ay,dark:ay,hcDark:ay,hcLight:ay},m("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const ly=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:$t,hcLight:$t},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:$t,hcLight:$t},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",{light:ly,dark:ly,hcDark:ly,hcLight:ly},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const ANe=E("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),TNe=E("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},m("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),NNe=E("editorOverviewRuler.wordHighlightTextForeground",{dark:W0,light:W0,hcDark:W0,hcLight:W0},m("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);Qe.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sn(TNe),position:Uo.Center},minimap:{color:sn(UL),position:Ys.Inline}});Qe.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:sn(NNe),position:Uo.Center},minimap:{color:sn(UL),position:Ys.Inline}});const MNe=Qe.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sn(W0),position:Uo.Center},minimap:{color:sn(UL),position:Ys.Inline}}),RNe=Qe.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});Qe.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sn(ANe),position:Uo.Center},minimap:{color:sn(UL),position:Ys.Inline}});function PNe(n){return n?RNe:MNe}Sr((n,e)=>{const t=n.getColor(T4);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var ONe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},FNe=function(n,e){return function(t,i){e(t,i,n)}},WN;function mu(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);Eb(s)}}class BNe extends Yt{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,_n.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),mu(r,o.getCursorStates())}}class WNe extends Yt{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,_n.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),mu(r,o.getCursorStates())}}class VNe extends Yt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:m("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new lt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),mu(r,o.getCursorStates())}}class HNe extends Yt{constructor(){super({id:"editor.action.addCursorsToBottom",label:m("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new lt(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),mu(a,r.getCursorStates())}}class zNe extends Yt{constructor(){super({id:"editor.action.addCursorsToTop",label:m("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new lt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),mu(r,o.getCursorStates())}}class cy{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class cv{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new cv(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const u=e.getConfiguredWordAtPosition(l.getStartPosition());if(!u)return null;c=u.word,d=new lt(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new cv(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,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 cy(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 cy(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(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 cy(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 cy(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class hf extends K{static get(e){return e.getContribution(hf.ID)}constructor(e){super(),this._sessionDispose=this._register(new fe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=cv.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(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new lt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!lK(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}hf.ID="editor.contrib.multiCursorController";class Hm extends Yt{run(e,t){const i=hf.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=hs.get(t);if(r)this._run(i,r);else{const a=e.get(bt).createInstance(hs,t);this._run(i,a),a.dispose()}mu(o,s.getCursorStates())}}}class $Ne extends Hm{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:m("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:2082,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class UNe extends Hm{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:m("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class jNe extends Hm{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:m("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:Fn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class qNe extends Hm{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:m("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class GNe extends Hm{constructor(){super({id:"editor.action.selectHighlights",label:m("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:3114,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class KNe extends Hm{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:xe.and(z.writable,z.editorTextFocus),kbOpts:{kbExpr:z.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class YNe{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(N.compareRangesUsingStarts)),this._cachedFindMatches}}let dv=WN=class extends K{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Ci(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=hs.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(WN._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=hf.get(i);if(!o)return null;const r=hs.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const h=r.getState().matchCase;if(!lK(i.getModel(),d,h))return null}a=cv.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.getState(),c=l.matchCase;if(l.isRevealed){let d=l.searchString;c||(d=d.toLowerCase());let u=a.searchText;if(c||(u=u.toLowerCase()),d===u&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new YNe(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(N.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=N.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!N.areIntersecting(h,s[c]))&&o.push(h),l++):(f>0||l++,c++)}}const r=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:PNe(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};dv.ID="editor.contrib.selectionHighlighter";dv=WN=ONe([FNe(1,nt)],dv);function lK(n,e,t){const i=H6(n,e[0],!t);for(let s=1,o=e.length;sthis._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new lt(r.lineNumber,r.column,r.lineNumber,r.column):new lt(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(N.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new lt(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let u=0,h=e.length;u1&&o.sort(V.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;us.target.position?s.target.position.lineNumber:0,this._opts=$6(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(s=>{if(s.hasChanged(77)){const o=$6(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(s=>this._onEditorMouseMove(new Z2(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new Z2(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new Z2(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new z6(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new z6(s,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(s=>this._onDidChangeCursorSelection(s))),this._register(this._editor.onDidChangeModel(s=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(s=>{(s.scrollTopChanged||s.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var sMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fl=function(n,e){return function(t,i){e(t,i,n)}};let bm=class extends cm{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},s.getRawOptions()),{overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()}),i,o,r,a,l,c,d,u,h,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){pL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};bm=sMe([fl(4,bt),fl(5,zt),fl(6,gs),fl(7,Je),fl(8,oo),fl(9,Ln),fl(10,uu),fl(11,no),fl(12,nt)],bm);const U6=new H(new ut(0,122,204)),oMe={showArrow:!0,showFrame:!0,className:"",frameColor:U6,arrowColor:U6,keepEditorSelection:!1},rMe="vs.editor.contrib.zoneWidget";class aMe{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class lMe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class ED{constructor(e){this._editor=e,this._ruleName=ED._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),xF(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){xF(this._ruleName),wA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:N.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}ED._IdGenerator=new mP(".arrow-decoration-");class cMe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new fe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=yl(t),pL(this.options,oMe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new ED(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=N.isIRange(e)?N.lift(e):N.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Qe.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new aMe(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new lMe(rMe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new N(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new En(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var cK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dK=function(n,e){return function(t,i){e(t,i,n)}};const uK=at("IPeekViewService");ht(uK,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var Js;(function(n){n.inPeekEditor=new me("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Js||(Js={}));let uv=class{constructor(e,t){e instanceof bm&&Js.inPeekEditor.bindTo(t)}dispose(){}};uv.ID="editor.contrib.referenceController";uv=cK([dK(1,Je)],uv);Cr(uv.ID,uv,0);function dMe(n){const e=n.get(zt).getFocusedCodeEditor();return e instanceof bm?e.getParentEditor():e}const uMe={headerBackgroundColor:H.white,primaryHeadingColor:H.fromHex("#333333"),secondaryHeadingColor:H.fromHex("#6c6c6cb3")};let lx=class extends cMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,pL(this.options,uMe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=we(".head"),this._bodyElement=we(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=we(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Hi(this._titleElement,"click",o=>this._onTitleClick(o))),re(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=we("span.filename"),this._secondaryHeading=we("span.dirname"),this._metaHeading=we("span.meta"),re(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=we(".peekview-actions");re(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Xa(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xo("peekview.close",m("label.close","Close"),Ae.asClassName(ie.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:XLe.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Do(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ih(this._metaHeading)):qc(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};lx=cK([dK(2,bt)],lx);const hMe=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewTitleBackground","Background color of the peek view title area.")),hK=E("peekViewTitleLabel.foreground",{dark:H.white,light:H.black,hcDark:H.white,hcLight:hu},m("peekViewTitleForeground","Color of the peek view title.")),fK=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),fMe=E("peekView.border",{dark:Es,light:Es,hcDark:Xe,hcLight:Xe},m("peekViewBorder","Color of the peek view borders and arrow.")),gMe=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewResultsBackground","Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:H.white,hcLight:hu},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:H.white,light:"#1E1E1E",hcDark:H.white,hcLight:hu},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:H.white,light:"#6C6C6C",hcDark:H.white,hcLight:hu},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const rd=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:H.black,hcLight:H.white},m("peekViewEditorBackground","Background color of the peek view editor."));E("peekViewEditorGutter.background",{dark:rd,light:rd,hcDark:rd,hcLight:rd},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",{dark:rd,light:rd,hcDark:rd,hcLight:rd},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var pMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class qd{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=DT.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?m({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,ea(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",ea(this.uri),this.range.startLineNumber,this.range.startColumn)}}class mMe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new N(s,l.startColumn,s,o),d=new N(r,a,r,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class hv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tn}dispose(){Pt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m("aria.fileReferences.1","1 symbol in {0}, full path {1}",ea(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,ea(this.uri),this.uri.fsPath)}resolve(e){return pMe(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new mMe(i))}catch(i){pt(i)}return this})}}class Zs{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new B,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Zs._compareReferences);let s;for(const o of e)if((!s||!Vt.isEqual(s.uri,o.uri,!0))&&(s=new hv(this,o.uri),this.groups.push(s)),s.children.length===0||Zs._compareReferences(o,s.children[s.children.length-1])!==0){const r=new qd(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Pt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Zs(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m("aria.result.0","No results found"):this.references.length===1?m("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:ZC(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&N.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vt.compare(e.uri,t.uri)||N.compareRangesUsingStarts(e.range,t.range)}}var ID=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},AD=function(n,e){return function(t,i){e(t,i,n)}},HN;let zN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Zs||e instanceof hv}getChildren(e){if(e instanceof Zs)return e.groups;if(e instanceof hv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};zN=ID([AD(0,au)],zN);class _Me{getHeight(){return 23}getTemplateId(e){return e instanceof hv?fv.id:O1.id}}let $N=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof qd){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return ea(e.uri)}};$N=ID([AD(0,gi)],$N);class bMe{getId(e){return e instanceof qd?e.id:e.uri}}let UN=class extends K{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new ZT(i,{supportHighlights:!0})),this.badge=new YT(re(i,we(".count")),{},Oq),e.appendChild(i)}set(e,t){const i=G4(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(m("referencesCount","{0} references",s)):this.badge.setTitleFormat(m("referenceCount","{0} reference",s))}};UN=ID([AD(1,iD)],UN);let fv=HN=class{constructor(e){this._instantiationService=e,this.templateId=HN.id}renderTemplate(e){return this._instantiationService.createInstance(UN,e)}renderElement(e,t,i){i.set(e.element,hP(e.filterData))}disposeTemplate(e){e.dispose()}};fv.id="FileReferencesRenderer";fv=HN=ID([AD(0,bt)],fv);class vMe{constructor(e){this.label=new bd(e)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${ea(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=s;t&&!Oh.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,hP(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class O1{constructor(){this.templateId=O1.id}renderTemplate(e){return new vMe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}O1.id="OneReferenceRenderer";class wMe{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var yMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gl=function(n,e){return function(t,i){e(t,i,n)}},j6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class TD{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new fe,this._callOnModelChange=new fe,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(SMe,"ReferencesWidget",this._treeContainer,new _Me,[this._instantiationService.createInstance(fv),this._instantiationService.createInstance(O1)],this._instantiationService.createInstance(zN),i),this._splitView.addView({onDidChange:de.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},KS.Distribute),this._splitView.addView({onDidChange:de.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},KS.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof qd&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),qc(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Zt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=m("noResults","No results"),Ih(this._messageContainer),Promise.resolve(void 0)):(qc(this._messageContainer),this._decorationsManager=new TD(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Ih(this._treeContainer),Ih(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof qd)return e;if(e instanceof hv&&e.children.length>0)return e.children[0]}revealReference(e){return j6(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return j6(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==it.inMemory?this.setTitle(Wwe(e.uri),this._uriLabel.getUriLabel(G4(e.uri))):this.setTitle(m("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const s=yield i;if(!this._model){s.dispose();return}Pt(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=N.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};jN=yMe([gl(3,oo),gl(4,au),gl(5,bt),gl(6,uK),gl(7,iD),gl(8,QL),gl(9,gi),gl(10,ki),gl(11,no)],jN);var xMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dg=function(n,e){return function(t,i){e(t,i,n)}},q6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},tC;const Hf=new me("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let vm=tC=class{static get(e){return e.getContribution(tC.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new fe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Hf.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=CMe.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(jN,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new V(e.startLineNumber,e.startColumn),h=this._model.nearestReference(d,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return q6(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return q6(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const s=N.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:s,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var r;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(s),this._widget.focusOnReferenceTree();else{const a=tC.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,uc(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,pt(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};vm.ID="editor.contrib.referencesController";vm=tC=xMe([dg(2,Je),dg(3,zt),dg(4,Ln),dg(5,bt),dg(6,Of),dg(7,Jt)],vm);function zf(n,e){const t=dMe(n);if(!t)return;const i=vm.get(t);i&&e(i)}Os.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Fn(2089,60),when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Os.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.goToNextOrPreviousReference(!0)})}});Os.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.goToNextOrPreviousReference(!1)})}});qt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");qt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");qt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");qt.registerCommand("closeReferenceSearch",n=>zf(n,e=>e.closeWidget()));Os.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:xe.and(Js.inPeekEditor,xe.not("config.editor.stablePeek"))});Os.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:xe.and(Hf,xe.not("config.editor.stablePeek"))});Os.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:xe.and(Hf,nG,NP.negate(),MP.negate()),handler(n){var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof qd&&zf(n,s=>s.revealReference(i[0]))}});Os.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:xe.and(Hf,nG,NP.negate(),MP.negate()),handler(n){var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof qd&&zf(n,s=>s.openReference(i[0],!0,!0))}});qt.registerCommand("openReference",n=>{var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof qd&&zf(n,s=>s.openReference(i[0],!1,!0))});var gK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q0=function(n,e){return function(t,i){e(t,i,n)}};const o3=new me("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),ND=at("ISymbolNavigationService");let qN=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=o3.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new GN(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(q4(u.uri,a.uri))c=!0,d=d||N.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=ur(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:N.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?m("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):m("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};qN=gK([q0(0,Je),q0(1,zt),q0(2,Ln),q0(3,gi)],qN);ht(ND,qN,1);ke(new class extends vr{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:o3,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(ND).revealNext(e)}});Os.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:o3,primary:9,handler(n){n.get(ND).reset()}});let GN=class{constructor(e){this._listener=new Map,this._disposables=new fe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Pt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,ur(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};GN=gK([q0(0,zt)],GN);var LMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},G6=function(n,e){return function(t,i){e(t,i,n)}},pK=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},KN;let gv=KN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new fe,o=s.add(sD(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,s)=>pK(this,void 0,void 0,function*(){var o,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=Vo);const c=yield cCe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=KN._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);Mn(d,u)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>mK(this._openerService,i,e.isTrusted),disposables:t}}}};gv._ttpTokenizer=If("tokenizeToString",{createHTML(n){return n}});gv=KN=LMe([G6(1,ki),G6(2,fc)],gv);function mK(n,e,t){return pK(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:DMe(t)})}catch(i){return pt(i),!1}})}function DMe(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var kMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},K6=function(n,e){return function(t,i){e(t,i,n)}},iC;let fr=iC=class{static get(e){return e.getContribution(iC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Qr,this._messageListeners=new fe,this._mouseOverMessage=!1,this._editor=e,this._visible=iC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){_1(md(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=md(e)?sD(e,{actionHandler:{callback:s=>mK(this._openerService,s,md(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Y6(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(de.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Cn(Gr(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(G(this._messageWidget.value.getDomNode(),le.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(G(this._messageWidget.value.getDomNode(),le.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new N(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Y6.fadeOut(this._messageWidget.value))}};fr.ID="editor.contrib.messageController";fr.MESSAGE_VISIBLE=new me("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));fr=iC=kMe([K6(1,Je),K6(2,fc)],fr);const EMe=vr.bindToContribution(fr.get);ke(new EMe({id:"leaveEditorMessage",precondition:fr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let Y6=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Cr(fr.ID,fr,4);var r3=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function F1(n,e,t,i){return r3(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{lc(l)})),r=yield Promise.all(o);return fL(r.flat())})}function a3(n,e,t,i){return F1(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function _K(n,e,t,i){return F1(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function bK(n,e,t,i){return F1(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function vK(n,e,t,i){return F1(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function MD(n,e,t,i,s){return F1(e,t,n,(o,r,a)=>r3(this,void 0,void 0,function*(){const l=yield o.provideReferences(r,a,{includeDeclaration:!0},s);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(r,a,{includeDeclaration:!1},s);return c&&c.length===1?c:l}))}function B1(n){return r3(this,void 0,void 0,function*(){const e=yield n(),t=new Zs(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}Mm("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=a3(i.definitionProvider,e,t,rn.None);return B1(()=>s)});Mm("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=vK(i.typeDefinitionProvider,e,t,rn.None);return B1(()=>s)});Mm("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(nt),s=_K(i.declarationProvider,e,t,rn.None);return B1(()=>s)});Mm("_executeReferenceProvider",(n,e,t)=>{const i=n.get(nt),s=MD(i.referenceProvider,e,t,!1,rn.None);return B1(()=>s)});Mm("_executeImplementationProvider",(n,e,t)=>{const i=n.get(nt),s=bK(i.implementationProvider,e,t,rn.None);return B1(()=>s)});var gr=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},b0,v0,w0,uy,hy,fy,gy,py;or.appendMenuItem(A.EditorContext,{submenu:A.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class cx{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof cx||V.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class ns extends Kge{static all(){return ns._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of dt.wrap(t.menu))(i.id===A.EditorContext||i.id===A.EditorContextPeek)&&(i.when=xe.and(e.precondition,i.when));return t}constructor(e,t){super(ns._patchConfig(t)),this.configuration=e,ns._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Ln),r=e.get(zt),a=e.get(x1),l=e.get(ND),c=e.get(nt),d=e.get(bt),u=t.getModel(),h=t.getPosition(),f=cx.is(i)?i:new cx(u,h),g=new hAe(t,5),p=Qge(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>gr(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;_1(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const y=this._getAlternativeCommand(t);!ns._activeAlternativeCommands.has(y)&&ns._allSymbolNavigationCommands.has(y)&&(b=ns._allSymbolNavigationCommands.get(y))}const w=_.references.length;if(w===0){if(!this.configuration.muteMessage){const y=u.getWordAtPosition(h);(v=fr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(y),h)}}else if(w===1&&b)ns._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,s).finally(()=>{ns._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,s)}),_=>{o.error(_)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,i,s,o){return gr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof bm)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,s,o){return gr(this,void 0,void 0,function*(){let r;if(tfe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:N.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const s=vm.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),uc(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}ns._allSymbolNavigationCommands=new Map;ns._activeAlternativeCommands=new Set;class RD extends ns{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield a3(e.definitionProvider,t,i,s),m("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("noResultWord","No definition found for '{0}'",e.word):m("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Fs((b0=class extends RD{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:b0.id,title:{value:m("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:m({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:xe.and(z.hasDefinitionProvider,z.isInWalkThroughSnippet.toNegated()),keybinding:[{when:z.editorTextFocus,primary:70,weight:100},{when:xe.and(z.editorTextFocus,eG),primary:2118,weight:100}],menu:[{id:A.EditorContext,group:"navigation",order:1.1},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),qt.registerCommandAlias("editor.action.goToDeclaration",b0.id)}},b0.id="editor.action.revealDefinition",b0));Fs((v0=class extends RD{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:v0.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:xe.and(z.hasDefinitionProvider,z.isInWalkThroughSnippet.toNegated()),keybinding:[{when:z.editorTextFocus,primary:Fn(2089,70),weight:100},{when:xe.and(z.editorTextFocus,eG),primary:Fn(2089,2118),weight:100}]}),qt.registerCommandAlias("editor.action.openDeclarationToTheSide",v0.id)}},v0.id="editor.action.revealDefinitionAside",v0));Fs((w0=class extends RD{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:w0.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:xe.and(z.hasDefinitionProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),keybinding:{when:z.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:A.EditorContextPeek,group:"peek",order:2}}),qt.registerCommandAlias("editor.action.previewDeclaration",w0.id)}},w0.id="editor.action.peekDefinition",w0));class wK extends ns{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield _K(e.declarationProvider,t,i,s),m("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Fs((uy=class extends wK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:uy.id,title:{value:m("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:m({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:xe.and(z.hasDeclarationProvider,z.isInWalkThroughSnippet.toNegated()),menu:[{id:A.EditorContext,group:"navigation",order:1.3},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}},uy.id="editor.action.revealDeclaration",uy));Fs(class extends wK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:xe.and(z.hasDeclarationProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:3}})}});class yK extends ns{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield vK(e.typeDefinitionProvider,t,i,s),m("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):m("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Fs((hy=class extends yK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:hy.ID,title:{value:m("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:m({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:xe.and(z.hasTypeDefinitionProvider,z.isInWalkThroughSnippet.toNegated()),keybinding:{when:z.editorTextFocus,primary:0,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.4},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},hy.ID="editor.action.goToTypeDefinition",hy));Fs((fy=class extends yK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:fy.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:xe.and(z.hasTypeDefinitionProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:4}})}},fy.ID="editor.action.peekTypeDefinition",fy));class CK extends ns{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield bK(e.implementationProvider,t,i,s),m("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):m("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Fs((gy=class extends CK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:gy.ID,title:{value:m("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:m({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:xe.and(z.hasImplementationProvider,z.isInWalkThroughSnippet.toNegated()),keybinding:{when:z.editorTextFocus,primary:2118,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.45},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},gy.ID="editor.action.goToImplementation",gy));Fs((py=class extends CK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:py.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:xe.and(z.hasImplementationProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),keybinding:{when:z.editorTextFocus,primary:3142,weight:100},menu:{id:A.EditorContextPeek,group:"peek",order:5}})}},py.ID="editor.action.peekImplementation",py));class SK extends ns{_getNoResultFoundMessage(e){return e?m("references.no","No references found for '{0}'",e.word):m("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Fs(class extends SK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:m("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:m({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:xe.and(z.hasReferenceProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),keybinding:{when:z.editorTextFocus,primary:1094,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.45},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield MD(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Fs(class extends SK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:m("references.action.label","Peek References"),original:"Peek References"},precondition:xe.and(z.hasReferenceProvider,Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(yield MD(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class IMe extends ns{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:m("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:xe.and(Js.notInPeekEditor,z.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Zs(this._references,m("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&m("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}qt.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:$e},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,o,r)=>gr(void 0,void 0,void 0,function*(){Ls($e.isUri(e)),Ls(V.isIPosition(t)),Ls(Array.isArray(i)),Ls(typeof s>"u"||typeof s=="string"),Ls(typeof r>"u"||typeof r=="boolean");const a=n.get(zt),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(HG(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends IMe{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(bt).invokeFunction(d.run.bind(d),l)})})});qt.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:$e},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>gr(void 0,void 0,void 0,function*(){n.get(gs).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});qt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Ls($e.isUri(e)),Ls(V.isIPosition(t));const i=n.get(nt),s=n.get(zt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!HG(o)||!o.hasModel())return;const r=vm.get(o);if(!r)return;const a=uc(c=>MD(i.referenceProvider,o.getModel(),V.lift(t),!1,c).then(d=>new Zs(d,m("ref.title","References")))),l=new N(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});qt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var AMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X2=function(n,e){return function(t,i){e(t,i,n)}},Z6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},G0;let ff=G0=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new fe,this.toUnhookForKeyboard=new fe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new nMe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{pt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(G0.ID)}startFindDefinitionFromCursor(e){return Z6(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return Z6(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const s=new uAe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=uc(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){pt(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?N.lift(o[0].originSelectionRange):new N(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=N.plusRange(a,l));this.addDecoration(a,new hm().appendText(m("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const u=this.getPreviewValue(c,d,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,u?new hm().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=G0.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new RD({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Je);return Js.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};ff.ID="editor.contrib.gotodefinitionatposition";ff.MAX_SOURCE_PREVIEW_LINES=8;ff=G0=AMe([X2(1,au),X2(2,ki),X2(3,nt)],ff);Cr(ff.ID,ff,2);const my=we;class xK extends K{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new B4(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class l3 extends K{static render(e,t,i){return new l3(e,t,i)}constructor(e,t,i){super(),this.actionContainer=re(e,my("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=re(this.actionContainer,my("a.action")),this.action.setAttribute("role","button"),t.iconClass&&re(this.action,my(`span.icon.${t.iconClass}`));const s=re(this.action,my("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(G(this.actionContainer,le.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(G(this.actionContainer,le.KEY_DOWN,o=>{const r=new Wt(o);(r.equals(3)||r.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function TMe(n,e){return n&&e?m("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?m("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var NMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},MMe=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};let RMe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class LK extends K{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Ci(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Ci(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Ci(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=spe(e=>this._computer.computeAsync(e)),NMe(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=MMe(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;o=!0){s=a.value,o=!1;const l=s;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){pt(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new RMe(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class Q2{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}const c3=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class PMe{constructor(){this._onDidWillResize=new B,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new B,this.onDidResize=this._onDidResize.event,this._sashListener=new fe,this._size=new Zt(0,0),this._minSize=new Zt(0,0),this._maxSize=new Zt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new En(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new En(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new En(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:qS.North}),this._southSash=new En(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:qS.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(de.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(de.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(de.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(de.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Zt(t,e);Zt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const OMe=30,FMe=24;class BMe extends K{constructor(e,t=new Zt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new PMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Zt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Zt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?V.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Nn(t).top+i.top-OMe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Nn(t),o=AL(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-FMe}_findPositionPreference(e,t){var i,s;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((s=this._availableVerticalSpaceAbove(t))!==null&&s!==void 0?s:1/0,e),a=Math.min(Math.max(r,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=r?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var d3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fh=function(n,e){return function(t,i){e(t,i,n)}},nC,ga;const X6=we;let dx=nC=class extends K{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(yd,this._editor)),this._participants=[];for(const s of c3.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new ux(this._editor,this._participants),this._hoverOperation=this._register(new LK(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new DK(this._computer.anchor,o,s.isComplete))})),this._register(Hi(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(vi.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new Q2(0,i.range,e.event.posx,e.event.posy)),i.type===7){const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new Q2(0,e,void 0,void 0),t,i,s,null)}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=nC.computeHoverRanges(this._editor,e.range,t),r=new fe,a=r.add(new YN(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&r.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:nC._DECORATION_OPTIONS}]),r.add(Ke(()=>{h.clear()}))}this._widget.showAt(l,new VMe(c,i,s,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new V(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));s=d.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const c of i)a=N.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(r=Math.max(Math.min(r,c.range.startColumn),s)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new V(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new V(o,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};dx._DECORATION_OPTIONS=Qe.register({description:"content-hover-highlight",className:"hoverHighlight"});dx=nC=d3([fh(1,bt),fh(2,gi)],dx);class DK{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new WMe(this,this.anchor,t,this.isComplete)}}class WMe extends DK{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class VMe{constructor(e,t,i,s,o,r,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=s,this.stoleFocus=o,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const Q6=30,J2=10,HMe=6;let yd=ga=class extends BMe{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,s,o){const r=e.getOption(66)+8,a=150,l=new Zt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new xK),this._minimumSize=l,this._hoverVisibleKey=z.hoverVisible.bindTo(t),this._hoverFocusedKey=z.hoverFocused.bindTo(t),re(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const c=this._register(Vd(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return ga.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return ga._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return ga._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){ga._applyMaxDimensions(this._hover.contentsDomNode,e,t),ga._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-J2))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Zt(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;ga._lastDimensions=new Zt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=HMe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=J2),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Nn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=J6(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=J6(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,ga._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,ga._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,s,o,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=ah(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(s=t.colorPicker)===null||s===void 0||s.layout();const c=TMe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Zt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,s=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ys(i),Math.min(o,e)),this._setContentsDomNodeDimensions(ys(s),Math.min(o,e-J2))}setMinimumDimensions(e){this._minimumSize=new Zt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Zt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=ah(t),s=ys(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=ah(t),s=ys(t),this._contentWidth=s,this._updateMinimumWidth(),this._resizableNode.layout(i,s),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=ah(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-Q6})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+Q6})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};yd.ID="editor.contrib.resizableContentHoverWidget";yd._lastDimensions=new Zt(0,0);yd=ga=d3([fh(1,Je),fh(2,Jt),fh(3,uu),fh(4,gi)],yd);let YN=class extends K{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=X6("div.hover-row.status-bar"),this.actionsElement=re(this.hoverElement,X6("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(l3.render(this.actionsElement,e,i))}append(e){const t=re(this.actionsElement,e);return this._hasContent=!0,t}};YN=d3([fh(0,gi)],YN);class ux{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return ln.EMPTY;const i=ux._getLineDecorations(this._editor,t);return ln.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):ln.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=ux._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return fL(t)}}function J6(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const eB=we;class vp extends K{constructor(e,t,i){super(),this._renderDisposeables=this._register(new fe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new xK),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new gv({editor:this._editor},t,i)),this._computer=new zMe(this._editor),this._hoverOperation=this._register(new LK(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return vp.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=eB("div.hover-row.markdown-hover"),r=re(o,eB("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}vp.ID="editor.contrib.modesGlyphHoverWidget";class zMe{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=s=>({value:s}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const s of t){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||Kb(o)||i.push(...Jz(o).map(e))}return i}}var $Me=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class UMe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function jMe(n,e,t,i,s){return $Me(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&GMe(o))return new UMe(n,o,e)}catch(o){lc(o)}})}function kK(n,e,t,i){const o=n.ordered(e).map((r,a)=>jMe(r,a,e,t,i));return ln.fromPromises(o).coalesce()}function qMe(n,e,t,i){return kK(n,e,t,i).map(s=>s.hover).toPromise()}Mm("_executeHoverProvider",(n,e,t)=>{const i=n.get(nt);return qMe(i.hoverProvider,e,t,rn.None)});function GMe(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var KMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_y=function(n,e){return function(t,i){e(t,i,n)}};const tB=we;class y0{constructor(e,t,i,s,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let ZN=class{constructor(e,t,i,s,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new y0(this,e.range,[new hm().appendText(m("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;d>=0&&l>d&&e.range.startColumn>=d&&(h=!0,r.push(new y0(this,e.range,[{value:m("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new y0(this,e.range,[{value:m("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,_=g.range.endLineNumber===s?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||Kb(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new N(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new y0(this,b,Jz(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ln.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return ln.EMPTY;const o=new V(e.range.startLineNumber,e.range.startColumn);return kK(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!Kb(r.hover.contents)).map(r=>{const a=r.hover.range?N.lift(r.hover.range):e.range;return new y0(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return YMe(e,t,this._editor,this._languageService,this._openerService)}};ZN=KMe([_y(1,ki),_y(2,fc),_y(3,Jt),_y(4,nt)],ZN);function YMe(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new fe;for(const r of e)for(const a of r.contents){if(Kb(a))continue;const l=tB("div.hover-row.markdown-hover"),c=re(l,tB("div.hover-contents")),d=o.add(new gv({editor:t},i,s));o.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const u=o.add(d.render(a));c.appendChild(u.element),n.fragment.appendChild(l)}return o}var ZMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Fe{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+Fe.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Fe(this.value+Fe.sep+e)}}Fe.sep=".";Fe.None=new Fe("@@none@@");Fe.Empty=new Fe("");Fe.QuickFix=new Fe("quickfix");Fe.Refactor=new Fe("refactor");Fe.RefactorExtract=Fe.Refactor.append("extract");Fe.RefactorInline=Fe.Refactor.append("inline");Fe.RefactorMove=Fe.Refactor.append("move");Fe.RefactorRewrite=Fe.Refactor.append("rewrite");Fe.Notebook=new Fe("notebook");Fe.Source=new Fe("source");Fe.SourceOrganizeImports=Fe.Source.append("organizeImports");Fe.SourceFixAll=Fe.Source.append("fixAll");Fe.SurroundWith=Fe.Refactor.append("surround");var Gd;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(Gd||(Gd={}));function XMe(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>EK(e,t,n.include))||!n.includeSourceActions&&Fe.Source.contains(e))}function QMe(n,e){const t=e.kind?new Fe(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>EK(t,i,n.include))||!n.includeSourceActions&&t&&Fe.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function EK(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Zu{static fromUser(e,t){return!e||typeof e!="object"?new Zu(t.kind,t.apply,!1):new Zu(Zu.getKindFromUser(e,t.kind),Zu.getApplyFromUser(e,t.apply),Zu.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Fe(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class JMe{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return ZMe(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(s){lc(s)}i&&(this.action.edit=i.edit)}return this})}}var hx=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const eRe="editor.action.codeAction",IK="editor.action.quickFix",tRe="editor.action.autoFix",iRe="editor.action.refactor",nRe="editor.action.sourceAction",AK="editor.action.organizeImports",TK="editor.action.fixAll";class E_ extends K{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Gl(e.diagnostics)?Gl(t.diagnostics)?E_.codeActionsPreferredComparator(e,t):-1:Gl(t.diagnostics)?1:E_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(E_.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Fe.QuickFix.contains(new Fe(e.kind))&&!!e.isPreferred)}}const iB={actions:[],documentation:void 0};function I_(n,e,t,i,s,o){var r;return hx(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Fe.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new fAe(e,o),u=i.type===2,h=sRe(n,e,u?l:a),f=new fe,g=h.map(_=>hx(this,void 0,void 0,function*(){try{s.report(_);const v=yield _.provideCodeActions(e,t,c,d.token);if(v&&f.add(v),d.token.isCancellationRequested)return iB;const b=((v==null?void 0:v.actions)||[]).filter(y=>y&&QMe(a,y)),w=rRe(_,b,a.include);return{actions:b.map(y=>new JMe(y,_)),documentation:w}}catch(v){if(Cf(v))throw v;return lc(v),iB}})),p=n.onDidChange(()=>{const _=n.all(e);Ki(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(w=>w.actions).flat(),b=[...fL(_.map(w=>w.documentation)),...oRe(n,e,i,v)];return new E_(v,b,f)}finally{p.dispose(),d.dispose()}})}function sRe(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>XMe(t,new Fe(s))):!0)}function*oRe(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(s=a._getAdditionalMenuItems)===null||s===void 0?void 0:s.call(a,{trigger:t.type,only:(r=(o=t.filter)===null||o===void 0?void 0:o.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function rRe(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new Fe(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new Fe(s.kind)))return o.command}}var fx;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(fx||(fx={}));function aRe(n,e,t,i,s=rn.None){var o;return hx(this,void 0,void 0,function*(){const r=n.get(hq),a=n.get(gs),l=n.get(cc),c=n.get(Ln);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(s),!s.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==fx.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=lRe(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function lRe(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}qt.registerCommand("_executeCodeActionProvider",function(n,e,t,i,s){return hx(this,void 0,void 0,function*(){if(!(e instanceof $e))throw Kl();const{codeActionProvider:o}=n.get(nt),r=n.get(fs).getModel(e);if(!r)throw Kl();const a=lt.isISelection(t)?lt.liftSelection(t):N.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Kl();const l=typeof i=="string"?new Fe(i):void 0,c=yield I_(o,r,a,{type:1,triggerAction:Gd.Default,filter:{includeSourceActions:!0,include:l}},hp.None,rn.None),d=[],u=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var cRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dRe=function(n,e){return function(t,i){e(t,i,n)}},XN;let gx=XN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Sf(()=>this.keybindingService.getKeybindings().filter(t=>XN.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===AK?i={kind:Fe.SourceOrganizeImports.value}:t.command===TK&&(i={kind:Fe.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Zu.fromUser(i,{kind:Fe.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Fe(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}};gx.codeActionCommands=[iRe,eRe,nRe,AK,TK];gx=XN=cRe([dRe(0,gi)],gx);E("symbolIcon.arrayForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const NK=Object.freeze({kind:Fe.Empty,title:m("codeAction.widget.id.more","More Actions...")}),uRe=Object.freeze([{kind:Fe.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:Fe.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:ie.wrench},{kind:Fe.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:ie.wrench},{kind:Fe.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:ie.wrench},{kind:Fe.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:ie.wrench},{kind:Fe.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:ie.symbolSnippet},{kind:Fe.Source,title:m("codeAction.widget.id.source","Source Action"),icon:ie.symbolFile},NK]);function hRe(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:NK,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((r=o.action.edit)===null||r===void 0)&&r.edits.length)}});const i=uRe.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new Fe(o.action.kind):Fe.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions)s.push({kind:"action",item:r,group:o.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return s}var fRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gRe=function(n,e){return function(t,i){e(t,i,n)}},QN,Ug;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(Ug||(Ug={}));let pv=QN=class extends K{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new B),this.onClick=this._onClick.event,this._state=Ug.Hidden,this._domNode=we("div.lightBulbWidget"),this._register(Tt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(Tge(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Nn(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(de.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(tRe))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(IK))===null||o===void 0?void 0:o.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=s.get(50),d=o.getLineContent(r),u=ZL(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=r;if(!h){if(r>1&&!f(r-1))g-=1;else if(!f(r+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new Ug.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:QN._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Ug.Hidden&&(this.state=Ug.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...Ae.asClassNameArray(ie.lightBulb)),this._domNode.classList.add(...Ae.asClassNameArray(ie.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Ae.asClassNameArray(ie.lightbulbAutofix)),this._domNode.classList.add(...Ae.asClassNameArray(ie.lightBulb)),this._quickFixKbLabel?this.title=m("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=m("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};pv.ID="editor.contrib.lightbulbWidget";pv._posPref=[0];pv=QN=fRe([gRe(1,gi)],pv);var MK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},JN=function(n,e){return function(t,i){e(t,i,n)}},pRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const RK="acceptSelectedCodeAction",PK="previewSelectedCodeAction";class mRe{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s,o;i.text.textContent=(o=(s=e.group)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let eM=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new A1(e,bo);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){var s,o,r;if(!((s=e.group)===null||s===void 0)&&s.icon?(i.icon.className=Ae.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=oe(e.group.icon.color.id))):(i.icon.className=Ae.asClassName(ie.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=OK(e.label),i.keybinding.set(e.keybinding),zge(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(RK))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(PK))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=m({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=m({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};eM=MK([JN(1,gi)],eM);class _Re extends UIEvent{constructor(){super("acceptSelectedAction")}}class nB extends UIEvent{constructor(){super("previewSelectedAction")}}function bRe(n){if(n.kind==="action")return n.label}let tM=class extends K{constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new yr),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new ra(e,this.domNode,a,[new eM(t,this._keybindingService),new mRe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:bRe},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?OK(l==null?void 0:l.label):"";return l.disabled&&(c=m({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>m({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Ff),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);const o=this._allMenuItems.map((c,d)=>{const u=document.getElementById(this._list.getElementID(d));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0}),r=Math.max(...o,e),a=.7,l=Math.min(s,document.body.clientHeight*a);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new nB:new _Re;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof nB):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const s=i[0],o=this._list.element(s);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return pRe(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};tM=MK([JN(4,fu),JN(5,gi)],tM);function OK(n){return n.replace(/\r\n|\r|\n/g," ")}var vRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eE=function(n,e){return function(t,i){e(t,i,n)}};E("actionBar.toggledBackground",{dark:lh,light:lh,hcDark:lh,hcLight:lh},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const gf={Visible:new me("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},$f=at("actionWidgetService");let pf=class extends K{get isVisible(){return gf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Qr)}show(e,t,i,s,o,r,a){const l=gf.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(tM,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a??[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var s;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new fe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(G(l,le.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(G(d,le.POINTER_MOVE,()=>d.remove())),r.add(G(d,le.MOUSE_DOWN,()=>d.remove()));let u=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),r.add(g),u=g.getContainer().offsetWidth)}const h=(s=this._list.value)===null||s===void 0?void 0:s.layout(u);o.style.width=`${h}px`;const f=r.add(Vd(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=we(e),s=new Xa(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};pf=vRe([eE(0,fu),eE(1,Je),eE(2,bt)],pf);ht($f,pf,1);const W1=100+1e3;Fs(class extends Nm{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:gf.Visible,keybinding:{weight:W1,primary:9,secondary:[1033]}})}run(n){n.get($f).hide()}});Fs(class extends Nm{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:gf.Visible,keybinding:{weight:W1,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get($f);e instanceof pf&&e.focusPrevious()}});Fs(class extends Nm{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:gf.Visible,keybinding:{weight:W1,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get($f);e instanceof pf&&e.focusNext()}});Fs(class extends Nm{constructor(){super({id:RK,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:gf.Visible,keybinding:{weight:W1,primary:3,secondary:[2137]}})}run(n){const e=n.get($f);e instanceof pf&&e.acceptSelected()}});Fs(class extends Nm{constructor(){super({id:PK,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:gf.Visible,keybinding:{weight:W1,primary:2051}})}run(n){const e=n.get($f);e instanceof pf&&e.acceptSelected(!0)}});var wRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const yRe=new me("supportedCodeAction","");class CRe extends K{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new hc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>q4(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Gd.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=i.getPosition(),r=t.getLineContent(s);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(s)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}}var Xu;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(Cf(r))return FK;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(Xu||(Xu={}));const FK=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class SRe extends K{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Qr),this._state=Xu.Empty,this._onDidChangeState=this._register(new B),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=yRe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Xu.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Xu.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var s;return(s=i.providedCodeActionKinds)!==null&&s!==void 0?s:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new CRe(this._editor,this._markerService,i=>{var s;if(!i){this.setState(Xu.Empty);return}const o=i.selection.getStartPosition(),r=uc(a=>wRe(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Gd.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(Fe.QuickFix))){const g=yield I_(this._registry,e,i.selection,i.trigger,hp.None,a);if(a.isCancellationRequested)return FK;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?Fe.QuickFix.contains(new Fe(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,w=Number.MAX_VALUE,y=!1;for(const S of _){const L=S.endColumn,x=S.endLineNumber,D=S.startLineNumber;(x===v.lineNumber||D===v.lineNumber)&&Math.abs(v.column-L){k.highlightRange=k.action.isPreferred}),D.push(...x.validActions)),{validActions:D,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return I_(this._registry,e,i.selection,i.trigger,hp.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new Xu.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Gd.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var xRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pl=function(n,e){return function(t,i){e(t,i,n)}},C0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},sC;const LRe="quickfix-edit-highlight";let mv=sC=class extends K{static get(e){return e.getContribution(sC.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new Qr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new SRe(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Sf(()=>{const u=this._editor.getContribution(pv.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(gx),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var o;if(!this._editor.hasModel())return;(o=fr.get(this._editor))===null||o===void 0||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return C0(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(aRe,e,fx.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Gd.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return C0(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(d){pt(d);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((s=e.trigger.filter)===null||s===void 0)&&s.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(u,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(r=fr.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const d=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!d&&!c.validActions.length)){(l=fr.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return C0(this,void 0,void 0,function*(){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=V.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>C0(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),s.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),s.clear()},onHover:(c,d)=>C0(this,void 0,void 0,function*(){var u;if(yield c.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((u=c.action.edit)===null||u===void 0)&&u.edits.length)}}),onFocus:c=>{var d,u;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:sC.DECORATION}];s.set(h);const f=c.action.diagnostics[0],g=(u=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||u===void 0?void 0:u.word;Eb(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,hRe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Nn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>{var r;return{id:o.id,label:o.title,tooltip:(r=o.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:m("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}};mv.ID="editor.contrib.codeActionController";mv.DECORATION=Qe.register({description:"quickfix-highlight",className:LRe});mv=sC=xRe([pl(1,ol),pl(2,Je),pl(3,bt),pl(4,nt),pl(5,x1),pl(6,gs),pl(7,Jt),pl(8,$f),pl(9,bt)],mv);Sr((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Pa));const i=n.getColor(Xc);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Zl(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var BK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},px=function(n,e){return function(t,i){e(t,i,n)}};class sB{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let iM=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._dispoables=new fe,this._markers=[],this._nextIdx=-1,$e.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=hb(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=N.compareRangesUsingStarts(a,l)||Xt.compare(a.severity,l.severity):c=Xt.compare(a.severity,l.severity)||N.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:$e.isUri(e)?e:void 0,severities:Xt.Error|Xt.Warning|Xt.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new sB(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=Yz(this._markers,{resource:e.uri},(r,a)=>hb(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ug=function(n,e){return function(t,i){e(t,i,n)}},oM;class kRe{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new fe,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Hi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new aj(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Pt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=xf(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);Do(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=we("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=re(this._codeLink,we("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Do(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Gl(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const _=document.createElement("span");_.innerText=f.message,g.appendChild(p),g.appendChild(_),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Xt.Error:t=m("Error","Error");break;case Xt.Warning:t=m("Warning","Warning");break;case Xt.Info:t=m("Info","Info");break;case Xt.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}let wm=oM=class extends lx{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new fe,this._onDidSelectRelatedInformation=new B,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Xt.Warning,this._backgroundColor=H.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(TRe);let t=rM,i=ERe;this._severity===Xt.Warning?(t=oC,i=IRe):this._severity===Xt.Info&&(t=aM,i=ARe);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(hK),secondaryHeadingColor:e.getColor(fK)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(oM.TitleMenu,this._contextKeyService);Bq(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=re(e,we(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new kRe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=N.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m("problems","{0} of {1} problems",t,i):m("change","{0} of {1} problem",t,i);this.setTitle(ea(a.uri),l)}this._icon.className=`codicon ${sM.className(Xt.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};wm.TitleMenu=new A("gotoErrorTitleMenu");wm=oM=DRe([ug(1,oo),ug(2,fc),ug(3,lu),ug(4,bt),ug(5,Je),ug(6,iD)],wm);const oB=Nb(Ma,S_e),rB=Nb(wo,Ab),aB=Nb(Es,Tb),rM=E("editorMarkerNavigationError.background",{dark:oB,light:oB,hcDark:Xe,hcLight:Xe},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),ERe=E("editorMarkerNavigationError.headerBackground",{dark:ye(rM,.1),light:ye(rM,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),oC=E("editorMarkerNavigationWarning.background",{dark:rB,light:rB,hcDark:Xe,hcLight:Xe},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),IRe=E("editorMarkerNavigationWarning.headerBackground",{dark:ye(oC,.1),light:ye(oC,.1),hcDark:"#0C141F",hcLight:ye(oC,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),aM=E("editorMarkerNavigationInfo.background",{dark:aB,light:aB,hcDark:Xe,hcLight:Xe},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),ARe=E("editorMarkerNavigationInfo.headerBackground",{dark:ye(aM,.1),light:ye(aM,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),TRe=E("editorMarkerNavigation.background",{dark:Gi,light:Gi,hcDark:Gi,hcLight:Gi},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var NRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},by=function(n,e){return function(t,i){e(t,i,n)}},VK=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},K0;let Kd=K0=class{static get(e){return e.getContribution(K0.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new fe,this._editor=e,this._widgetVisible=HK.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(wm,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,o,r;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!N.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:N.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new V(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,s;return VK(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);r&&((i=K0.get(r))===null||i===void 0||i.close(),(s=K0.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};Kd.ID="editor.contrib.markerController";Kd=K0=NRe([by(1,WK),by(2,Je),by(3,zt),by(4,bt)],Kd);class PD extends Yt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return VK(this,void 0,void 0,function*(){t.hasModel()&&((i=Kd.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Cd extends PD{constructor(){super(!0,!1,{id:Cd.ID,label:Cd.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:578,weight:100},menuOpts:{menuId:wm.TitleMenu,title:Cd.LABEL,icon:Yi("marker-navigation-next",ie.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Cd.ID="editor.action.marker.next";Cd.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Wh extends PD{constructor(){super(!1,!1,{id:Wh.ID,label:Wh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:1602,weight:100},menuOpts:{menuId:wm.TitleMenu,title:Wh.LABEL,icon:Yi("marker-navigation-previous",ie.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Wh.ID="editor.action.marker.prev";Wh.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class MRe extends PD{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:m("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:66,weight:100},menuOpts:{menuId:A.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class RRe extends PD{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:m("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:z.focus,primary:1090,weight:100},menuOpts:{menuId:A.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Cr(Kd.ID,Kd,4);Ye(Cd);Ye(Wh);Ye(MRe);Ye(RRe);const HK=new me("markersNavigationVisible",!1),PRe=vr.bindToContribution(Kd.get);ke(new PRe({id:"closeMarkersNavigation",precondition:HK,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:z.focus,primary:9,secondary:[1033]}}));var ORe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tE=function(n,e){return function(t,i){e(t,i,n)}};const Jo=we;class FRe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const lB={type:1,filter:{include:Fe.QuickFix},triggerAction:Gd.QuickFixHover};let lM=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new N(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new FRe(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return K.None;const i=new fe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>Xt.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=Jo("div.hover-row"),s=re(i,Jo("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=re(s,Jo("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=Jo("span");if(o){const g=re(d,Jo("span"));g.innerText=o}const u=re(d,Jo("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(G(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=re(u,Jo("span"));h.innerText=a.value;const f=re(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=re(s,Jo("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Gl(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=re(s,Jo("div"));g.style.marginTop="8px";const p=re(g,Jo("a"));p.innerText=`${ea(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(G(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(pt)}));const _=re(g,Jo("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Xt.Error||t.marker.severity===Xt.Warning||t.marker.severity===Xt.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Cd.ID,run:()=>{var s;e.hide(),(s=Kd.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(Jo("div"));this.recentMarkerCodeActionsInfo&&(US.makeKey(this.recentMarkerCodeActionsInfo.marker)===US.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=m("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?K.None:i.add(iS(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=String.fromCharCode(160));const r=this.getCodeActions(t.marker);i.add(Ke(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=m("noQuickFixes","No quick fixes available");return}s.style.display="none";let l=!1;i.add(Ke(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:IK,run:c=>{l=!0;const d=mv.get(this._editor),u=Nn(c);e.hide(),d==null||d.showCodeActions(lB,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},pt)}}getCodeActions(e){return uc(t=>I_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new N(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),lB,hp.None,t))}};lM=ORe([tE(1,k4),tE(2,fc),tE(3,nt)],lM);const BRe="editor.action.inlineSuggest.showPrevious",WRe="editor.action.inlineSuggest.showNext";var VRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class HRe extends K{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Ihe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new fe),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new _v(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Xa(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(s,o)=>{var r;if(s.id===_v.ID)return this.toggleMenuActionViewItem=new BS(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ae.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:ie.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(s,o);if(a)return a}if(s instanceof vL){const a=new BS(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var t,i,s;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(s=o==null?void 0:o.getLabel())!==null&&s!==void 0?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class _v extends xo{constructor(e,t){t=t||m("moreActions","More Actions..."),super(_v.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return VRe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}_v.ID="toolbar.toggle.more";var zRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},S0=function(n,e){return function(t,i){e(t,i,n)}};let cM=class extends HRe{constructor(e,t,i,s,o,r,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=r.lookupKeybinding(c.id))!==null&&d!==void 0?d:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._sessionDisposables=this._store.add(new fe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var s,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==-1)for(let f=0;f_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let _=0;_=g&&(a[_]=void 0,u[_]=v))}}$O(a),$O(u),super.setActions(a,Rn.join(u,l)),c.length>0&&this._sessionDisposables.add(G(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const w=new rr(f),y=this.getItemAction(w.target);if(!y)return;w.preventDefault(),w.stopPropagation();let S=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){S=!0;for(let D=0;Dthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>w,getActions:()=>x,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(v=this._options)===null||v===void 0?void 0:v.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};cM=zRe([S0(2,lu),S0(3,Je),S0(4,gu),S0(5,gi),S0(6,cc)],cM);var u3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ur=function(n,e){return function(t,i){e(t,i,n)}},rC;let cB=class extends K{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=As(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=mt(this,s=>{var o,r,a;const l=(o=this.model.read(s))===null||o===void 0?void 0:o.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const d=new V(l.lineNumber,Math.min(c,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(zs((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(ym,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ke(()=>e.removeContentWidget(a))),o.add(ri(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==SI.Explicit&&r.triggerExplicitly()}))}))}};cB=u3([Ur(2,bt)],cB);const $Re=Yi("inline-suggestion-hints-next",ie.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),URe=Yi("inline-suggestion-hints-previous",ie.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let ym=rC=class extends K{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new xo(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${rC.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=dn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[dn("div@toolBar")]),this.previousAction=this.createCommandAction(BRe,m("previous","Previous"),Ae.asClassName(URe)),this.availableSuggestionCountAction=new xo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(WRe,m("next","Next"),Ae.asClassName($Re)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(A.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Ci(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Ci(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(dM,this.nodes.toolBar,A.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof qa)return l.createInstance(qRe,h,void 0);if(h===this.availableSuggestionCountAction){const g=new jRe(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{rC._dropDownVisible=h})),this._register(ri(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(ri(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ri(h=>{const f=this._extraCommands.read(h);if(Ki(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:_=>this._commandService.executeCommand(p.id)}));for(const[p,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof qa&&g.push(v);g.length>0&&g.unshift(new Rn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};ym._dropDownVisible=!1;ym.id=0;ym=rC=u3([Ur(6,gs),Ur(7,bt),Ur(8,gi),Ur(9,Je),Ur(10,lu)],ym);class jRe extends oD{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class qRe extends fm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=dn("div.keybinding").root;new A1(t,bo,Object.assign({disableTitle:!0},Cke)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let dM=class extends cM{constructor(e,t,i,s,o,r,a,l){super(e,Object.assign({resetMenu:t},i),s,o,r,a,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,s,o,r,a;const l=[],c=[];Bq(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Ki(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ki(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};dM=u3([Ur(3,lu),Ur(4,Je),Ur(5,gu),Ur(6,gi),Ur(7,cc)],dM);var GRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vy=function(n,e){return function(t,i){e(t,i,n)}},uM;const KRe=!1;let eo=uM=class extends K{static get(e){return e.getContribution(uM.ID)}constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=s,this._keybindingService=o,this._toUnhook=new fe,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Ci(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===yd.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===vp.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const s=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(s)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,s,o,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===yd.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(s=e.event.browserEvent.view)===null||s===void 0?void 0:s.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===yd.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===vp.ID)}_onEditorMouseMove(e){var t,i,s,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((s=this._contentWidget)===null||s===void 0)&&s.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,s;if(!e)return;const o=e.target,r=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!KRe||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new vp(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),s=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!s&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||ym.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(dx,this._editor)),this._contentWidget}showContentHover(e,t,i,s,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};eo.ID="editor.contrib.hover";eo=uM=GRe([vy(1,bt),vy(2,fc),vy(3,ki),vy(4,gi)],eo);class YRe extends Yt{constructor(){super({id:"editor.action.showHover",label:m({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:Fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=eo.get(t);if(!s)return;const o=t.getPosition(),r=new N(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);s.isHoverVisible?s.focus():s.showContentHover(r,1,1,a)}}class ZRe extends Yt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:m({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=eo.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new N(s.lineNumber,s.column,s.lineNumber,s.column),r=ff.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class XRe extends Yt{constructor(){super({id:"editor.action.scrollUpHover",label:m({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:16,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollUp()}}class QRe extends Yt{constructor(){super({id:"editor.action.scrollDownHover",label:m({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:18,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollDown()}}class JRe extends Yt{constructor(){super({id:"editor.action.scrollLeftHover",label:m({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:15,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollLeft()}}class e4e extends Yt{constructor(){super({id:"editor.action.scrollRightHover",label:m({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:17,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollRight()}}class t4e extends Yt{constructor(){super({id:"editor.action.pageUpHover",label:m({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=eo.get(t);i&&i.pageUp()}}class i4e extends Yt{constructor(){super({id:"editor.action.pageDownHover",label:m({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=eo.get(t);i&&i.pageDown()}}class n4e extends Yt{constructor(){super({id:"editor.action.goToTopHover",label:m({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=eo.get(t);i&&i.goToTop()}}class s4e extends Yt{constructor(){super({id:"editor.action.goToBottomHover",label:m({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:z.hoverFocused,kbOpts:{kbExpr:z.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=eo.get(t);i&&i.goToBottom()}}Cr(eo.ID,eo,2);Ye(YRe);Ye(ZRe);Ye(XRe);Ye(QRe);Ye(JRe);Ye(e4e);Ye(t4e);Ye(i4e);Ye(n4e);Ye(s4e);c3.register(ZN);c3.register(lM);Sr((n,e)=>{const t=n.getColor(B_e);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});function o4e(n){return new Worker(""+new URL("json.worker-6Bi5nuQf.js",import.meta.url).href,{name:n==null?void 0:n.name})}self.MonacoEnvironment={getWorker(n,e){if(e==="json")return new o4e;throw new Error("Unsupported language: "+e)}};class r4e extends jg{constructor(){super();Dn(this,"_editor");Dn(this,"_initialValue")}set value(t){this._editor?this._editor.setValue(t):this._initialValue=t}get value(){var t;return((t=this._editor)==null?void 0:t.getValue())??this._initialValue}createRenderRoot(){return this}disconnectedCallback(){var t,i,s;(t=this._editor)==null||t.dispose(),(s=(i=this._editor)==null?void 0:i.getModel())==null||s.dispose()}render(){return ji}firstUpdated(){this._editor=zG.create(this,{value:this._initialValue,language:"json",minimap:{enabled:!1},fontFamily:"'Source Code Pro', monospace",fontSize:12}),this._editor.getModel().onDidChangeContent(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{}}))}),new ResizeObserver(i=>{this._editor.layout()}).observe(this)}}customElements.define("code-editor",r4e);/** +2: False`)},findInSelection:{type:"boolean"}}}}]};class zNe extends Zt{constructor(){super({id:Nt.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:HNe})}run(e,t,i){return uf(this,void 0,void 0,function*(){const s=us.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}})}}class $Ne extends Zt{constructor(){super({id:Nt.StartFindWithSelection,label:m("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return uf(this,void 0,void 0,function*(){const i=us.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class SK extends Zt{run(e,t){return uf(this,void 0,void 0,function*(){const i=us.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class UNe extends SK{constructor(){super({id:Nt.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:xe.and($.focus,MD),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class jNe extends SK{constructor(){super({id:Nt.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:xe.and($.focus,MD),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class qNe extends Zt{constructor(){super({id:Nt.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:vc}),this._highlightDecorations=[]}run(e,t,i){const s=us.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Ln).notify({severity:fq.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(YP).createInputBox();a.placeholder=m("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=s.getState().matchesCount;if(u>0&&u<=h)return u-1;if(u<0&&u>=-h)return h+u},c=d=>{const u=l(d);if(typeof u=="number"){a.validationMessage=void 0,s.goToMatch(u);const h=s.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:sn(Zve),position:Uo.Full}}}])})}}class xK extends Zt{run(e,t){return uf(this,void 0,void 0,function*(){const i=us.get(t);if(!i)return;const s=GN(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class GNe extends xK{constructor(){super({id:Nt.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class KNe extends xK{constructor(){super({id:Nt.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const YNe=LU(new xU({id:Nt.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:xe.or($.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));YNe.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=us.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Sr(us.ID,KN,0);Xe(zNe);Xe($Ne);Xe(UNe);Xe(jNe);Xe(qNe);Xe(GNe);Xe(KNe);const la=wr.bindToContribution(us.get);ke(new la({id:Nt.CloseFindWidgetCommand,precondition:vc,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:xe.and($.focus,xe.not("isComposing")),primary:9,secondary:[1033]}}));ke(new la({id:Nt.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:ay.primary,mac:ay.mac,win:ay.win,linux:ay.linux}}));ke(new la({id:Nt.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:ly.primary,mac:ly.mac,win:ly.win,linux:ly.linux}}));ke(new la({id:Nt.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:cy.primary,mac:cy.mac,win:cy.win,linux:cy.linux}}));ke(new la({id:Nt.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:dy.primary,mac:dy.mac,win:dy.win,linux:dy.linux}}));ke(new la({id:Nt.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:uy.primary,mac:uy.mac,win:uy.win,linux:uy.linux}}));ke(new la({id:Nt.ReplaceOneAction,precondition:vc,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:3094}}));ke(new la({id:Nt.ReplaceOneAction,precondition:vc,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:xe.and($.focus,g3),primary:3}}));ke(new la({id:Nt.ReplaceAllAction,precondition:vc,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:2563}}));ke(new la({id:Nt.ReplaceAllAction,precondition:vc,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:xe.and($.focus,g3),primary:void 0,mac:{primary:2051}}}));ke(new la({id:Nt.SelectAllMatchesAction,precondition:vc,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:$.focus,primary:515}}));const gy=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightTextBackground",{light:gy,dark:gy,hcDark:gy,hcLight:gy},m("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const py=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Ut,hcLight:Ut},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Ut,hcLight:Ut},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",{light:py,dark:py,hcDark:py,hcLight:py},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const ZNe=E("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),XNe=E("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},m("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),QNe=E("editorOverviewRuler.wordHighlightTextForeground",{dark:H0,light:H0,hcDark:H0,hcLight:H0},m("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);et.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sn(XNe),position:Uo.Center},minimap:{color:sn(QL),position:Ks.Inline}});et.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:sn(QNe),position:Uo.Center},minimap:{color:sn(QL),position:Ks.Inline}});const JNe=et.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sn(H0),position:Uo.Center},minimap:{color:sn(QL),position:Ks.Inline}}),eMe=et.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});et.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sn(ZNe),position:Uo.Center},minimap:{color:sn(QL),position:Ks.Inline}});function tMe(n){return n?eMe:JNe}xr((n,e)=>{const t=n.getColor(z4);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var iMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nMe=function(n,e){return function(t,i){e(t,i,n)}},YN;function yu(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);Ab(s)}}class sMe extends Zt{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,_n.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),yu(r,o.getCursorStates())}}class oMe extends Zt{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,_n.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),yu(r,o.getCursorStates())}}class rMe extends Zt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:m("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new lt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),yu(r,o.getCursorStates())}}class aMe extends Zt{constructor(){super({id:"editor.action.addCursorsToBottom",label:m("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new lt(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),yu(a,r.getCursorStates())}}class lMe extends Zt{constructor(){super({id:"editor.action.addCursorsToTop",label:m("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new lt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),yu(r,o.getCursorStates())}}class my{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class uv{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new uv(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const u=e.getConfiguredWordAtPosition(l.getStartPosition());if(!u)return null;c=u.word,d=new lt(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new uv(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,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 my(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 my(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(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 my(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 my(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class hf extends Y{static get(e){return e.getContribution(hf.ID)}constructor(e){super(),this._sessionDispose=this._register(new fe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=uv.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(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new lt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!LK(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}hf.ID="editor.contrib.multiCursorController";class $m extends Zt{run(e,t){const i=hf.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=us.get(t);if(r)this._run(i,r);else{const a=e.get(bt).createInstance(us,t);this._run(i,a),a.dispose()}yu(o,s.getCursorStates())}}}class cMe extends $m{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:m("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2082,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class dMe extends $m{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:m("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class uMe extends $m{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:m("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:Fn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class hMe extends $m{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:m("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class fMe extends $m{constructor(){super({id:"editor.action.selectHighlights",label:m("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3114,weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class gMe extends $m{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:xe.and($.writable,$.editorTextFocus),kbOpts:{kbExpr:$.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class pMe{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(N.compareRangesUsingStarts)),this._cachedFindMatches}}let hv=YN=class extends Y{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new xi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=us.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(YN._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=hf.get(i);if(!o)return null;const r=us.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const h=r.getState().matchCase;if(!LK(i.getModel(),d,h))return null}a=uv.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.getState(),c=l.matchCase;if(l.isRevealed){let d=l.searchString;c||(d=d.toLowerCase());let u=a.searchText;if(c||(u=u.toLowerCase()),d===u&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new pMe(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(N.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=N.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!N.areIntersecting(h,s[c]))&&o.push(h),l++):(f>0||l++,c++)}}const r=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:tMe(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};hv.ID="editor.contrib.selectionHighlighter";hv=YN=iMe([nMe(1,nt)],hv);function LK(n,e,t){const i=eB(n,e[0],!t);for(let s=1,o=e.length;sthis._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new lt(r.lineNumber,r.column,r.lineNumber,r.column):new lt(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(N.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new lt(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let u=0,h=e.length;u1&&o.sort(H.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;us.target.position?s.target.position.lineNumber:0,this._opts=iB(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(s=>{if(s.hasChanged(77)){const o=iB(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(s=>this._onEditorMouseMove(new iE(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new iE(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new iE(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new tB(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new tB(s,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(s=>this._onDidChangeCursorSelection(s))),this._register(this._editor.onDidChangeModel(s=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(s=>{(s.scrollTopChanged||s.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var xMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fl=function(n,e){return function(t,i){e(t,i,n)}};let wm=class extends um{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},s.getRawOptions()),{overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()}),i,o,r,a,l,c,d,u,h,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){SL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};wm=xMe([fl(4,bt),fl(5,$t),fl(6,fs),fl(7,tt),fl(8,oo),fl(9,Ln),fl(10,mu),fl(11,no),fl(12,nt)],wm);const nB=new z(new ut(0,122,204)),LMe={showArrow:!0,showFrame:!0,className:"",frameColor:nB,arrowColor:nB,keepEditorSelection:!1},DMe="vs.editor.contrib.zoneWidget";class kMe{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class EMe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class OD{constructor(e){this._editor=e,this._ruleName=OD._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),FF(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){FF(this._ruleName),AA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:N.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}OD._IdGenerator=new kP(".arrow-decoration-");class IMe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new fe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Cl(t),SL(this.options,LMe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new OD(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=N.isIRange(e)?N.lift(e):N.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:et.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new kMe(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new EMe(DMe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new N(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new En(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var DK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kK=function(n,e){return function(t,i){e(t,i,n)}};const EK=at("IPeekViewService");ht(EK,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var Js;(function(n){n.inPeekEditor=new _e("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Js||(Js={}));let fv=class{constructor(e,t){e instanceof wm&&Js.inPeekEditor.bindTo(t)}dispose(){}};fv.ID="editor.contrib.referenceController";fv=DK([kK(1,tt)],fv);Sr(fv.ID,fv,0);function AMe(n){const e=n.get($t).getFocusedCodeEditor();return e instanceof wm?e.getParentEditor():e}const TMe={headerBackgroundColor:z.white,primaryHeadingColor:z.fromHex("#333333"),secondaryHeadingColor:z.fromHex("#6c6c6cb3")};let hx=class extends IMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,SL(this.options,TMe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=we(".head"),this._bodyElement=we(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=we(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Hi(this._titleElement,"click",o=>this._onTitleClick(o))),re(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=we("span.filename"),this._secondaryHeading=we("span.dirname"),this._metaHeading=we("span.meta"),re(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=we(".peekview-actions");re(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Xa(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new So("peekview.close",m("label.close","Close"),Ae.asClassName(ie.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:_De.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Lo(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ah(this._metaHeading)):Yc(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};hx=DK([kK(2,bt)],hx);const NMe=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:z.black,hcLight:z.white},m("peekViewTitleBackground","Background color of the peek view title area.")),IK=E("peekViewTitleLabel.foreground",{dark:z.white,light:z.black,hcDark:z.white,hcLight:_u},m("peekViewTitleForeground","Color of the peek view title.")),AK=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),MMe=E("peekView.border",{dark:ks,light:ks,hcDark:Je,hcLight:Je},m("peekViewBorder","Color of the peek view borders and arrow.")),RMe=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:z.black,hcLight:z.white},m("peekViewResultsBackground","Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:z.white,hcLight:_u},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:z.white,light:"#1E1E1E",hcDark:z.white,hcLight:_u},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:z.white,light:"#6C6C6C",hcDark:z.white,hcLight:_u},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const cd=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:z.black,hcLight:z.white},m("peekViewEditorBackground","Background color of the peek view editor."));E("peekViewEditorGutter.background",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var PMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Xd{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=OT.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?m({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,ta(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",ta(this.uri),this.range.startLineNumber,this.range.startColumn)}}class OMe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new N(s,l.startColumn,s,o),d=new N(r,a,r,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class gv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tn}dispose(){Pt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m("aria.fileReferences.1","1 symbol in {0}, full path {1}",ta(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,ta(this.uri),this.uri.fsPath)}resolve(e){return PMe(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new OMe(i))}catch(i){pt(i)}return this})}}class Ys{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new B,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Ys._compareReferences);let s;for(const o of e)if((!s||!Vt.isEqual(s.uri,o.uri,!0))&&(s=new gv(this,o.uri),this.groups.push(s)),s.children.length===0||Ys._compareReferences(o,s.children[s.children.length-1])!==0){const r=new Xd(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Pt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Ys(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m("aria.result.0","No results found"):this.references.length===1?m("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:eS(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&N.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vt.compare(e.uri,t.uri)||N.compareRangesUsingStarts(e.range,t.range)}}var FD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},BD=function(n,e){return function(t,i){e(t,i,n)}},XN;let QN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Ys||e instanceof gv}getChildren(e){if(e instanceof Ys)return e.groups;if(e instanceof gv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};QN=FD([BD(0,hu)],QN);class FMe{getHeight(){return 23}getTemplateId(e){return e instanceof gv?pv.id:$1.id}}let JN=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Xd){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return ta(e.uri)}};JN=FD([BD(0,pi)],JN);class BMe{getId(e){return e instanceof Xd?e.id:e.uri}}let eM=class extends Y{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new rN(i,{supportHighlights:!0})),this.badge=new oN(re(i,we(".count")),{},Jq),e.appendChild(i)}set(e,t){const i=sP(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(m("referencesCount","{0} references",s)):this.badge.setTitleFormat(m("referenceCount","{0} reference",s))}};eM=FD([BD(1,dD)],eM);let pv=XN=class{constructor(e){this._instantiationService=e,this.templateId=XN.id}renderTemplate(e){return this._instantiationService.createInstance(eM,e)}renderElement(e,t,i){i.set(e.element,SP(e.filterData))}disposeTemplate(e){e.dispose()}};pv.id="FileReferencesRenderer";pv=XN=FD([BD(0,bt)],pv);class WMe{constructor(e){this.label=new yd(e)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${ta(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=s;t&&!Fh.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,SP(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class $1{constructor(){this.templateId=$1.id}renderTemplate(e){return new WMe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}$1.id="OneReferenceRenderer";class VMe{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var HMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gl=function(n,e){return function(t,i){e(t,i,n)}},sB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class WD{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new fe,this._callOnModelChange=new fe,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance($Me,"ReferencesWidget",this._treeContainer,new FMe,[this._instantiationService.createInstance(pv),this._instantiationService.createInstance($1)],this._instantiationService.createInstance(QN),i),this._splitView.addView({onDidChange:de.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},QS.Distribute),this._splitView.addView({onDidChange:de.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},QS.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof Xd&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Yc(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Xt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=m("noResults","No results"),Ah(this._messageContainer),Promise.resolve(void 0)):(Yc(this._messageContainer),this._decorationsManager=new WD(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Ah(this._treeContainer),Ah(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Xd)return e;if(e instanceof gv&&e.children.length>0)return e.children[0]}revealReference(e){return sB(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return sB(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==it.inMemory?this.setTitle(oye(e.uri),this._uriLabel.getUriLabel(sP(e.uri))):this.setTitle(m("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const s=yield i;if(!this._model){s.dispose();return}Pt(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=N.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};tM=HMe([gl(3,oo),gl(4,hu),gl(5,bt),gl(6,EK),gl(7,dD),gl(8,rD),gl(9,pi),gl(10,Ii),gl(11,no)],tM);var UMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dg=function(n,e){return function(t,i){e(t,i,n)}},oB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},lC;const Hf=new _e("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let ym=lC=class{static get(e){return e.getContribution(lC.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new fe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Hf.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=zMe.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(tM,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new H(e.startLineNumber,e.startColumn),h=this._model.nearestReference(d,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return oB(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return oB(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const s=N.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:s,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var r;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(s),this._widget.focusOnReferenceTree();else{const a=lC.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,gc(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,pt(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};ym.ID="editor.contrib.referencesController";ym=lC=UMe([dg(2,tt),dg(3,$t),dg(4,Ln),dg(5,bt),dg(6,Of),dg(7,ei)],ym);function zf(n,e){const t=AMe(n);if(!t)return;const i=ym.get(t);i&&e(i)}Ps.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Fn(2089,60),when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ps.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.goToNextOrPreviousReference(!0)})}});Ps.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:xe.or(Hf,Js.inPeekEditor),handler(n){zf(n,e=>{e.goToNextOrPreviousReference(!1)})}});Gt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Gt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Gt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Gt.registerCommand("closeReferenceSearch",n=>zf(n,e=>e.closeWidget()));Ps.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:xe.and(Js.inPeekEditor,xe.not("config.editor.stablePeek"))});Ps.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:xe.and(Hf,xe.not("config.editor.stablePeek"))});Ps.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:xe.and(Hf,wG,$P.negate(),UP.negate()),handler(n){var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Xd&&zf(n,s=>s.revealReference(i[0]))}});Ps.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:xe.and(Hf,wG,$P.negate(),UP.negate()),handler(n){var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Xd&&zf(n,s=>s.openReference(i[0],!0,!0))}});Gt.registerCommand("openReference",n=>{var e;const i=(e=n.get(Yo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Xd&&zf(n,s=>s.openReference(i[0],!1,!0))});var TK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},K0=function(n,e){return function(t,i){e(t,i,n)}};const m3=new _e("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),VD=at("ISymbolNavigationService");let iM=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=m3.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new nM(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(nP(u.uri,a.uri))c=!0,d=d||N.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=ur(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:N.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?m("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):m("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};iM=TK([K0(0,tt),K0(1,$t),K0(2,Ln),K0(3,pi)],iM);ht(VD,iM,1);ke(new class extends wr{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:m3,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(VD).revealNext(e)}});Ps.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:m3,primary:9,handler(n){n.get(VD).reset()}});let nM=class{constructor(e){this._listener=new Map,this._disposables=new fe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Pt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,ur(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};nM=TK([K0(0,$t)],nM);var jMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rB=function(n,e){return function(t,i){e(t,i,n)}},NK=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},sM;let mv=sM=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new fe,o=s.add(hD(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,s)=>NK(this,void 0,void 0,function*(){var o,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=Vo);const c=yield ICe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=sM._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);Mn(d,u)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>MK(this._openerService,i,e.isTrusted),disposables:t}}}};mv._ttpTokenizer=If("tokenizeToString",{createHTML(n){return n}});mv=sM=jMe([rB(1,Ii),rB(2,mc)],mv);function MK(n,e,t){return NK(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:qMe(t)})}catch(i){return pt(i),!1}})}function qMe(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var GMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aB=function(n,e){return function(t,i){e(t,i,n)}},cC;let fr=cC=class{static get(e){return e.getContribution(cC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Jr,this._messageListeners=new fe,this._mouseOverMessage=!1,this._editor=e,this._visible=cC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){x1(vd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=vd(e)?hD(e,{actionHandler:{callback:s=>MK(this._openerService,s,vd(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new lB(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(de.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Cn(Yr(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),le.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),le.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new N(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(lB.fadeOut(this._messageWidget.value))}};fr.ID="editor.contrib.messageController";fr.MESSAGE_VISIBLE=new _e("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));fr=cC=GMe([aB(1,tt),aB(2,mc)],fr);const KMe=wr.bindToContribution(fr.get);ke(new KMe({id:"leaveEditorMessage",precondition:fr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let lB=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Sr(fr.ID,fr,4);var _3=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function U1(n,e,t,i){return _3(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{uc(l)})),r=yield Promise.all(o);return yL(r.flat())})}function b3(n,e,t,i){return U1(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function RK(n,e,t,i){return U1(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function PK(n,e,t,i){return U1(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function OK(n,e,t,i){return U1(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function HD(n,e,t,i,s){return U1(e,t,n,(o,r,a)=>_3(this,void 0,void 0,function*(){const l=yield o.provideReferences(r,a,{includeDeclaration:!0},s);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(r,a,{includeDeclaration:!1},s);return c&&c.length===1?c:l}))}function j1(n){return _3(this,void 0,void 0,function*(){const e=yield n(),t=new Ys(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}Pm("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=b3(i.definitionProvider,e,t,rn.None);return j1(()=>s)});Pm("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=OK(i.typeDefinitionProvider,e,t,rn.None);return j1(()=>s)});Pm("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(nt),s=RK(i.declarationProvider,e,t,rn.None);return j1(()=>s)});Pm("_executeReferenceProvider",(n,e,t)=>{const i=n.get(nt),s=HD(i.referenceProvider,e,t,!1,rn.None);return j1(()=>s)});Pm("_executeImplementationProvider",(n,e,t)=>{const i=n.get(nt),s=PK(i.implementationProvider,e,t,rn.None);return j1(()=>s)});var gr=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},w0,y0,C0,by,vy,wy,yy,Cy;or.appendMenuItem(A.EditorContext,{submenu:A.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class fx{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof fx||H.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class is extends gpe{static all(){return is._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of dt.wrap(t.menu))(i.id===A.EditorContext||i.id===A.EditorContextPeek)&&(i.when=xe.and(e.precondition,i.when));return t}constructor(e,t){super(is._patchConfig(t)),this.configuration=e,is._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Ln),r=e.get($t),a=e.get(T1),l=e.get(VD),c=e.get(nt),d=e.get(bt),u=t.getModel(),h=t.getPosition(),f=fx.is(i)?i:new fx(u,h),g=new NAe(t,5),p=bpe(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>gr(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;x1(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const y=this._getAlternativeCommand(t);!is._activeAlternativeCommands.has(y)&&is._allSymbolNavigationCommands.has(y)&&(b=is._allSymbolNavigationCommands.get(y))}const w=_.references.length;if(w===0){if(!this.configuration.muteMessage){const y=u.getWordAtPosition(h);(v=fr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(y),h)}}else if(w===1&&b)is._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,s).finally(()=>{is._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,s)}),_=>{o.error(_)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,i,s,o){return gr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof wm)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,s,o){return gr(this,void 0,void 0,function*(){let r;if(yfe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:N.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const s=ym.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),gc(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}is._allSymbolNavigationCommands=new Map;is._activeAlternativeCommands=new Set;class zD extends is{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield b3(e.definitionProvider,t,i,s),m("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("noResultWord","No definition found for '{0}'",e.word):m("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Os((w0=class extends zD{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:w0.id,title:{value:m("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:m({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:xe.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:70,weight:100},{when:xe.and($.editorTextFocus,_G),primary:2118,weight:100}],menu:[{id:A.EditorContext,group:"navigation",order:1.1},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Gt.registerCommandAlias("editor.action.goToDeclaration",w0.id)}},w0.id="editor.action.revealDefinition",w0));Os((y0=class extends zD{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:y0.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:xe.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:Fn(2089,70),weight:100},{when:xe.and($.editorTextFocus,_G),primary:Fn(2089,2118),weight:100}]}),Gt.registerCommandAlias("editor.action.openDeclarationToTheSide",y0.id)}},y0.id="editor.action.revealDefinitionAside",y0));Os((C0=class extends zD{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:C0.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:xe.and($.hasDefinitionProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:A.EditorContextPeek,group:"peek",order:2}}),Gt.registerCommandAlias("editor.action.previewDeclaration",C0.id)}},C0.id="editor.action.peekDefinition",C0));class FK extends is{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield RK(e.declarationProvider,t,i,s),m("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Os((by=class extends FK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:by.id,title:{value:m("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:m({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:xe.and($.hasDeclarationProvider,$.isInWalkThroughSnippet.toNegated()),menu:[{id:A.EditorContext,group:"navigation",order:1.3},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}},by.id="editor.action.revealDeclaration",by));Os(class extends FK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:xe.and($.hasDeclarationProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:3}})}});class BK extends is{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield OK(e.typeDefinitionProvider,t,i,s),m("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):m("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Os((vy=class extends BK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:vy.ID,title:{value:m("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:m({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:xe.and($.hasTypeDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:0,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.4},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},vy.ID="editor.action.goToTypeDefinition",vy));Os((wy=class extends BK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:wy.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:xe.and($.hasTypeDefinitionProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:4}})}},wy.ID="editor.action.peekTypeDefinition",wy));class WK extends is{_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield PK(e.implementationProvider,t,i,s),m("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):m("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Os((yy=class extends WK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:yy.ID,title:{value:m("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:m({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:xe.and($.hasImplementationProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:2118,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.45},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},yy.ID="editor.action.goToImplementation",yy));Os((Cy=class extends WK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Cy.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:xe.and($.hasImplementationProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:3142,weight:100},menu:{id:A.EditorContextPeek,group:"peek",order:5}})}},Cy.ID="editor.action.peekImplementation",Cy));class VK extends is{_getNoResultFoundMessage(e){return e?m("references.no","No references found for '{0}'",e.word):m("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Os(class extends VK{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:m("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:m({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:xe.and($.hasReferenceProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:1094,weight:100},menu:[{id:A.EditorContext,group:"navigation",order:1.45},{id:A.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield HD(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Os(class extends VK{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:m("references.action.label","Peek References"),original:"Peek References"},precondition:xe.and($.hasReferenceProvider,Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:A.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(yield HD(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class YMe extends is{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:m("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:xe.and(Js.notInPeekEditor,$.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return gr(this,void 0,void 0,function*(){return new Ys(this._references,m("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&m("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Gt.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:je},{name:"position",description:"The position at which to start",constraint:H.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,o,r)=>gr(void 0,void 0,void 0,function*(){xs(je.isUri(e)),xs(H.isIPosition(t)),xs(Array.isArray(i)),xs(typeof s>"u"||typeof s=="string"),xs(typeof r>"u"||typeof r=="boolean");const a=n.get($t),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(sK(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends YMe{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(bt).invokeFunction(d.run.bind(d),l)})})});Gt.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:je},{name:"position",description:"The position at which to start",constraint:H.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>gr(void 0,void 0,void 0,function*(){n.get(fs).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});Gt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{xs(je.isUri(e)),xs(H.isIPosition(t));const i=n.get(nt),s=n.get($t);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!sK(o)||!o.hasModel())return;const r=ym.get(o);if(!r)return;const a=gc(c=>HD(i.referenceProvider,o.getModel(),H.lift(t),!1,c).then(d=>new Ys(d,m("ref.title","References")))),l=new N(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Gt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var ZMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nE=function(n,e){return function(t,i){e(t,i,n)}},cB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Y0;let ff=Y0=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new fe,this.toUnhookForKeyboard=new fe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new SMe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{pt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Y0.ID)}startFindDefinitionFromCursor(e){return cB(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return cB(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const s=new TAe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=gc(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){pt(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?N.lift(o[0].originSelectionRange):new N(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=N.plusRange(a,l));this.addDecoration(a,new gm().appendText(m("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const u=this.getPreviewValue(c,d,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,u?new gm().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=Y0.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new zD({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(tt);return Js.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};ff.ID="editor.contrib.gotodefinitionatposition";ff.MAX_SOURCE_PREVIEW_LINES=8;ff=Y0=ZMe([nE(1,hu),nE(2,Ii),nE(3,nt)],ff);Sr(ff.ID,ff,2);const Sy=we;class HK extends Y{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new Y4(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class v3 extends Y{static render(e,t,i){return new v3(e,t,i)}constructor(e,t,i){super(),this.actionContainer=re(e,Sy("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=re(this.actionContainer,Sy("a.action")),this.action.setAttribute("role","button"),t.iconClass&&re(this.action,Sy(`span.icon.${t.iconClass}`));const s=re(this.action,Sy("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(K(this.actionContainer,le.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(K(this.actionContainer,le.KEY_DOWN,o=>{const r=new Wt(o);(r.equals(3)||r.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function XMe(n,e){return n&&e?m("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?m("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var QMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},JMe=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};let eRe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class zK extends Y{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new xi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new xi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new xi(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=xpe(e=>this._computer.computeAsync(e)),QMe(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=JMe(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;o=!0){s=a.value,o=!1;const l=s;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){pt(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new eRe(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class sE{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}const w3=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class tRe{constructor(){this._onDidWillResize=new B,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new B,this.onDidResize=this._onDidResize.event,this._sashListener=new fe,this._size=new Xt(0,0),this._minSize=new Xt(0,0),this._maxSize=new Xt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new En(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new En(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new En(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:ZS.North}),this._southSash=new En(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:ZS.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(de.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(de.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(de.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(de.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Xt(t,e);Xt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const iRe=30,nRe=24;class sRe extends Y{constructor(e,t=new Xt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new tRe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Xt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Xt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?H.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Nn(t).top+i.top-iRe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Nn(t),o=BL(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-nRe}_findPositionPreference(e,t){var i,s;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((s=this._availableVerticalSpaceAbove(t))!==null&&s!==void 0?s:1/0,e),a=Math.min(Math.max(r,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=r?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var y3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_h=function(n,e){return function(t,i){e(t,i,n)}},dC,pa;const dB=we;let gx=dC=class extends Y{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(xd,this._editor)),this._participants=[];for(const s of w3.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new px(this._editor,this._participants),this._hoverOperation=this._register(new zK(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new $K(this._computer.anchor,o,s.isComplete))})),this._register(Hi(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(yi.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new sE(0,i.range,e.event.posx,e.event.posy)),i.type===7){const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new sE(0,e,void 0,void 0),t,i,s,null)}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=dC.computeHoverRanges(this._editor,e.range,t),r=new fe,a=r.add(new oM(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&r.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:dC._DECORATION_OPTIONS}]),r.add(Ze(()=>{h.clear()}))}this._widget.showAt(l,new rRe(c,i,s,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new H(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));s=d.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const c of i)a=N.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(r=Math.max(Math.min(r,c.range.startColumn),s)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new H(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new H(o,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};gx._DECORATION_OPTIONS=et.register({description:"content-hover-highlight",className:"hoverHighlight"});gx=dC=y3([_h(1,bt),_h(2,pi)],gx);class $K{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new oRe(this,this.anchor,t,this.isComplete)}}class oRe extends $K{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class rRe{constructor(e,t,i,s,o,r,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=s,this.stoleFocus=o,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const uB=30,oE=10,aRe=6;let xd=pa=class extends sRe{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,s,o){const r=e.getOption(66)+8,a=150,l=new Xt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new HK),this._minimumSize=l,this._hoverVisibleKey=$.hoverVisible.bindTo(t),this._hoverFocusedKey=$.hoverFocused.bindTo(t),re(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const c=this._register(jd(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return pa.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return pa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return pa._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){pa._applyMaxDimensions(this._hover.contentsDomNode,e,t),pa._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-oE))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Xt(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;pa._lastDimensions=new Xt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=aRe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=oE),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Nn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=hB(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=hB(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,pa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,pa._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,s,o,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=uh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(s=t.colorPicker)===null||s===void 0||s.layout();const c=XMe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Xt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,s=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ws(i),Math.min(o,e)),this._setContentsDomNodeDimensions(ws(s),Math.min(o,e-oE))}setMinimumDimensions(e){this._minimumSize=new Xt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Xt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=uh(t),s=ws(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=uh(t),s=ws(t),this._contentWidth=s,this._updateMinimumWidth(),this._resizableNode.layout(i,s),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=uh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-uB})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+uB})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};xd.ID="editor.contrib.resizableContentHoverWidget";xd._lastDimensions=new Xt(0,0);xd=pa=y3([_h(1,tt),_h(2,ei),_h(3,mu),_h(4,pi)],xd);let oM=class extends Y{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=dB("div.hover-row.status-bar"),this.actionsElement=re(this.hoverElement,dB("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(v3.render(this.actionsElement,e,i))}append(e){const t=re(this.actionsElement,e);return this._hasContent=!0,t}};oM=y3([_h(0,pi)],oM);class px{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return ln.EMPTY;const i=px._getLineDecorations(this._editor,t);return ln.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):ln.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=px._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return yL(t)}}function hB(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const fB=we;class wp extends Y{constructor(e,t,i){super(),this._renderDisposeables=this._register(new fe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new HK),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new mv({editor:this._editor},t,i)),this._computer=new lRe(this._editor),this._hoverOperation=this._register(new zK(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return wp.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=fB("div.hover-row.markdown-hover"),r=re(o,fB("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}wp.ID="editor.contrib.modesGlyphHoverWidget";class lRe{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=s=>({value:s}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const s of t){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||Zb(o)||i.push(...m$(o).map(e))}return i}}var cRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class dRe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function uRe(n,e,t,i,s){return cRe(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&fRe(o))return new dRe(n,o,e)}catch(o){uc(o)}})}function UK(n,e,t,i){const o=n.ordered(e).map((r,a)=>uRe(r,a,e,t,i));return ln.fromPromises(o).coalesce()}function hRe(n,e,t,i){return UK(n,e,t,i).map(s=>s.hover).toPromise()}Pm("_executeHoverProvider",(n,e,t)=>{const i=n.get(nt);return hRe(i.hoverProvider,e,t,rn.None)});function fRe(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var gRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xy=function(n,e){return function(t,i){e(t,i,n)}};const gB=we;class S0{constructor(e,t,i,s,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let rM=class{constructor(e,t,i,s,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new S0(this,e.range,[new gm().appendText(m("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;d>=0&&l>d&&e.range.startColumn>=d&&(h=!0,r.push(new S0(this,e.range,[{value:m("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new S0(this,e.range,[{value:m("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,_=g.range.endLineNumber===s?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||Zb(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new N(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new S0(this,b,m$(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ln.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return ln.EMPTY;const o=new H(e.range.startLineNumber,e.range.startColumn);return UK(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!Zb(r.hover.contents)).map(r=>{const a=r.hover.range?N.lift(r.hover.range):e.range;return new S0(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return pRe(e,t,this._editor,this._languageService,this._openerService)}};rM=gRe([xy(1,Ii),xy(2,mc),xy(3,ei),xy(4,nt)],rM);function pRe(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new fe;for(const r of e)for(const a of r.contents){if(Zb(a))continue;const l=gB("div.hover-row.markdown-hover"),c=re(l,gB("div.hover-contents")),d=o.add(new mv({editor:t},i,s));o.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const u=o.add(d.render(a));c.appendChild(u.element),n.fragment.appendChild(l)}return o}var mRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class We{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+We.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new We(this.value+We.sep+e)}}We.sep=".";We.None=new We("@@none@@");We.Empty=new We("");We.QuickFix=new We("quickfix");We.Refactor=new We("refactor");We.RefactorExtract=We.Refactor.append("extract");We.RefactorInline=We.Refactor.append("inline");We.RefactorMove=We.Refactor.append("move");We.RefactorRewrite=We.Refactor.append("rewrite");We.Notebook=new We("notebook");We.Source=new We("source");We.SourceOrganizeImports=We.Source.append("organizeImports");We.SourceFixAll=We.Source.append("fixAll");We.SurroundWith=We.Refactor.append("surround");var Qd;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(Qd||(Qd={}));function _Re(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>jK(e,t,n.include))||!n.includeSourceActions&&We.Source.contains(e))}function bRe(n,e){const t=e.kind?new We(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>jK(t,i,n.include))||!n.includeSourceActions&&t&&We.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function jK(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class th{static fromUser(e,t){return!e||typeof e!="object"?new th(t.kind,t.apply,!1):new th(th.getKindFromUser(e,t.kind),th.getApplyFromUser(e,t.apply),th.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new We(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class vRe{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return mRe(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(s){uc(s)}i&&(this.action.edit=i.edit)}return this})}}var mx=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const wRe="editor.action.codeAction",qK="editor.action.quickFix",yRe="editor.action.autoFix",CRe="editor.action.refactor",SRe="editor.action.sourceAction",GK="editor.action.organizeImports",KK="editor.action.fixAll";class A_ extends Y{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Zl(e.diagnostics)?Zl(t.diagnostics)?A_.codeActionsPreferredComparator(e,t):-1:Zl(t.diagnostics)?1:A_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(A_.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&We.QuickFix.contains(new We(e.kind))&&!!e.isPreferred)}}const pB={actions:[],documentation:void 0};function T_(n,e,t,i,s,o){var r;return mx(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],We.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new MAe(e,o),u=i.type===2,h=xRe(n,e,u?l:a),f=new fe,g=h.map(_=>mx(this,void 0,void 0,function*(){try{s.report(_);const v=yield _.provideCodeActions(e,t,c,d.token);if(v&&f.add(v),d.token.isCancellationRequested)return pB;const b=((v==null?void 0:v.actions)||[]).filter(y=>y&&bRe(a,y)),w=DRe(_,b,a.include);return{actions:b.map(y=>new vRe(y,_)),documentation:w}}catch(v){if(Cf(v))throw v;return uc(v),pB}})),p=n.onDidChange(()=>{const _=n.all(e);Ki(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(w=>w.actions).flat(),b=[...yL(_.map(w=>w.documentation)),...LRe(n,e,i,v)];return new A_(v,b,f)}finally{p.dispose(),d.dispose()}})}function xRe(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>_Re(t,new We(s))):!0)}function*LRe(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(s=a._getAdditionalMenuItems)===null||s===void 0?void 0:s.call(a,{trigger:t.type,only:(r=(o=t.filter)===null||o===void 0?void 0:o.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function DRe(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new We(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new We(s.kind)))return o.command}}var _x;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(_x||(_x={}));function kRe(n,e,t,i,s=rn.None){var o;return mx(this,void 0,void 0,function*(){const r=n.get(Iq),a=n.get(fs),l=n.get(hc),c=n.get(Ln);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(s),!s.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==_x.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=ERe(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function ERe(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Gt.registerCommand("_executeCodeActionProvider",function(n,e,t,i,s){return mx(this,void 0,void 0,function*(){if(!(e instanceof je))throw Xl();const{codeActionProvider:o}=n.get(nt),r=n.get(hs).getModel(e);if(!r)throw Xl();const a=lt.isISelection(t)?lt.liftSelection(t):N.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Xl();const l=typeof i=="string"?new We(i):void 0,c=yield T_(o,r,a,{type:1,triggerAction:Qd.Default,filter:{includeSourceActions:!0,include:l}},fp.None,rn.None),d=[],u=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var IRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ARe=function(n,e){return function(t,i){e(t,i,n)}},aM;let bx=aM=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Sf(()=>this.keybindingService.getKeybindings().filter(t=>aM.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===GK?i={kind:We.SourceOrganizeImports.value}:t.command===KK&&(i={kind:We.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},th.fromUser(i,{kind:We.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new We(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}};bx.codeActionCommands=[CRe,wRe,SRe,GK,KK];bx=aM=IRe([ARe(0,pi)],bx);E("symbolIcon.arrayForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",{dark:J,light:J,hcDark:J,hcLight:J},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const YK=Object.freeze({kind:We.Empty,title:m("codeAction.widget.id.more","More Actions...")}),TRe=Object.freeze([{kind:We.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:We.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:ie.wrench},{kind:We.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:ie.wrench},{kind:We.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:ie.wrench},{kind:We.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:ie.wrench},{kind:We.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:ie.symbolSnippet},{kind:We.Source,title:m("codeAction.widget.id.source","Source Action"),icon:ie.symbolFile},YK]);function NRe(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:YK,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((r=o.action.edit)===null||r===void 0)&&r.edits.length)}});const i=TRe.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new We(o.action.kind):We.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions)s.push({kind:"action",item:r,group:o.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return s}var MRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},RRe=function(n,e){return function(t,i){e(t,i,n)}},lM,Ug;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(Ug||(Ug={}));let _v=lM=class extends Y{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new B),this.onClick=this._onClick.event,this._state=Ug.Hidden,this._domNode=we("div.lightBulbWidget"),this._register(Tt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(Xge(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Nn(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(de.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(yRe))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(qK))===null||o===void 0?void 0:o.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=s.get(50),d=o.getLineContent(r),u=sD(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=r;if(!h){if(r>1&&!f(r-1))g-=1;else if(!f(r+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new Ug.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:lM._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Ug.Hidden&&(this.state=Ug.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...Ae.asClassNameArray(ie.lightBulb)),this._domNode.classList.add(...Ae.asClassNameArray(ie.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Ae.asClassNameArray(ie.lightbulbAutofix)),this._domNode.classList.add(...Ae.asClassNameArray(ie.lightBulb)),this._quickFixKbLabel?this.title=m("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=m("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};_v.ID="editor.contrib.lightbulbWidget";_v._posPref=[0];_v=lM=MRe([RRe(1,pi)],_v);var ZK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cM=function(n,e){return function(t,i){e(t,i,n)}},PRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const XK="acceptSelectedCodeAction",QK="previewSelectedCodeAction";class ORe{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s,o;i.text.textContent=(o=(s=e.group)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let dM=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new F1(e,_o);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){var s,o,r;if(!((s=e.group)===null||s===void 0)&&s.icon?(i.icon.className=Ae.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=oe(e.group.icon.color.id))):(i.icon.className=Ae.asClassName(ie.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=JK(e.label),i.keybinding.set(e.keybinding),lpe(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(XK))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(QK))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=m({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=m({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};dM=ZK([cM(1,pi)],dM);class FRe extends UIEvent{constructor(){super("acceptSelectedAction")}}class mB extends UIEvent{constructor(){super("previewSelectedAction")}}function BRe(n){if(n.kind==="action")return n.label}let uM=class extends Y{constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Cr),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new aa(e,this.domNode,a,[new dM(t,this._keybindingService),new ORe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:BRe},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?JK(l==null?void 0:l.label):"";return l.disabled&&(c=m({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>m({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Ff),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);const o=this._allMenuItems.map((c,d)=>{const u=document.getElementById(this._list.getElementID(d));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0}),r=Math.max(...o,e),a=.7,l=Math.min(s,document.body.clientHeight*a);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new mB:new FRe;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof mB):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const s=i[0],o=this._list.element(s);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return PRe(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};uM=ZK([cM(4,bu),cM(5,pi)],uM);function JK(n){return n.replace(/\r\n|\r|\n/g," ")}var WRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rE=function(n,e){return function(t,i){e(t,i,n)}};E("actionBar.toggledBackground",{dark:hh,light:hh,hcDark:hh,hcLight:hh},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const gf={Visible:new _e("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},$f=at("actionWidgetService");let pf=class extends Y{get isVisible(){return gf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Jr)}show(e,t,i,s,o,r,a){const l=gf.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(uM,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a??[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var s;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new fe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(K(l,le.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(K(d,le.POINTER_MOVE,()=>d.remove())),r.add(K(d,le.MOUSE_DOWN,()=>d.remove()));let u=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),r.add(g),u=g.getContainer().offsetWidth)}const h=(s=this._list.value)===null||s===void 0?void 0:s.layout(u);o.style.width=`${h}px`;const f=r.add(jd(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=we(e),s=new Xa(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};pf=WRe([rE(0,bu),rE(1,tt),rE(2,bt)],pf);ht($f,pf,1);const q1=100+1e3;Os(class extends Rm{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:gf.Visible,keybinding:{weight:q1,primary:9,secondary:[1033]}})}run(n){n.get($f).hide()}});Os(class extends Rm{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:gf.Visible,keybinding:{weight:q1,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get($f);e instanceof pf&&e.focusPrevious()}});Os(class extends Rm{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:gf.Visible,keybinding:{weight:q1,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get($f);e instanceof pf&&e.focusNext()}});Os(class extends Rm{constructor(){super({id:XK,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:gf.Visible,keybinding:{weight:q1,primary:3,secondary:[2137]}})}run(n){const e=n.get($f);e instanceof pf&&e.acceptSelected()}});Os(class extends Rm{constructor(){super({id:QK,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:gf.Visible,keybinding:{weight:q1,primary:2051}})}run(n){const e=n.get($f);e instanceof pf&&e.acceptSelected(!0)}});var VRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const HRe=new _e("supportedCodeAction","");class zRe extends Y{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new pc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>nP(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Qd.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=i.getPosition(),r=t.getLineContent(s);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(s)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}}var ih;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(Cf(r))return eY;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(ih||(ih={}));const eY=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class $Re extends Y{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Jr),this._state=ih.Empty,this._onDidChangeState=this._register(new B),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=HRe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(ih.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(ih.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var s;return(s=i.providedCodeActionKinds)!==null&&s!==void 0?s:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new zRe(this._editor,this._markerService,i=>{var s;if(!i){this.setState(ih.Empty);return}const o=i.selection.getStartPosition(),r=gc(a=>VRe(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Qd.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(We.QuickFix))){const g=yield T_(this._registry,e,i.selection,i.trigger,fp.None,a);if(a.isCancellationRequested)return eY;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?We.QuickFix.contains(new We(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,w=Number.MAX_VALUE,y=!1;for(const S of _){const L=S.endColumn,x=S.endLineNumber,D=S.startLineNumber;(x===v.lineNumber||D===v.lineNumber)&&Math.abs(v.column-L){k.highlightRange=k.action.isPreferred}),D.push(...x.validActions)),{validActions:D,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return T_(this._registry,e,i.selection,i.trigger,fp.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new ih.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Qd.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var URe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pl=function(n,e){return function(t,i){e(t,i,n)}},x0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},uC;const jRe="quickfix-edit-highlight";let bv=uC=class extends Y{static get(e){return e.getContribution(uC.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new Jr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new $Re(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Sf(()=>{const u=this._editor.getContribution(_v.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(bx),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var o;if(!this._editor.hasModel())return;(o=fr.get(this._editor))===null||o===void 0||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return x0(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(kRe,e,_x.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Qd.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return x0(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(d){pt(d);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((s=e.trigger.filter)===null||s===void 0)&&s.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(u,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(r=fr.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const d=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!d&&!c.validActions.length)){(l=fr.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return x0(this,void 0,void 0,function*(){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=H.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>x0(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),s.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),s.clear()},onHover:(c,d)=>x0(this,void 0,void 0,function*(){var u;if(yield c.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((u=c.action.edit)===null||u===void 0)&&u.edits.length)}}),onFocus:c=>{var d,u;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:uC.DECORATION}];s.set(h);const f=c.action.diagnostics[0],g=(u=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||u===void 0?void 0:u.word;Ab(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,NRe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Nn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>{var r;return{id:o.id,label:o.title,tooltip:(r=o.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:m("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}};bv.ID="editor.contrib.codeActionController";bv.DECORATION=et.register({description:"quickfix-highlight",className:jRe});bv=uC=URe([pl(1,ol),pl(2,tt),pl(3,bt),pl(4,nt),pl(5,T1),pl(6,fs),pl(7,ei),pl(8,$f),pl(9,bt)],bv);xr((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Pa));const i=n.getColor(ed);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Jl(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var tY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vx=function(n,e){return function(t,i){e(t,i,n)}};class _B{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let hM=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._dispoables=new fe,this._markers=[],this._nextIdx=-1,je.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=gb(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=N.compareRangesUsingStarts(a,l)||Qt.compare(a.severity,l.severity):c=Qt.compare(a.severity,l.severity)||N.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:je.isUri(e)?e:void 0,severities:Qt.Error|Qt.Warning|Qt.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new _B(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=h$(this._markers,{resource:e.uri},(r,a)=>gb(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ug=function(n,e){return function(t,i){e(t,i,n)}},pM;class GRe{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new fe,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Hi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new xj(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Pt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=xf(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);Lo(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=we("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=re(this._codeLink,we("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Lo(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Zl(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const _=document.createElement("span");_.innerText=f.message,g.appendChild(p),g.appendChild(_),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Qt.Error:t=m("Error","Error");break;case Qt.Warning:t=m("Warning","Warning");break;case Qt.Info:t=m("Info","Info");break;case Qt.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}let Cm=pM=class extends hx{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new fe,this._onDidSelectRelatedInformation=new B,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Qt.Warning,this._backgroundColor=z.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(XRe);let t=mM,i=KRe;this._severity===Qt.Warning?(t=hC,i=YRe):this._severity===Qt.Info&&(t=_M,i=ZRe);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(IK),secondaryHeadingColor:e.getColor(AK)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(pM.TitleMenu,this._contextKeyService);tG(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=re(e,we(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new GRe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=N.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m("problems","{0} of {1} problems",t,i):m("change","{0} of {1} problem",t,i);this.setTitle(ta(a.uri),l)}this._icon.className=`codicon ${gM.className(Qt.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Cm.TitleMenu=new A("gotoErrorTitleMenu");Cm=pM=qRe([ug(1,oo),ug(2,mc),ug(3,fu),ug(4,bt),ug(5,tt),ug(6,dD)],Cm);const bB=Rb(Ma,$_e),vB=Rb(vo,Nb),wB=Rb(ks,Mb),mM=E("editorMarkerNavigationError.background",{dark:bB,light:bB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),KRe=E("editorMarkerNavigationError.headerBackground",{dark:ye(mM,.1),light:ye(mM,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),hC=E("editorMarkerNavigationWarning.background",{dark:vB,light:vB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),YRe=E("editorMarkerNavigationWarning.headerBackground",{dark:ye(hC,.1),light:ye(hC,.1),hcDark:"#0C141F",hcLight:ye(hC,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),_M=E("editorMarkerNavigationInfo.background",{dark:wB,light:wB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),ZRe=E("editorMarkerNavigationInfo.headerBackground",{dark:ye(_M,.1),light:ye(_M,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),XRe=E("editorMarkerNavigation.background",{dark:Gi,light:Gi,hcDark:Gi,hcLight:Gi},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var QRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ly=function(n,e){return function(t,i){e(t,i,n)}},nY=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Z0;let Jd=Z0=class{static get(e){return e.getContribution(Z0.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new fe,this._editor=e,this._widgetVisible=sY.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Cm,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,o,r;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!N.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:N.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new H(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,s;return nY(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);r&&((i=Z0.get(r))===null||i===void 0||i.close(),(s=Z0.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};Jd.ID="editor.contrib.markerController";Jd=Z0=QRe([Ly(1,iY),Ly(2,tt),Ly(3,$t),Ly(4,bt)],Jd);class $D extends Zt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return nY(this,void 0,void 0,function*(){t.hasModel()&&((i=Jd.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Ld extends $D{constructor(){super(!0,!1,{id:Ld.ID,label:Ld.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:578,weight:100},menuOpts:{menuId:Cm.TitleMenu,title:Ld.LABEL,icon:Yi("marker-navigation-next",ie.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Ld.ID="editor.action.marker.next";Ld.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Vh extends $D{constructor(){super(!1,!1,{id:Vh.ID,label:Vh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:1602,weight:100},menuOpts:{menuId:Cm.TitleMenu,title:Vh.LABEL,icon:Yi("marker-navigation-previous",ie.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Vh.ID="editor.action.marker.prev";Vh.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class JRe extends $D{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:m("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:66,weight:100},menuOpts:{menuId:A.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class e4e extends $D{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:m("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:1090,weight:100},menuOpts:{menuId:A.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Sr(Jd.ID,Jd,4);Xe(Ld);Xe(Vh);Xe(JRe);Xe(e4e);const sY=new _e("markersNavigationVisible",!1),t4e=wr.bindToContribution(Jd.get);ke(new t4e({id:"closeMarkersNavigation",precondition:sY,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:$.focus,primary:9,secondary:[1033]}}));var i4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aE=function(n,e){return function(t,i){e(t,i,n)}};const Jo=we;class n4e{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const yB={type:1,filter:{include:We.QuickFix},triggerAction:Qd.QuickFixHover};let bM=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new N(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new n4e(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return Y.None;const i=new fe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>Qt.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=Jo("div.hover-row"),s=re(i,Jo("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=re(s,Jo("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=Jo("span");if(o){const g=re(d,Jo("span"));g.innerText=o}const u=re(d,Jo("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(K(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=re(u,Jo("span"));h.innerText=a.value;const f=re(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=re(s,Jo("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Zl(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=re(s,Jo("div"));g.style.marginTop="8px";const p=re(g,Jo("a"));p.innerText=`${ta(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(K(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(pt)}));const _=re(g,Jo("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Qt.Error||t.marker.severity===Qt.Warning||t.marker.severity===Qt.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Ld.ID,run:()=>{var s;e.hide(),(s=Jd.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(Jo("div"));this.recentMarkerCodeActionsInfo&&(KS.makeKey(this.recentMarkerCodeActionsInfo.marker)===KS.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=m("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Y.None:i.add(rS(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=String.fromCharCode(160));const r=this.getCodeActions(t.marker);i.add(Ze(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=m("noQuickFixes","No quick fixes available");return}s.style.display="none";let l=!1;i.add(Ze(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:qK,run:c=>{l=!0;const d=bv.get(this._editor),u=Nn(c);e.hide(),d==null||d.showCodeActions(yB,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},pt)}}getCodeActions(e){return gc(t=>T_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new N(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),yB,fp.None,t))}};bM=i4e([aE(1,B4),aE(2,mc),aE(3,nt)],bM);const s4e="editor.action.inlineSuggest.showPrevious",o4e="editor.action.inlineSuggest.showNext";var r4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class a4e extends Y{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Yhe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new fe),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new vv(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Xa(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(s,o)=>{var r;if(s.id===vv.ID)return this.toggleMenuActionViewItem=new zS(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ae.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:ie.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(s,o);if(a)return a}if(s instanceof kL){const a=new zS(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var t,i,s;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(s=o==null?void 0:o.getLabel())!==null&&s!==void 0?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class vv extends So{constructor(e,t){t=t||m("moreActions","More Actions..."),super(vv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return r4e(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}vv.ID="toolbar.toggle.more";var l4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},L0=function(n,e){return function(t,i){e(t,i,n)}};let vM=class extends a4e{constructor(e,t,i,s,o,r,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=r.lookupKeybinding(c.id))!==null&&d!==void 0?d:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._sessionDisposables=this._store.add(new fe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var s,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==-1)for(let f=0;f_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let _=0;_=g&&(a[_]=void 0,u[_]=v))}}iF(a),iF(u),super.setActions(a,Rn.join(u,l)),c.length>0&&this._sessionDisposables.add(K(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const w=new rr(f),y=this.getItemAction(w.target);if(!y)return;w.preventDefault(),w.stopPropagation();let S=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){S=!0;for(let D=0;Dthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>w,getActions:()=>x,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(v=this._options)===null||v===void 0?void 0:v.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};vM=l4e([L0(2,fu),L0(3,tt),L0(4,vu),L0(5,pi),L0(6,hc)],vM);var C3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qr=function(n,e){return function(t,i){e(t,i,n)}},fC;let CB=class extends Y{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Is(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=mt(this,s=>{var o,r,a;const l=(o=this.model.read(s))===null||o===void 0?void 0:o.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const d=new H(l.lineNumber,Math.min(c,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Hs((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(Sm,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ze(()=>e.removeContentWidget(a))),o.add(ai(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==MI.Explicit&&r.triggerExplicitly()}))}))}};CB=C3([qr(2,bt)],CB);const c4e=Yi("inline-suggestion-hints-next",ie.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),d4e=Yi("inline-suggestion-hints-previous",ie.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Sm=fC=class extends Y{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new So(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${fC.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=dn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[dn("div@toolBar")]),this.previousAction=this.createCommandAction(s4e,m("previous","Previous"),Ae.asClassName(d4e)),this.availableSuggestionCountAction=new So("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(o4e,m("next","Next"),Ae.asClassName(c4e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(A.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new xi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new xi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(wM,this.nodes.toolBar,A.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof qa)return l.createInstance(h4e,h,void 0);if(h===this.availableSuggestionCountAction){const g=new u4e(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{fC._dropDownVisible=h})),this._register(ai(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(ai(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ai(h=>{const f=this._extraCommands.read(h);if(Ki(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:_=>this._commandService.executeCommand(p.id)}));for(const[p,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof qa&&g.push(v);g.length>0&&g.unshift(new Rn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Sm._dropDownVisible=!1;Sm.id=0;Sm=fC=C3([qr(6,fs),qr(7,bt),qr(8,pi),qr(9,tt),qr(10,fu)],Sm);class u4e extends fD{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class h4e extends pm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=dn("div.keybinding").root;new F1(t,_o,Object.assign({disableTitle:!0},zke)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let wM=class extends vM{constructor(e,t,i,s,o,r,a,l){super(e,Object.assign({resetMenu:t},i),s,o,r,a,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,s,o,r,a;const l=[],c=[];tG(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Ki(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ki(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};wM=C3([qr(3,fu),qr(4,tt),qr(5,vu),qr(6,pi),qr(7,hc)],wM);var f4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Dy=function(n,e){return function(t,i){e(t,i,n)}},yM;const g4e=!1;let eo=yM=class extends Y{static get(e){return e.getContribution(yM.ID)}constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=s,this._keybindingService=o,this._toUnhook=new fe,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new xi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===xd.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===wp.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const s=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(s)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,s,o,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===xd.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(s=e.event.browserEvent.view)===null||s===void 0?void 0:s.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===xd.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===wp.ID)}_onEditorMouseMove(e){var t,i,s,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((s=this._contentWidget)===null||s===void 0)&&s.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,s;if(!e)return;const o=e.target,r=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!g4e||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new wp(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),s=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!s&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Sm.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(gx,this._editor)),this._contentWidget}showContentHover(e,t,i,s,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};eo.ID="editor.contrib.hover";eo=yM=f4e([Dy(1,bt),Dy(2,mc),Dy(3,Ii),Dy(4,pi)],eo);class p4e extends Zt{constructor(){super({id:"editor.action.showHover",label:m({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:Fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=eo.get(t);if(!s)return;const o=t.getPosition(),r=new N(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);s.isHoverVisible?s.focus():s.showContentHover(r,1,1,a)}}class m4e extends Zt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:m({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=eo.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new N(s.lineNumber,s.column,s.lineNumber,s.column),r=ff.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class _4e extends Zt{constructor(){super({id:"editor.action.scrollUpHover",label:m({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:16,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollUp()}}class b4e extends Zt{constructor(){super({id:"editor.action.scrollDownHover",label:m({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:18,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollDown()}}class v4e extends Zt{constructor(){super({id:"editor.action.scrollLeftHover",label:m({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:15,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollLeft()}}class w4e extends Zt{constructor(){super({id:"editor.action.scrollRightHover",label:m({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:17,weight:100}})}run(e,t){const i=eo.get(t);i&&i.scrollRight()}}class y4e extends Zt{constructor(){super({id:"editor.action.pageUpHover",label:m({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=eo.get(t);i&&i.pageUp()}}class C4e extends Zt{constructor(){super({id:"editor.action.pageDownHover",label:m({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=eo.get(t);i&&i.pageDown()}}class S4e extends Zt{constructor(){super({id:"editor.action.goToTopHover",label:m({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=eo.get(t);i&&i.goToTop()}}class x4e extends Zt{constructor(){super({id:"editor.action.goToBottomHover",label:m({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=eo.get(t);i&&i.goToBottom()}}Sr(eo.ID,eo,2);Xe(p4e);Xe(m4e);Xe(_4e);Xe(b4e);Xe(v4e);Xe(w4e);Xe(y4e);Xe(C4e);Xe(S4e);Xe(x4e);w3.register(rM);w3.register(bM);xr((n,e)=>{const t=n.getColor(sbe);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});function L4e(n){return new Worker(""+new URL("json.worker-6Bi5nuQf.js",import.meta.url).href,{name:n==null?void 0:n.name})}self.MonacoEnvironment={getWorker(n,e){if(e==="json")return new L4e;throw new Error("Unsupported language: "+e)}};class D4e extends jg{constructor(){super();Dn(this,"_editor");Dn(this,"_initialValue")}set value(t){this._editor?this._editor.setValue(t):this._initialValue=t}get value(){var t;return((t=this._editor)==null?void 0:t.getValue())??this._initialValue}createRenderRoot(){return this}disconnectedCallback(){var t,i,s;(t=this._editor)==null||t.dispose(),(s=(i=this._editor)==null?void 0:i.getModel())==null||s.dispose()}render(){return ji}firstUpdated(){this._editor=oK.create(this,{value:this._initialValue,language:"json",minimap:{enabled:!1},fontFamily:"'Source Code Pro', monospace",fontSize:12}),this._editor.getModel().onDidChangeContent(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{}}))}),new ResizeObserver(i=>{this._editor.layout()}).observe(this)}}customElements.define("code-editor",D4e);/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function*a4e(n,e){if(n!==void 0){let t=0;for(const i of n)yield e(i,t++)}}var Il;class zK extends jg{constructor(){super();et(this,Il,void 0);Dn(this,"files");this.missingFiles=new Set}createRenderRoot(){return this}render(){return Ti` + */function*k4e(n,e){if(n!==void 0){let t=0;for(const i of n)yield e(i,t++)}}var Tl;class oY extends jg{constructor(){super();Fe(this,Tl,void 0);Dn(this,"files");this.missingFiles=new Set}createRenderRoot(){return this}render(){return zt`

    - ${Object.keys(this.files).map(t=>Ti` + ${Object.keys(this.files).map(t=>zt`
    - ${c4e(this.files[t].data)} + ${I4e(this.files[t].data)}
    `)} -
    - ${this.missingFiles.size?Ti`
    +
    + ${this.missingFiles.size?zt`

    Please add the following files:

      - ${a4e(this.missingFiles,t=>Ti`
    • ${t}
    • `)} + ${k4e(this.missingFiles,t=>zt`
    • ${t}
    • `)}
    `:ji} - ${l4e(t=>this._handleFiles(t))} + ${E4e(t=>this._handleFiles(t))}
    - `}async _handleFiles(t){const s=t.target.files;for(const o of s){const r=await d4e(o),a=jM(r,{type:u4e(r,o.name),parse:"auto"});this.files[o.name]={metadata:o,data:a},Ei(this,Il,o.name)}this.requestUpdate(),this.dispatchEvent(new CustomEvent("upload",{detail:{}}))}_changeTab(t){const s=t.target.parentElement.dataset.name;Ei(this,Il,s),t.preventDefault(),this.requestUpdate()}}Il=new WeakMap,Dn(zK,"properties",{missingFiles:{type:Set,attribute:!1}});customElements.define("file-pane",zK);function l4e(n){return Ti`
    + `}async _handleFiles(t){const s=t.target.files;for(const o of s){const r=await A4e(o),a=tR(r,{type:T4e(r,o.name),parse:"auto"});this.files[o.name]={metadata:o,data:a},_i(this,Tl,o.name)}this.requestUpdate(),this.dispatchEvent(new CustomEvent("upload",{detail:{}}))}_changeTab(t){const s=t.target.parentElement.dataset.name;_i(this,Tl,s),t.preventDefault(),this.requestUpdate()}}Tl=new WeakMap,Dn(oY,"properties",{missingFiles:{type:Set,attribute:!1}});customElements.define("file-pane",oY);function E4e(n){return zt` -
    `}function c4e(n){const e=Object.keys(n[0]),t=n.slice(0,30),i=e.map(a=>"text-align: "+(typeof n[0][a]=="number"?"right":"left")),s=a=>Ti` + `}function I4e(n){const e=Object.keys(n[0]),t=n.slice(0,30),i=e.map(a=>"text-align: "+(typeof n[0][a]=="number"?"right":"left")),s=a=>zt` - ${e.map((l,c)=>Ti`${a[l]} `)} + ${e.map((l,c)=>zt`${a[l]} `)} - `,o=()=>Ti` + `,o=()=>zt` - ${e.map((a,l)=>Ti`... `)} + ${e.map((a,l)=>zt`... `)} - `;return Ti` + `;return zt` - ${(()=>Ti` + ${(()=>zt` - ${e.map((a,l)=>Ti` `)} + ${e.map((a,l)=>zt` `)} `)()} @@ -3434,58 +3493,58 @@ The flag will not be saved for the future. ${t.length
    ${a}${a}
    - `}function d4e(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=t,i.readAsText(n)})}function u4e(n,e){return/\.json$/.test(e)?"json":n.indexOf(" ")>=0?"tsv":"csv"}function $K(n){if(typeof n=="object"&&n!==null){n.description&&(n.markdownDescription=n.description);for(const e in n)n.hasOwnProperty(e)&&(n[e]=$K(n[e]))}return n}g4e();const UK="playgroundSpec",jK=xB(),h3=xB(),qK={};let f3=new Set,iE,dB="";const aC=["stacked","parallel","full"];let hM=aC[0],lC,GK="";async function h4e(){const e=new URLSearchParams(window.location.search).get("spec");if(e){const s=await fetch(e);return lC=e.match(/.*\//)[0],s.text()}const t=window.localStorage.getItem(UK),i=(t==null?void 0:t.length)>0?t:tue;return console.log("Jeejee",i),i}function f4e(){hM=aC[(aC.indexOf(hM)+1)%aC.length],g3(),window.dispatchEvent(new Event("resize"))}function g4e(){$K(x6),$G.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[{uri:"https://unpkg.com/@genome-spy/core/dist/schema.json",fileMatch:["*"],schema:x6}]})}function p4e(n){let e=qK[n];return e||f3.add(n),e==null?void 0:e.data}async function KK(n=!1){var t,i;f3=new Set,lC&&window.location.search&&window.history.replaceState(null,"",window.location.pathname);const e=(t=h3.value)==null?void 0:t.value;e&&window.localStorage.setItem(UK,e);try{const s=JSON.parse(e),o=JSON.stringify(s);if(o===dB&&!n)return;dB=o,iE&&iE.finalize(),lC&&!s.baseUrl&&(s.baseUrl=lC),GK=(i=qs(s.description))==null?void 0:i[0],iE=await Qde(jK.value,s,{namedDataProvider:p4e}),g3()}catch(s){console.log(s)}}const m4e=()=>Ti` + `}function A4e(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=t,i.readAsText(n)})}function T4e(n,e){return/\.json$/.test(e)?"json":n.indexOf(" ")>=0?"tsv":"csv"}function rY(n){if(typeof n=="object"&&n!==null){n.description&&(n.markdownDescription=n.description);for(const e in n)n.hasOwnProperty(e)&&(n[e]=rY(n[e]))}return n}R4e();const aY="playgroundSpec",lY=FB(),S3=FB(),cY={};let x3=new Set,lE,SB="";const gC=["stacked","parallel","full"];let CM=gC[0],pC,dY="";async function N4e(){const e=new URLSearchParams(window.location.search).get("spec");if(e){const s=await fetch(e);return pC=e.match(/.*\//)[0],s.text()}const t=window.localStorage.getItem(aY),i=(t==null?void 0:t.length)>0?t:yue;return console.log("Jeejee",i),i}function M4e(){CM=gC[(gC.indexOf(CM)+1)%gC.length],L3(),window.dispatchEvent(new Event("resize"))}function R4e(){rY(F6),rK.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[{uri:"https://unpkg.com/@genome-spy/core/dist/schema.json",fileMatch:["*"],schema:F6}]})}function P4e(n){let e=cY[n];return e||x3.add(n),e==null?void 0:e.data}async function uY(n=!1){var t,i;x3=new Set,pC&&window.location.search&&window.history.replaceState(null,"",window.location.pathname);const e=(t=S3.value)==null?void 0:t.value;e&&window.localStorage.setItem(aY,e);try{const s=JSON.parse(e),o=JSON.stringify(s);if(o===SB&&!n)return;SB=o,lE&&lE.finalize(),pC&&!s.baseUrl&&(s.baseUrl=pC),dY=(i=js(s.description))==null?void 0:i[0],lE=await bue(lY.value,s,{namedDataProvider:P4e}),L3()}catch(s){console.log(s)}}const O4e=()=>zt`
    - GenomeSpy + GenomeSpy GenomeSpy Playground - - ${GK} + ${dY} v${L6.version}v${B6.version} ${s5(oX).node[0]} Docs${p5(CX).node[0]} Docs
    -`,_4e=FC(()=>KK(),500,!1),b4e=()=>Ti` -
    - ${m4e()} +`,F4e=lb(()=>uY(),500,!1),B4e=()=>zt` +
    + ${O4e()}
    -
    +
    -`;function g3(){M_(b4e(),document.body)}g3();h4e().then(n=>{h3.value.value=n});export{TAe as m}; +`;function L3(){Rp(B4e(),document.body)}L3();N4e().then(n=>{S3.value.value=n});export{XAe as m}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["./index-X47Qq1Ab.js","./_commonjsHelpers-5FjdjvmD.js","./index-lKx8UKfw.js","./__vite-browser-external-_eDSiqyj.js","./long-GBRvvkNx.js","./index-q6UT6DYT.js","./remoteFile-KLpGJmSL.js","./index-jFC45F8W.js","./index-9VfcUAh4.js","./index-ksAmfmp1.js","./index-P-r8iX32.js","./index-iJ7AaoXZ.js","./index-Q6MnDN88.js"] diff --git a/playground/assets/jsonMode-HHMLu35g.js b/playground/assets/jsonMode-7xyoogtf.js similarity index 99% rename from playground/assets/jsonMode-HHMLu35g.js rename to playground/assets/jsonMode-7xyoogtf.js index 23ef9f1..168044e 100644 --- a/playground/assets/jsonMode-HHMLu35g.js +++ b/playground/assets/jsonMode-7xyoogtf.js @@ -1,4 +1,4 @@ -var Ge=Object.defineProperty;var Qe=(e,n,i)=>n in e?Ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ze}from"./index-Q0RIeOFr.js";/*!----------------------------------------------------------------------------- +var Ge=Object.defineProperty;var Qe=(e,n,i)=>n in e?Ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ze}from"./index-C09rCq98.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/playground/index.html b/playground/index.html index 0dd717a..7f44493 100644 --- a/playground/index.html +++ b/playground/index.html @@ -8,7 +8,7 @@ - +